simpletime_picker 0.1.0

  • Readme
  • Changelog
  • Example
  • Installing
  • new54

Simple TimePicker #

Note: This plugin is still under development, and some Components might not be available yet or still has so many bugs.

Installation #

First, add simpletime_picker as a dependency in your pubspec.yaml file.

simpletime_picker: ^0.1.0

Example #

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

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

 class MyApp extends StatefulWidget {
   @override
   _MyAppState createState() => _MyAppState();
 }

 class _MyAppState extends State<MyApp> {
   @override
   Widget build(BuildContext context) {
     return MaterialApp(
         home: Scaffold(
             appBar: AppBar(title: const Text('Plugin example app')),
             body: Container(child: Builder(builder: (context) {
               return Column(
                 crossAxisAlignment: CrossAxisAlignment.start,
                 children: <Widget>[
                   FlatButton(
                       onPressed: () async {
                         var result = await TimePicker.pickTime(context,
                             selectedColor: Colors.amber,
                             nonSelectedColor: Colors.black,
                             displayType: DisplayType.bottomSheet,
                             timePickType: TimePickType.hourMinute,
                             buttonBackgroundColor: Colors.red,
                             title: "this is bottomsheet",
                             fontSize: 24.0,
                             isTwelveHourFormat: true);
                         print("ini apa ? $result");
                       },
                       child: Text("show bottomsheet")),
                   FlatButton(
                       onPressed: () async {
                         var result = await TimePicker.pickTime(context,
                             selectedColor: Colors.amber,
                             nonSelectedColor: Colors.black,
                             displayType: DisplayType.dialog,
                             timePickType: TimePickType.hourMinuteSecond,
                             fontSize: 30.0,
                             isTwelveHourFormat: true);
                         print("ini ? $result");
                       },
                       child: Text("show dialog"))
                 ],
               );
             }))));
   }
 }

0.1.0 #

  • first release time picker

example/README.md

simpletime_picker #

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

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

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        home: Scaffold(
            appBar: AppBar(title: const Text('Plugin example app')),
            body: Container(child: Builder(builder: (context) {
              return Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: <Widget>[
                  FlatButton(
                      onPressed: () async {
                        var result = await TimePicker.pickTime(context,
                            selectedColor: Colors.amber,
                            nonSelectedColor: Colors.black,
                            displayType: DisplayType.bottomSheet,
                            timePickType: TimePickType.hourMinute,
                            buttonBackgroundColor: Colors.red,
                            title: "this is bottomsheet",
                            fontSize: 24.0,
                            isTwelveHourFormat: true);
                        print("ini apa ? $result");
                      },
                      child: Text("show bottomsheet")),
                  FlatButton(
                      onPressed: () async {
                        var result = await TimePicker.pickTime(context,
                            selectedColor: Colors.amber,
                            nonSelectedColor: Colors.black,
                            displayType: DisplayType.dialog,
                            timePickType: TimePickType.hourMinuteSecond,
                            fontSize: 30.0,
                            isTwelveHourFormat: true);
                        print("ini ? $result");
                      },
                      child: Text("show dialog"))
                ],
              );
            }))));
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  simpletime_picker: ^0.1.0

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:simpletime_picker/constant.dart';
import 'package:simpletime_picker/scrollable_time_picker.dart';
import 'package:simpletime_picker/time_picker.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
8
Health:
Code health derived from static analysis. [more]
98
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
54
Learn more about scoring.

We analyzed this package on Oct 21, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Fix lib/time_picker.dart. (-1 points)

Analysis of lib/time_picker.dart reported 2 hints:

line 170 col 5: Dead code.

line 170 col 5: Avoid empty statements.

Fix lib/constant.dart. (-0.50 points)

Analysis of lib/constant.dart reported 1 hint:

line 1 col 8: Unused import: 'package:flutter/material.dart'.

Fix lib/scrollable_time_picker.dart. (-0.50 points)

Analysis of lib/scrollable_time_picker.dart reported 1 hint:

line 2 col 8: Unused import: 'constant.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.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test