flutter_holo_date_picker 0.1.2+4

flutter_holo_date_picker #

A Flutter package of Datepicker inspired by the Holo Theme in Android.

Getting Started #

This plugins displays a Datepicker inspired by the Holo Theme in Android. based on the flutter_cupertino_date_picker package

See the example for simple use

Screenshots #

Locales Supported #

  • English (EN) United States
  • Chinese (ZH) Simplified
  • Portuguese (PT) Brazil
  • Spanish (ES)
  • Romanian (RO)
  • Bengali (BN)
  • Arabic (AR)
  • Japanese (JP)
  • Russian (RU)
  • German (DE)
  • Korea (KO)
  • Italian (IT)
  • Hungarian (HU)
  • Hebrew (HE)

[0.1.2+4]

  • fixed not showing 3 rows

[0.1.2+3]

  • minimized size of dialog

[0.1.2]

  • added screenshots and changed font size to fit properly
  • made picker look more similar to the Holo-Theme style

[0.1.1]

  • added example and fixed ui bugs
  • using properties like in default date picker

[0.1.0]

  • initial release.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_holo_date_picker/flutter_holo_date_picker.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: 'example',
      theme: ThemeData(primarySwatch: Colors.blue),
      home: Scaffold(
          appBar: AppBar(
            title: Text('Holo Datepicker Example'),
          ),
          body: MyHomePage()),
      debugShowCheckedModeBanner: false,
    );
  }
}

class MyHomePage extends StatelessWidget {
  Widget build(BuildContext context) {
    return Center(
      child: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        crossAxisAlignment: CrossAxisAlignment.center,
        children: <Widget>[
          RaisedButton(
            child: Text("open picker dialog"),
            onPressed: () async {
              var datePicked = await DatePicker.showSimpleDatePicker(
                context,
                initialDate: DateTime(1994),
                firstDate: DateTime(1960),
                lastDate: DateTime(2012),
                dateFormat: "dd-MMMM-yyyy",
                locale: DateTimePickerLocale.en_us,
              );

              final snackBar =
                  SnackBar(content: Text("Date Picked $datePicked"));
              Scaffold.of(context).showSnackBar(snackBar);
            },
          ),
          RaisedButton(
            child: Text("Show picker widget"),
            onPressed: (){
              Navigator.push(context, MaterialPageRoute(builder: (_) => WidgetPage()));
            },
          )
        ],
      ),
    );
  }
}

class WidgetPage extends StatefulWidget {
  @override
  _WidgetPageState createState() => _WidgetPageState();
}

class _WidgetPageState extends State<WidgetPage> {
  DateTime _selectedDate;

  @override
  Widget build(BuildContext context) {
    return SafeArea(
      child: Scaffold(
        body: Center(
          child: Container(
            padding: const EdgeInsets.symmetric(horizontal: 28),
            child: DatePickerWidget(
              firstDate: DateTime(1960),
              lastDate: DateTime(2002, 1, 1),
              initialDate: DateTime(1994),
              dateFormat: "dd-MMMM-yyyy",
              onChange: (DateTime newDate, _) => _selectedDate = newDate,
              pickerTheme: DateTimePickerTheme(
                  itemTextStyle: TextStyle(color: Colors.black, fontSize: 20)),
            ),
          ),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flutter_holo_date_picker: ^0.1.2+4

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_holo_date_picker/flutter_holo_date_picker.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
51
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]
75
Learn more about scoring.

We analyzed this package on Feb 19, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5
  • Flutter: 1.12.13+hotfix.7

Health suggestions

Format lib/date_picker.dart.

Run flutter format to format lib/date_picker.dart.

Format lib/flutter_holo_date_picker.dart.

Run flutter format to format lib/flutter_holo_date_picker.dart.

Format lib/widget/date_picker_widget.dart.

Run flutter format to format lib/widget/date_picker_widget.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test