Coder Social home page Coder Social logo

simformsolutionspvtltd / flutter_calendar_view Goto Github PK

View Code? Open in Web Editor NEW
401.0 6.0 244.0 8.91 MB

A Flutter package allows you to easily implement all calendar UI and calendar event functionality. πŸ‘ŒπŸ”πŸŽ‰

Home Page: https://pub.dev/packages/calendar_view

License: MIT License

Kotlin 0.04% Swift 0.30% Objective-C 0.01% Dart 86.81% HTML 0.45% CMake 4.23% C++ 7.12% C 0.24% Ruby 0.79%
flutter dart calendar package plugin widget

flutter_calendar_view's Issues

support Jalali Date

i can give you useful data for add Jalali date to calendar you can use this package for convert Gregorian to Jalali date https://pub.dev/packages/shamsi_date
and this package for convert English numbers to Persian numbers [https://pub.dev/packages/shamsi_date]
and then make this calendar AMAZING!

Scroll to index/liveTime

Hi, i've ben testing your library on my project.
I didn't found any way to scroll to an event index or liveTimeIndicator, is this possible?

Is dark theme available for this widget?

Hi ,
Is there a way to enable dark mode for this calender view ?

I was able to change theme for timeLineBuilder and background in Day View. My issue is specifically with dayTitleBuilder. How can I customize dayTitleBuilder.?

EventController remove event don't work

#28

I have a CalendarControllerProvider with an EventController. When i try to do :
_eventController.remove(event);

I've got this error :

[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: Concurrent modification during iteration: Instance(length:1224) of '_GrowableList'.
E/flutter (19491): #0      ListIterator.moveNext (dart:_internal/iterable.dart:336:7)
E/flutter (19491): #1      _MonthEvent.removeEvent (package:calendar_view/src/event_controller.dart:204:21)
E/flutter (19491): #2      _YearEvent.removeEvent (package:calendar_view/src/event_controller.dart:174:11)
E/flutter (19491): #3      EventController.remove (package:calendar_view/src/event_controller.dart:58:11)
E/flutter (19491): #4      _CalendarPageState.showCreateEditEventDialog (package:myapp/page/calendar_page/calendar_page.dart:468:26)

I think it's because in MonthEvent, in removeEvent (line 203). We try to remove an event when we read the list.

Month view scrolls too far to blank area

I'm adding MonthView() to my project and it scrolls to reveal the full month (which is fine) but it also scrolls past that and shows a blank area after that. I can't seem to get it to only scroll to show the month and nothing else (like in the example).

Screen.Recording.2022-10-05.at.2.28.45.PM.mov

My code structure is as follows:

DefaultTabController(
     child: Scaffold(
            ....
            body: TabBarView(....: [
                 ....
                 MonthView(),
            ])
    )
)

I've wrapped MonthView in a sizedbox or a container and it changes the size of the total widget but doesn't change the behavior. This is scrolling just the weeks, not the header (so not the entire MonthView widget) which makes me think this is a MonthView widget issue (or maybe I haven't formatted it correctly or something). Any insights would be appreciated!

More customization without creating our own builder

Hi!
Would it be possible to change some settings of the MonthView without using headerBuilder?
For example, change Icons colors, header's background color. (as you can see, all the changes would be focused on colors, because it's recurrent to customize them without having the need to change everything).

Thanks for this great package!

WeekDayTile causes RenderFlex-Overflow

I am using calendar_view (monthView) in a flutter web-project. Resizing the calendar_view works alright, except for the week-day-row.

When we reduce the screensize the weekDay-tiles are not resized (they keep the width with which they were initialized once), which creates a Renderflex-Overflow on the right side.

Bildschirmfoto vom 2022-02-23 14-27-56

Missing redraw events

Hello,

I'm using bloc and Tabbars

  final List<Widget> _views = [
    const DayView(),
    const WeekView(),
    const MonthView(),
  ];

  Widget get _calendar =>
      BlocBuilder<DataBloc, DataState>(builder: (context, state) {
        // if the data is fetched convert the appointments in events
        List<CalendarEventData<Appointment>> events = [];
        if (state is FetchedData) {
          events = (state.data as List<Appointment>)
              .map((appointment) => _appointmentToEvent(appointment))
              .toList(growable: false);
        }

        // Create the content
        return CalendarControllerProvider(
          controller: EventController()..addAll(events),
          child: TabBarView(children: _views),
        );
      });

I have three tabs: Day, Week and Month.
The WeekView is the middle tab and is the one selected by default.
As I'm using bloc the function _calendar will be called two time: on fetching data with events empty and on fetched data with events filled.

The WeekView calendar is drawn proper but without events. If I change tab and select once of the others I see the events on calendars DayView and also MonthView. Now when back to Week pressing on tab I see the events listed proper inside the calendar WeekView.

Thanks for your support.
Sam

Cell error in week view

Events are stacked incorrectly, they are stacked on one side of the container without using the full width of the cell, which causes that you only see 2 colored lines when they could be expanded more.

WhatsApp Image 2022-08-29 at 2 06 46 PM

Web - week view layout issue

Dear Simform Solutions,

Im Facing in issue in the week view when it shows in web view.
as shown in this image
im using it with fluent_ui i dont know if it help to check it

══║ EXCEPTION CAUGHT BY RENDERING LIBRARY β•žβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β• The following assertion was thrown during layout: The specific RenderFlex in question is: RenderFlex#23156 relayoutBoundary=up2 OVERFLOWING: creator: Row ← SizedBox ← Column ← ConstrainedBox ← Container ← InternalWeekViewPage<Object?>-[<'602022-09-26 00:00:00.000'>] ← ValueListenableBuilder<bool> ← RepaintBoundary ← IndexedSemantics ← _SelectionKeepAlive ← NotificationListener<KeepAliveNotification> ← KeepAlive ← β‹― parentData: <none> (can use size) constraints: BoxConstraints(w=895.0, 0.0<=h<=Infinity) size: Size(895.0, 45.0) direction: horizontal mainAxisAlignment: start mainAxisSize: max crossAxisAlignment: start textDirection: ltr verticalDirection: down β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€β—’β—€ ════════════════════════════════════════════════════════════════════════════════════════════════════ Another exception was thrown: A RenderFlex overflowed by 265 pixels on the right. Another exception was thrown: A RenderFlex overflowed by 415 pixels on the right. Another exception was thrown: A RenderFlex overflowed by 265 pixels on the right.

Next month is wrong when page changes

Months with 31 days are buggy when pages change. For example, today: 31 March 2022, when I change the month page (in MonthView) the view jumps to 2022 May.

To reproduce the bug, you can simply use a mobile phone and change the current system date to 31 March (or any other months with 31 days) and try to swipe to change page.

WeekView shows only 1 event in a day

Hi,
I have encountered an issue with the WeekView events.
My WeekView controllers get a list of CalendarEventData that contain a couple of events in the same date, but the view shows only the first event on each day.

here is my code -
(_appointments it is the list of CalendarEventData)

@OverRide
Widget build(BuildContext context) {
return
WeekView(
controller: CalendarControllerProvider.of(context).controller..addAll(_appointments), //EventController(),
showLiveTimeLineInAllDays: true,
width: MediaQuery.of(context).size.width,
minDay: DateTime(2000),
maxDay: DateTime(2050),
initialDay: DateTime.now(),
heightPerMinute: 1,
eventArranger: SideEventArranger(),
onEventTap: (events, date) => print(events),
onDateLongPress: (date) => print(date),
startDay: WeekDays.sunday,
);
}

any help?

Adding onCellTap callback breaks whole calendar

Why am I getting this when I introduce a callback. When I remove callback, adding method works fine.

══║ EXCEPTION CAUGHT BY WIDGETS LIBRARY β•žβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
The following assertion was thrown building CalendarControllerProvider<dynamic>:
Assertion failed:
file:///......./hosted/pub.dartlang.org/calendar_view-0.0.4/lib/src/calendar_controller_provider.dart:25:9
..\…\src\calendar_controller_provider.dart:25
result != null
"No CalendarControllerProvider<Object?> found in context. To solve this issue either wrap material
app with 'CalendarControllerProvider<Object?>' or provide controller argument in respected calendar
view class."

Happens on web and mobile.

Flutter (Channel stable, 2.8.1)

Code:

class CalendarPage extends StatefulWidget {
  const CalendarPage({Key? key}) : super(key: key);

  @override
  State<CalendarPage> createState() => _CalendarPageState();
}

class _CalendarPageState extends State<CalendarPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: CalendarView(),
    );
  }
}

