https://github.com/tcd93/flutter-device-calendar-list
Example codes (with additional features) of Flutter *device calendar plugin*, allow interacting with the device's calendar
https://github.com/tcd93/flutter-device-calendar-list
calendar calendar-events calendar-service calendar-widget device flutter flutter-examples
Last synced: about 2 months ago
JSON representation
Example codes (with additional features) of Flutter *device calendar plugin*, allow interacting with the device's calendar
- Host: GitHub
- URL: https://github.com/tcd93/flutter-device-calendar-list
- Owner: tcd93
- License: bsd-3-clause
- Created: 2020-04-05T15:07:52.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-10T03:13:22.000Z (about 6 years ago)
- Last Synced: 2025-04-09T04:20:13.396Z (about 1 year ago)
- Topics: calendar, calendar-events, calendar-service, calendar-widget, device, flutter, flutter-examples
- Language: Dart
- Homepage:
- Size: 88.9 KB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
_Example codes (with additional features) of Flutter **[device calendar plugin](https://pub.dev/packages/device_calendar)**, display a list of events & allow interacting with the device's calendar_


#### Architecture
State management: Mimic *Scoped Model* using *Provider*
Data model: `CustomEvent`

#### Extra contents:
- Scroll to nearest-to-date event on arrow button press
- Event item animations (slide / press trash bin to delete event)
_note: create/edit events with recurrence rule is not stable_
#### Best practices:
* _`FutureBuilder` is only used for building Widgets with __3__ states only: __initial -> processing -> done__._ It can not rebuild itself after that (unless you're _overwriting_ the _future_ instance, or calling a async method in the _future_ param, but those are bad practices) If you want to do more with the snapshot data later, like deleting/modifying it & update UI, use `Builder`, `StreamBuilder` or `ValueListenableBuilder` instead.
* _Make state management as consistent as possible_, either by using a state management tool (like `Provider`, `InheritedWidget`, `Scoped Model`...) or just passing state data via _constructor_, don't create a mixed mess of both.
- Note: Passing state objects through the widget tree is _not recommended_ by many as this is extremely non-scalable as the app grows bigger.
* _Don't abuse callbacks_, as the above note mentioned, you may never know if you suddenly need to wrap your widget by another widget (and Flutter is infamous for that), implement some kind of _event notifier/listener_ or use `ValueNotifier` class.
* _Dispose AnimationControllers immediately when they are not needed anymore_, it may cause conflicts with otherwise, even when you dispose them in Widget life cycle's `dispose()` method.
* *Operator overloading*: now this is a pretty grey area, use it with _immutable & unique object only!_
* _Always break down big widget into many smaller ones, don't use function for that._ Creating many scoped _context_ is good, it won't rebuild the entire tree when the something is modified.
* _Push `Provider.of` as far as possible down the widget tree_, so that the bigger ones (usually on the above) won't get rebuilt to often.
* _Remember to utilize `listen: false` in `Provider.of`_