date_strip_report 1.0.1

Flutter Android iOS web

A Flutter package able show DateTime Report Control, Date range can also be set between 2 date to disable selection of irrevelant dates.

Flutter DateTime Strip Report

Easy to use and beautiful datetime strip control for Flutter.

If this project has helped you out, please support us with a star. 🌟 #

Install #

dependencies:
          ...
          date_strip_report: ^1.0.0

Usage Example #


    Container(
        child: DateStripReport(
          onDateSelected: onSelect,
          isShowMonth: true,
          isShowHalfYear: true,
          isShowQuarter: true,
          isShowYear: true,
          startDate: new DateTime(2020,1,1),
          endDate: new DateTime(2021,1,1),
          selectedColor: Colors.green,
          unSelectedColor: Colors.white,
          locale: LocaleType.en,
        )
      )

Full Example #

import 'package:date_strip_report/date_strip_report.dart';
import 'package:date_strip_report/i18n_calendar_strip.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(
      title: 'Flutter Demo',
      theme: ThemeData(
            primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

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

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

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
     });
  }

  @override
  Widget build(BuildContext context) {

    onSelect(data) {
      print("Selected Date -> $data");
    }

    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Container(
        padding: EdgeInsets.all(20),
        child: DateStripReport(
          startDate: new DateTime(2020,1,1),
          endDate: new DateTime(2021,1,1),
          isShowMonth: true,
          isShowHalfYear: true,
          isShowQuarter: true,
          isShowYear: true,
          textColor: Colors.green,
          leftIcon: Icon(Icons.arrow_back_ios),
          rightIcon: Icon(Icons.arrow_forward_ios),
          selectedColor: Colors.green,
          unSelectedColor: Colors.white,
          locale: LocaleType.en,
          onDateSelected: onSelect,
        )
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}

Widget Properties #

Initial data and onDateSelected handler #

PropDescriptionTypeDefault
startDateDate to be used for setting starting date in a date range.DateTime-
endDateDate to be used for setting ending date in a date range.DateTime-
isShowMonthShow or Hide DateTime type month.booltrue
isShowHalfYearShow or Hide DateTime type half yearbooltrue
isShowQuarterShow or Hide DateTime type quarterbooltrue
isShowYearShow or Hide DateTime type yearbooltrue
textColorColor of text info control.Color-
rightIconIcon for next navigationIconIcon(Icons.arrow_back_ios)
leftIconIcon for previous navigationIconIcon(Icons.arrow_forward_ios)
selectedColorColor of button round selected.ColorColors.blue
unSelectedColorColor of button round unselected.ColorColors.white
navigationColorColor of navigation iconColorColors.black
navigationDisableColorColor of navigation icon is disableColorColors.black12
localelocalization of languageLocaleTypeLocaleType.en
onDateSelectedFunction that is called on selection of a date. (Required)FunctionRequired
0
likes
90
pub points
36%
popularity

A Flutter package able show DateTime Report Control, Date range can also be set between 2 date to disable selection of irrevelant dates.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

nguyengiap1467@gmail.com

License

MIT (LICENSE)

Dependencies

flutter, jiffy

More

Packages that depend on date_strip_report