class CalendarView extends StatefulWidget {
  const CalendarView({ Key? key }) : super(key: key);

  @override
  State<CalendarView> createState() => _CalendarViewState();
}

class _CalendarViewState extends State<CalendarView> {

  late EventController eventController;

  @override
  void initState() {
    eventController = EventController();
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return CalendarControllerProvider(
      controller: eventController,
      child: Row(
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          MonthView(
            onCellTap: (a, c) {
            },
            // width: MediaQuery.of(context).size.width / 2,
          ),
          Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              ElevatedButton(
                onPressed: () {
                  try {
                    final event = CalendarEventData(
                      date: DateTime(2022, 4, 25),
                      event: "Event 1", 
                      title: 'test',
                    );
                    eventController.add(event);                    
                  } catch (e) {
                    print("$e");
                  }
                }, 
                child: Text("Add"),
              ),
            ],
          )
        ],
      ),
    );
  }
}

Unbounded height constraints when put as part of Sliver

Hi, I am trying to add the DayView in a Sliver, but whatever I try, I get one or other variation of "unbounded height constraints".
Code and exception below:

`Widget getCalendarView() {

return SliverList(
  delegate: SliverChildBuilderDelegate(
    (BuildContext context, int index) {
      return SingleChildScrollView(
        child: DayView(
          controller: EventController(),
        ),
      );
    },
    childCount: 1,
  ),
);

}`

