calendar_view_widget 0.1.3

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 65

calendar_view_widget

About

A Flutter widget built to display a monthly calendar with a list of daily events shown below. The widget is intended to be used to fill a full scaffold body.

Status: Under Development

This package is under development and likely to change. The hope is not to break things, but new features may require updates to your code. Notes will be added below as breaking changes come along.

v0.1.0+ Breaking Change

Prior to 0.1.0, the package used an id field to return the id of an event to your app after a user tap on the event list, allowing you to lookup the event in your data and proceed accordingly. With 0.1.0 and later, the event Map itself will be returned on tap. The idField parameter is no longer useful with this update, and has been removed.

v0.0.3+ Breaking Change

Prior to 0.0.3, the package used a list of events passed in the constructor as the calendar data for display. The widget has moved to a stream based list of events. This will allow for dynamic updates of events that is hopefully flexible enough to fit with your use case. The example shows a simple stream in use.

Usage Details

CalendarView

new CalendarView(
  eventStream: eventList, // Stream<List<Map<String, String>>>
  onEventTapped: onEventTappedHandler, // function(eventID)
  titleField: 'name', // String
  detailField: 'location', // String
  dateField: 'date', // String
  separatorTitle: 'Events', // String
  theme: ThemeData.light(), // ThemeData
),

The calendar expects a stream of Events, as described below, in addition to some other configuration values. A list of events added to the stream will replace the existing list of events in the calendar.

The example above includes the default values for the String parameters (titleField, detailField, dateField, and separatorTitle) as well as the default theme, ThemeData.light(). All of these may be overridden to suit your data structure and styling needs.

The onEventTapped handler should be a function that recieves an event Map. It can then be used to respond as needed in the rest of the app.

Example:

void onEventTapped(Map<String, String> event) {
  print(event);
}

Events

Structure:

{
  'name': 'Event Name',
  'location': 'Event Location',
  'date': '2018-01-23 04:56:00',
}

Events are simply Maps with String keys and String values (Map<String, String>).

Null values in the titleField or detailField will be left empty in the event list. Events with null or empty values (as determined by String.isEmpty()) in the datefield will be hidden from the calendar.

Parameter Notes

The expectation is that there are at least 3 fields to use for the display: titleField, detailField, and dateField.

Date Field Note: Inside the package, the date field is read using DateTime.parse(), so the date field string should use one of the range of formats it can ready.

Theming

The calendar allows for a ThemeData object to be passed to it to enable theming to match the rest of your app.

Fields used in ThemeData:

primaryColor,
accentColor,
canvasColor,
backgroundColor,
dividerColor,
textTheme: {
  display1,
  subhead,
  headline,
  title
},
accentTextTheme: {
  body1,
  title,
  display1
}

Dependencies

  • intl - provides the date formatting for display in the events list.

Special Thanks

This package could not have been built without the awesomeness of Dart and Flutter. Thank you to the teams of people who have built the tools and infrastructure that enables this new app development ecosystem to grow and thrive.

0.0.1

  • Initial Release

example/README.md

example

A new Flutter project.

Getting Started

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

Use this package as a library

1. Depend on it

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


dependencies:
  calendar_view_widget: ^0.1.3

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:


import 'package:calendar_view_widget/calendar_view_widget.dart';
  
Version Uploaded Documentation Archive
0.1.3 Oct 31, 2018 Go to the documentation of calendar_view_widget 0.1.3 Download calendar_view_widget 0.1.3 archive
0.1.1 Oct 29, 2018 Go to the documentation of calendar_view_widget 0.1.1 Download calendar_view_widget 0.1.1 archive
0.1.0 Oct 23, 2018 Go to the documentation of calendar_view_widget 0.1.0 Download calendar_view_widget 0.1.0 archive
0.0.5 Oct 23, 2018 Go to the documentation of calendar_view_widget 0.0.5 Download calendar_view_widget 0.0.5 archive
0.0.4 Oct 23, 2018 Go to the documentation of calendar_view_widget 0.0.4 Download calendar_view_widget 0.0.4 archive
0.0.3 Sep 24, 2018 Go to the documentation of calendar_view_widget 0.0.3 Download calendar_view_widget 0.0.3 archive
0.0.2 Sep 21, 2018 Go to the documentation of calendar_view_widget 0.0.2 Download calendar_view_widget 0.0.2 archive
0.0.1 Sep 12, 2018 Go to the documentation of calendar_view_widget 0.0.1 Download calendar_view_widget 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
64
Health:
Code health derived from static analysis. [more]
56
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
65
Learn more about scoring.

We analyzed this package on Nov 14, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.12.6
  • Flutter: 0.11.3

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health issues and suggestions

Fix lib/src/monthView.dart. (-43.75 points)

Analysis of lib/src/monthView.dart failed with 2 errors:

line 2 col 8: Target of URI doesn't exist: 'package:quiver/time.dart'.

line 94 col 28: The method 'daysInMonth' isn't defined for the class 'MonthView'.

Maintenance suggestions

The description is too short. (-20 points)

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
intl ^0.15.7 0.15.7
Transitive dependencies
collection 1.14.11
meta 1.1.6
path 1.6.2
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test