date_picker_timeline 1.0.0 copy "date_picker_timeline: ^1.0.0" to clipboard
date_picker_timeline: ^1.0.0 copied to clipboard

outdated

Flutter Date Picker Library that provides a calendar as a horizontal timeline.

example/lib/main.dart

import 'package:date_picker_timeline/date_picker_timeline.dart';
import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Date Picker Timeline Demo'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);
  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  
  DateTime _selectedValue = DateTime.now();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Container(padding: EdgeInsets.all(20.0),
      color: Colors.blueGrey[100],
      child: 
      
      Column(
        
        mainAxisAlignment: MainAxisAlignment.center,
        children: <Widget>[
          Text("You Selected:"),
          Padding(padding: EdgeInsets.all(10),),
          Text(_selectedValue.toString()),
          Padding(padding: EdgeInsets.all(20),),

          DatePickerTimeline(
            _selectedValue,
            onDateChange: (date) {
              // New date selected
              setState(() {
                _selectedValue = date;
              });

            },
          ),
        ],
      ),)
    );
  }
}
548
likes
0
pub points
98%
popularity

Publisher

verified publishervivekkaushik.com

Flutter Date Picker Library that provides a calendar as a horizontal timeline.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, intl

More

Packages that depend on date_picker_timeline