sliver_calendar 0.2.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 48

Calendar #

Shows a scrolling calendar list of events. This is still relatively basic, it always assumes that the getEvents returns the entire list of calendar events (mostly ignoring the values passed into the source). It does work however :) Optionally, you can use an image as a background for the calendar header and another image for the month header.

The calendar uses slivers to display the widgets in the view and lets you scroll forward and backward through the events. The header widget will drop down and open up the days of the month, letting you select specific days as well as move back and forth between the months. By default it displays a list of events and not a day view, the day view code is all just a stub right now.

Here is how to use the calendar widget itself:

new CalendarWidget(
              initialDate: new TZDateTime.now(local),
              buildItem: buildItem,
              getEvents: getEvents,
            );

How to setup a source for the calendar widget.

...
  List<Game> _listToShow;
  StreamSubscription<UpdateReason> _listening;

  @override
  Widget buildItem(BuildContext context, CalendarEvent event) {
    return new GameCard(_listToShow[event.index]);
  }

  @override
  List<CalendarEvent> getEvents(DateTime start, DateTime end) {
    if (_listToShow == null) {
      _listToShow = UserDatabaseData.instance.games.values.toList();
    }
    if (_listToShow == null) {
      return [];
    }
    List<CalendarEvent> events = new List<CalendarEvent>();
    int pos = 0;
    _listToShow.forEach((Game g) => events.add(new CalendarEvent(
        instant: g.tzTime, instantEnd: g.tzEndTime, index: pos++)));
    return events;
  }
...

Example of the calendar widget in action:

Getting Started #

For help getting started with Flutter, view our online documentation.

For help on editing package code, view the documentation.

[0.0.1] - May 2018

  • Add in the basics for the sliver calendar.

[0.0.3] - Jun 7rth 2018

  • Add in the date range correctly.
  • Fix up views with the same date,

[0.0.4] = Jun 10th 2018

  • Fix subscription cancel/fix up for the pub spec.
  • Fix the homepage for the calendar code.

[0.1.0] - Sep 26th 2018

  • Change the subscription model to make it more in line with how flutter normally works.

example/README.md

example #

An example of a project with the sliver calendar.

Getting Started #

Do cool stuff.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  sliver_calendar: ^0.2.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:sliver_calendar/sliver_calendar.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
76
Health:
Code health derived from static analysis. [more]
0
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
50
Overall:
Weighted score of the above. [more]
48
Learn more about scoring.

We analyzed this package on Jan 24, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4
  • Flutter: 1.12.13+hotfix.5

Analysis issues and suggestions

Fix dependencies in pubspec.yaml.

Running flutter pub upgrade failed with the following output:

ERR: Because sliver_calendar depends on flutter_localizations any from sdk which depends on intl 0.16.0, intl 0.16.0 is required.
 So, because sliver_calendar depends on intl ^0.15.5, version solving failed.

Health suggestions

Format lib/src/calendar.dart.

Run flutter format to format lib/src/calendar.dart.

Format lib/src/calendardaymarker.dart.

Run flutter format to format lib/src/calendardaymarker.dart.

Format lib/src/calendarheader.dart.

Run flutter format to format lib/src/calendarheader.dart.

Format lib/src/sliverlistcalendar.dart.

Run flutter format to format lib/src/sliverlistcalendar.dart.

Format lib/src/sliverscrollviewcalendar.dart.

Run flutter format to format lib/src/sliverscrollviewcalendar.dart.

Maintenance issues and suggestions

No valid SDK. (-20 points)

The analysis could not detect a valid SDK that can use this package.

Make sure dartdoc successfully runs on your package's source files. (-10 points)

Dependencies were not resolved.

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.19.0 <3.0.0