I was looking for a way to declare that I want to shrink-wrap the DayView, but found none... any ideas?

Thanks and best regards
Kras

Exception:
The following assertion was thrown during performLayout():
RenderFlex children have non-zero flex but incoming height constraints are unbounded.

When a column is in a parent that does not provide a finite height constraint, for example if it is in a vertical scrollable, it will try to shrink-wrap its children along the vertical axis. Setting a flex on a child (e.g. using Expanded) indicates that the child is to expand to fill the remaining space in the vertical direction.
These two directives are mutually exclusive. If a parent is to shrink-wrap its child, the child cannot simultaneously expand to fit its parent.

Consider setting mainAxisSize to MainAxisSize.min and using FlexFit.loose fits for the flexible children (using Flexible rather than Expanded). This will allow the flexible children to size themselves to less than the infinite remaining space they would otherwise be forced to take, and then will cause the RenderFlex to shrink-wrap the children rather than expanding to fit the maximum constraints provided by the parent.

If this message did not help you determine the problem, consider using debugDumpRenderTree():
https://flutter.dev/debugging/#rendering-layer
http://api.flutter.dev/flutter/rendering/debugDumpRenderTree.html
The affected RenderFlex is: RenderFlex#408be relayoutBoundary=up17 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
parentData: (can use size)
constraints: BoxConstraints(w=411.4, 0.0<=h<=Infinity)
size: MISSING
direction: vertical
mainAxisAlignment: start
mainAxisSize: min
crossAxisAlignment: start
textDirection: ltr
verticalDirection: down
child 1: RenderDecoratedBox#419af NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
parentData: offset=Offset(0.0, 0.0); flex=null; fit=null
constraints: MISSING
size: MISSING
decoration: BoxDecoration
color: Color(0xffdcf0ff)
configuration: ImageConfiguration(bundle: PlatformAssetBundle#b0938(), devicePixelRatio: 2.6, locale: en_US, textDirection: TextDirection.ltr, platform: android)
child: RenderClipPath#eb64c NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
parentData:
constraints: MISSING
size: MISSING
child: RenderFlex#84689 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
parentData:
constraints: MISSING
size: MISSING
direction: horizontal
mainAxisAlignment: spaceBetween
mainAxisSize: max
crossAxisAlignment: center
needs compositing
parentData:
constraints: MISSING
size: MISSING
usefulness ratio: no metrics collected yet (never painted)
child: _RenderScrollSemantics#2aff5 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
parentData:
constraints: MISSING
semantic boundary
size: MISSING
The creator information is set to: Column ← DecoratedBox ← SizedBox ← MediaQuery ← Padding ← SafeArea ← DayView ← _SingleChildViewport ← IgnorePointer-[GlobalKey#33e91] ← Semantics ← Listener ← _GestureSemantics ← β‹―

Change default start hour in DayView

Is it possible to change the default start hour in DayView from 1am to something like 8am? I looked into the TimeLineMark, but am not what I should update it to.
Screen Shot 2022-04-01 at 12 28 59 PM

wrong _currentIndex calculation for _minDate.timeOfDay > _currentDate.timeOfDay // DayView

I have encountered an issue with the _currentIndex calculation for the DayView.
To not have the events displayed one day off when the _minDate time of the day is greater than that of the _currentDate
the _currentDate and _minDate should be "normalized" to the same hour e.g.

DateTime _currentNormalizedToHour = DateTime(_currentDate.year, _currentDate.month, _currentDate.day, 0);
DateTime _minNormalizedToHour = DateTime(_minDate.year, _minDate.month, _minDate.day, 0);
_currentIndex = _currentNormalizedToHour.getDayDifference(_minNormalizedToHour);
// _currentIndex = _currentDate.getDayDifference(_minDate);

To also always get the expected _totalDays _maxDate should also be normalized.

It would therefore probably be most convenient to change the getDayDifference method

Proper way to remove all events of a day?

What is the proper way to remove all events of a day?

I'm trying with below code

var controller = CalendarControllerProvider.of(context).controller;
var existingSlots = controller.getEventsOnDay(state.selectedDate);

existingSlots.forEach((event) {
    controller.remove(event);
});

E/flutter (21441): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: Concurrent modification during iteration: Instance(length:29) of '_GrowableList'.
E/flutter (21441): #0 ListIterator.moveNext (dart:_internal/iterable.dart:336:7)
E/flutter (21441): #1 _MonthEvent.removeEvent (package:calendar_view/src/event_controller.dart:204:21)
E/flutter (21441): #2 _YearEvent.removeEvent (package:calendar_view/src/event_controller.dart:174:11)
E/flutter (21441): #3 EventController.remove (package:calendar_view/src/event_controller.dart:58:11)

Add scroll offset for day and week view

#40

Hi,

I added a parameter to DayView and WeekView to manage the position of the scroll when first displayed.

For example, when we display the calendar, we prefer to display 8:00 a.m. at the top rather than 0:00 a.m.

Thank you

Change amount of rows (height) of month view.

Hello! I have implemented a month view and the available space is not the full screen. Therefore, the month view contains six rows (weeks) which scroll up and down with the cells having a fixed height. I do not want this, I would prefer:
Setting an arbitrary height of the month view (for example using an expanded widget), and for the cells to adjust their heigh (aspect ratio) appropriately so there never is scrolling. Or the option to have only 5 weeks displayed, but still the height of the cells should fix neatly, without the need to scroll up or down the month view. Thanks!

Is there support for locale?

Hi, I liked a lot this package, but I wasn't able to find a way to change locale.
is there any planning to support?

Thanks

Problem showing only 1 day in DayView

Before 1.0.0 (534f2b7) I could "hack" my way around this using:

DayView(  
minDay: DateTime.now(),  
maxDay: DateTime.now().add(const Duration(seconds: 1)),  
...
)

This is no longer possible. Is there a correct way of only displaying one day using the DayView?

DayView EventBuilder doesn't work

Eventbuilder for day view doesn't function

Doesn't call any function in it and is not returning any widget;

Tried putting a print statement in it too, still doesn't work

Notification

Thanks for this beautiful package, Just got to know of it today.

Please does the package support notification, let's say before an event date, you it will show a notification?

Pinch-to-Zoom in Day and Month View

Hi, I just wantet to ask if there is any intent or idea how to implement a pinch-to-zoom for the DayView and the MonthView. Basically its just about changing the heighPerMinute parameter. I have looked into warping the whole thing in a GestureDetector but this didnt really work since the view is scrollable into two directions already.

Weekview shows multi day events incorrect

I have an event created for multiple days with for example starttime 1pm on Saturday and endtime 2pm on the Monday after.

Code:

(
          event: booking,
          title: StringExtensions.toInitials(
            booking.user!.firstName,
            booking.user!.lastName,
          ),
          date: booking.startDateTime,
          startTime: booking.startDateTime,
          endTime: booking.endDateTime,
          endDate: booking.endDateTime,
          color: Color.fromARGB(255, 227, 83, 76),
)

It shows up like this:
image
image

What am I missing?

is there a way to create dayView with 30 minutes slots

I want to create day view with with 30 minutes slots.
for now it giving 1 hour slots so i am unable to arrange two event in one slot
when i do this my event tile gets overflow
how can i solve this

this my whole code where

Rx eventController = EventController().obs;

print statement for startDate and endDate
start time----------------------2022-05-06 15:00:00.000
endTime--------------------2022-05-06 15:30:00.000
start time----------------------2022-05-06 12:00:00.000
endTime--------------------2022-05-06 12:30:00.000
start time----------------------2022-05-06 14:30:00.000
endTime--------------------2022-05-06 15:00:00.000
start time----------------------2022-05-06 14:00:00.000
endTime--------------------2022-05-06 14:30:00.000
CalendarEventData data = CalendarEventData(
title: "$name",
color: Colors.pinkAccent,
description: serviceName,
date: startTime,
startTime: startTime,
endDate: endTime,
endTime: endTime,
);
eventController.value.add(data);

`DayView(
controller: controller.eventController.value,
timeLineOffset: 0.5,
timeLineBuilder: (date) {
return Text(DateFormat("HH:mm").format(date));
},
liveTimeIndicatorSettings: HourIndicatorSettings(color: Colors.red),
verticalLineOffset: 40,
eventTileBuilder: (date, events, boundary, start, end) {
print(" length ${events.length}");
String str =
"${DateFormat("HH:mm").format(events[0].startTime)}-${DateFormat("HH:mm").format(events[0].endTime)} ${events[0].title.substring(0, events[0].title.length - 1)}";
return Container(
color: events[0].color,
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Flexible(
child: Text("$str",
style: Get.textTheme.headline6.merge(
TextStyle(color: Get.theme.primaryColor),
)),
),
],
),
Row(
children: [
Flexible(child: Text("${events[0].description}")),
],
),
],
),
);
},
showVerticalLine: false,
// To display live time line in day view.
showLiveTimeLineInAllDays: true,
// To display live time line in all pages in day view.
heightPerMinute: 1.8,
eventArranger: SideEventArranger(),

                                onEventTap: (events, date) => print(events),
                              )`

mac@macs-Mac-mini-3 % flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[βœ“] Flutter (Channel stable, 2.10.5, on macOS 11.5.2 20G95 darwin-x64, locale en-US)
[βœ“] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[!] Xcode - develop for iOS and macOS (Xcode 12.5)
! Flutter recommends a minimum Xcode version of 13.
Download the latest version or update via the Mac App Store.
[βœ“] Chrome - develop for the web
[βœ“] Android Studio (version 2021.1)
[βœ“] Connected device (2 available)
[βœ“] HTTP Host Availability

! Doctor found issues in 1 category.
mac@macs-Mac-mini-3 zylu_business %

Bug Week View. Today 10pm to tommorw 8am event will trhow an error

_calendarWeekEventList.add(CalendarEventData( date: DateTime(2022, 08, 14, 20, 0), startTime: DateTime(2022, 08, 14, 20, 0), endTime: DateTime(2022, 08, 15, 8, 23), endDate: DateTime(2022, 08, 15, 8, 23), title: '${DateFormat.jm().format(_startDate)} ' '- ${DateFormat.jm().format(_endDate)} ' '\n${_provider.name}', event: _event.toJson(), description: _event.$id, color: colorFromString(_provider.color), ));

Error Message:
startDate must be less than endDate.
This error occurs when you does not provide startDate or endDate in CalendarEventDate or provided endDate occurs before startDate.
'package:calendar_view/src/event_arrangers/side_event_arranger.dart':
Failed assertion: line 130 pos 11: '!(endTime.getTotalMinutes <= startTime.getTotalMinutes)'

please help

on my calendar i just need these little arrows to select the weeks, i would like to remove the date information from the center and change the color from blue to white, could you explain to me how to do this? I tried but I couldn't
Sem tΓ­tulo

i try this but i recive this error

════════ Exception caught by gesture ═══════════════════════════════════════════
The following assertion was thrown while handling a gesture:
PageController.page cannot be accessed before a PageView is built with it.
'package:flutter/src/widgets/page_view.dart':
package:flutter/…/widgets/page_view.dart:1
Failed assertion: line 172 pos 7: 'positions.isNotEmpty'

_AssertionError ('package:flutter/src/widgets/page_view.dart': Failed assertion: line 172 pos 7: 'positions.isNotEmpty': PageController.page cannot be accessed before a PageView is built with it.)

try

weekPageHeaderBuilder: (DateTime startDate, DateTime endDate) {
        return Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
            IconButton(
              onPressed: ()=> controller.pageController.previousPage(duration: const Duration(milliseconds: 300), 
curve: Curves.linear),
              icon: const Icon(Icons.arrow_back_ios, size: 15,),
            ),
            IconButton(
              onPressed: (){},
              icon: const Icon(Icons.arrow_forward_ios, size: 15,),
            ),
          ],
        );
      },

