A customizable calendar widget to easily scroll through the years
example/main.dart
import 'package:flutter/material.dart';
import 'package:scrolling_years_calendar/scrolling_years_calendar.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Scrolling Years Calendar',
home: new MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
@override
_MyHomePageState createState() => new _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text("Flutter Scrolling Calendar"),
),
body: new Center(
child: ScrollingYearsCalendar(
// required attributes
context: context,
initialYear: DateTime.now().year,
startYear: 2016,
endYear: 2019,
// optional attributes
currentDayColor: Colors.blue,
customMonthNames: ["Jan", "Feb", "Mar", "Apr", "May",
"Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
onMonthClick: (int year, int month) => print("Clicked $month/$year"),
)
),
);
}
}
Add this to your package's pubspec.yaml file:
dependencies:
scrolling_years_calendar: ^1.0.4
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.
Now in your Dart code, you can use:
import 'package:scrolling_years_calendar/scrolling_years_calendar.dart';
Version | Uploaded | Documentation | Archive |
---|---|---|---|
1.0.4 | Oct 28, 2018 |
|
|
1.0.3 | Oct 28, 2018 |
|
|
1.0.2 | Oct 28, 2018 |
|
|
1.0.1 | Oct 28, 2018 |
|
|
1.0.0 | Oct 28, 2018 |
|
|
Popularity:
Describes how popular the package is relative to other packages.
[more]
|
52
|
Health:
Code health derived from static analysis.
[more]
|
100
|
Maintenance:
Reflects how tidy and up-to-date the package is.
[more]
|
100
|
Overall:
Weighted score of the above.
[more]
|
76
|
We analyzed this package on Feb 14, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
Detected platforms: Flutter
References Flutter, and has no conflicting libraries.
Format lib/month_title.dart
.
Run flutter format
to format lib/month_title.dart
.
Format lib/month_view.dart
.
Run flutter format
to format lib/month_view.dart
.
Format lib/scrolling_years_calendar.dart
.
Run flutter format
to format lib/scrolling_years_calendar.dart
.
Fix additional 3 files with analysis or formatting issues.
Additional issues in the following files:
lib/utils/dates.dart
(Run flutter format
to format lib/utils/dates.dart
.)lib/utils/screen_sizes.dart
(Run flutter format
to format lib/utils/screen_sizes.dart
.)lib/year_view.dart
(Run flutter format
to format lib/year_view.dart
.)Package | Constraint | Resolved | Available |
---|---|---|---|
Direct dependencies | |||
Dart SDK | >=2.0.0-dev.68.0 <3.0.0 | ||
flutter | 0.0.0 | ||
Transitive dependencies | |||
collection | 1.14.11 | ||
meta | 1.1.6 | 1.1.7 | |
sky_engine | 0.0.99 | ||
typed_data | 1.1.6 | ||
vector_math | 2.0.8 | ||
Dev dependencies | |||
flutter_test |