scrolling_calendar 0.1.0 scrolling_calendar: ^0.1.0 copied to clipboard
A new flutter package project.
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:scrolling_calendar/scrolling_calendar.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
static final Random random = new Random();
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Flutter Demo',
theme: new ThemeData(primarySwatch: Colors.blue, accentColor: Colors.red),
initialRoute: '/',
routes: {
'/': (BuildContext context) => new Scaffold(
body: new ScrollingCalendar(
firstDayOfWeek: DateTime.monday,
onDateTapped: (DateTime date) => showDialog(
context: context,
builder: (BuildContext context) => new AlertDialog(
content: new Text("You tapped $date"),
)),
selectedDate: new DateTime(2018, 2, 20),
colorMarkers: (DateTime date) => <Color>[]
..addAll(random.nextBool() ? <Color>[] : <Color>[Colors.red])
..addAll(random.nextBool() ? <Color>[] : <Color>[Colors.blue])
..addAll(
random.nextBool() ? <Color>[] : <Color>[Colors.green])))
},
);
}
}