my page controller and previous page method

late PageController pageController = PageController();

  void previousPage({Duration? duration, Curve? curve}) {
    pageController.previousPage(
      duration: duration ?? const Duration(milliseconds: 300),
      curve: curve ?? Curves.linear,
    );
  }

OnTap

Hi, How to get OnTap event appointment details?

Tks. Luciano

[BUG] Duplicate item in cells while adding events in the same session

First thanks for the package.

I faced a duplicate issue on my project and then I tested your code and it happen for 100%.

USE CASE : I simply add events on a common date and the last event is duplicated in cell :

Capture d’écran 2022-04-16 aΜ€ 15 34 05

The duplicate is visible only when a previous event is already present in the cell -> Bike task is alone only on the 20 and Swim only on 22-23
More events I add more it's duplicated x2, x3...

I checked current issue but nothing found related to this,
How can we solve this ?

Change starting hour in day view

Apologies if this has been requested previously, but is it possible to change the start time in day view from 1am to something else?
Screen Shot 2022-08-31 at 9 33 38 AM

I can't handle event added with EventController

The event I added with EventController seem not to work and the event won't be shown. Please tell me how to make it work.
I want you to tell me how to use this EventController with another MonthCalendar. I wish I use riverpod for it.
class WeekCalendar extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( body: WeekView( controller: EventController(), eventTileBuilder: (date, events, boundry, start, end) { // Return your widget to display as event tile. return Container(); }, showLiveTimeLineInAllDays: true, // To display live time line in all pages in week view. width: 400, // width of week view. heightPerMinute: 1, // height occupied by 1 minute time span. eventArranger: SideEventArranger(), // To define how simultaneous events will be arranged. onDateLongPress: (time) { try { final event = CalendarEventData( date: DateTime(2022, 6, 17), startTime: DateTime(2022, 6, 17, 15), endTime: DateTime(2022, 6, 17, 18), event: "Event 1", title: 'test', ); EventController().add(event); print(EventController().getEventsOnDay(DateTime(2022, 6, 17))); } catch (e) { print(e); } }, */ )); } }

Modifying CalendarEventData

I currently had the problem that I wanted to modify an existing event entry (in particular change start and end time). However, I did not find an option to modify existing events in this library, so I went with the solution to delete the event from the EventController first, and then add it again, with modified values.

However, during this approach, I noticed that the event is not correctly deleted from the controller, but still remains stored in the _eventList variable, where it leads to the event supposed to be deleted being represented multiple times in the DayView after subsequent modifications (which then call remove on the controller).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.