calendar_timeline 0.6.1 copy "calendar_timeline: ^0.6.1" to clipboard
calendar_timeline: ^0.6.1 copied to clipboard

discontinued
outdated

A horizontal date picker that takes up little screen space, so we can always have it visible, and that facilitates use with one hand.

example/lib/main.dart

import 'package:calendar_timeline/calendar_timeline.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.light);
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: HomePage(),
    );
  }
}

class HomePage extends StatefulWidget {
  @override
  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {

  DateTime _selectedDate;

  @override
  void initState() {
    super.initState();
    _resetSelectedDate();
  }

  void _resetSelectedDate() {
    _selectedDate = DateTime(2020, 3, 26);
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Color(0xFF333A47),
      body: SafeArea(
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: <Widget>[
            Padding(
              padding: const EdgeInsets.all(16),
              child: Text(
                'Calendar Timeline',
                style: Theme.of(context)
                    .textTheme
                    .headline6
                    .copyWith(color: Colors.tealAccent[100]),
              ),
            ),
            CalendarTimeline(
              initialDate: _selectedDate,
              firstDate: DateTime(2020, 2, 15),
              lastDate: DateTime(2021, 11, 20),
              onDateSelected: (date) => print(date),
              leftMargin: 20,
              monthColor: Colors.white70,
              dayColor: Colors.teal[200],
              dayNameColor: Color(0xFF333A47),
              activeDayColor: Colors.white,
              activeBackgroundDayColor: Colors.redAccent[100],
              dotsColor: Color(0xFF333A47),
              selectableDayPredicate: (date) => date.day != 23,
              locale: 'en_ISO',
            ),
            SizedBox(height: 20),
            FlatButton(
              child: Text('RESET', style: TextStyle(color: Colors.white70)),
              onPressed: () => setState(() => _resetSelectedDate()),
            )
          ],
        ),
      ),
    );
  }
}
374
likes
0
pub points
94%
popularity

Publisher

verified publisherikicode.dev

A horizontal date picker that takes up little screen space, so we can always have it visible, and that facilitates use with one hand.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, intl, scrollable_positioned_list

More

Packages that depend on calendar_timeline