A Flutter widget to set time with spinner instead of material time picker

Overview

flutter_time_picker_spinner

Time Picker widget with spinner instead of a material time picker.

12H format

24H format

24H format with second

Custom style

Getting Started

This project is a starting point for a Dart package, a library module containing code that can be shared easily across multiple Flutter or Dart projects.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Props

props types defaultValues
time DateTime Current Time [ DateTime.now() ]
minutesInterval int 1
secondsInterval int 1
is24HourMode bool true
isShowSeconds bool false
isShowSeconds bool false
highlightedTextStyle TextStyle false
normalTextStyle TextStyle false
itemHeight double 60.0
itemWidth double 45.0
spacing double 20.0
alignment AlignmentGeometry Alignment.centerRight
isForce2Digits bool false
onTimeChange TimePickerCallback

Usage

import 'package:flutter_time_picker_spinner/flutter_time_picker_spinner.dart';

Widget widget() {
  return new TimePickerSpinner(
    is24HourMode: false,
    normalTextStyle: TextStyle(
      fontSize: 24,
      color: Colors.deepOrange
    ),
    highlightedTextStyle: TextStyle(
      fontSize: 24,
      color: Colors.yellow
    ),
    spacing: 50,
    itemHeight: 80,
    isForce2Digits: true,
    onTimeChange: (time) {
      setState(() {
        _dateTime = time;
      });
    },
  );
}
You might also like...

Material io ext - A collection of extensions for creating widgets following material.io guidelines

material_io_ext It is a collection of extensions for creating widgets following

Jan 28, 2022

Material color picker, you can customize colors. Selection in two step, first main color and after shades.

Material color picker, you can customize colors. Selection in two step, first main color and after shades.

Flutter Material Color Picker Material Color picker is a Flutter widget, that can be customizable. By default, it's Material Colors, but you can defin

Nov 25, 2022

Color picker for Flutter, based on the Google Docs color picker.

Color picker for Flutter, based on the Google Docs color picker.

Material ColorPicker Color picker for Flutter, based on the Google Docs color picker. Getting Started You can embed into your material app or use it o

Oct 30, 2022

Form builder image picker - Form builder image picker for flutter

form_builder_image_picker Field for picking image(s) from Gallery or Camera for

Jan 28, 2022

Z time ago - A simple Flutter z time ago package used to change date to time ago for english, arabic and kurdish languages

This package is used to get time duration from now and given time for kurdish, a

May 19, 2022

A Customizable Progressive Time Picker for Flutter.

A Customizable Progressive Time Picker for Flutter.

progressive_time_picker A Customizable Progressive Time Picker for Flutter. This plugin allow us to customize time picker based on our requirements fo

Nov 21, 2022

A Flutter widget that forces the device rotates into the set of orientations the application interface can be displayed in.

A Flutter widget that forces the device rotates into the set of orientations the application interface can be displayed in. Features Force device keep

Nov 30, 2021

A flutter widget that animates scrolling through a set of fixed size containers.

A flutter widget that animates scrolling through a set of fixed size containers.

Spinner This flutter package implements a simple Spinner animation that cycles through any number of fixed size child widgets. Useful for selecting a

Aug 3, 2021

Flutter-world-time-practice - World Time Tutorial App For Flutter

Flutter-world-time-practice - World Time Tutorial App For Flutter

world_time Result of Flutter Tutorial for Beginners Navigation: pushNamed, pop r

Feb 7, 2022
Comments
  • Feature: ability to specify the number of visible numbers in the spinner

    Feature: ability to specify the number of visible numbers in the spinner

    I've tried to change as little as possible of the original code. Whats changed:

    • added optional parameter: "numberOfVisibleNums" with default value 3 which should make it so it is not a breaking change for existing use-cases. (tested on Android emulator)
    • swapped "magic numbers" that were tied to 3 visible digits with a variable "offset" or direct calculations by using "widget.numberOfVisibleNums".
    opened by dariusdav 0
  • Null aware issue found

    Null aware issue found

    ../../../../../.pub-cache/hosted/pub.dartlang.org/flutter_time_picker_spinner-2.0.0/lib/flutter_time_picker_spinner.dart:221:22: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.

    • 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../../../../fvm/versions/3.0.5/packages/flutter/lib/src/widgets/binding.dart'). WidgetsBinding.instance! ^
    opened by rduffr 0
  • Could not find a method to create colon ( : ) between selected and unselected time.

    Could not find a method to create colon ( : ) between selected and unselected time.

    Hi @icemanbsi Your package is really great, and I haven't experienced any issues related to it. Just one thing I really need is that there should be an option in the UI to add colons between the time text.

    Like this Provided in the comments

    Really appreciate your effort if you get into this. Thanks

    opened by danishkhawaja98 1
  • Updated to Flutter 3 and general cleanup

    Updated to Flutter 3 and general cleanup

    Hello :)! Since I'm using the package in my current app and it is not yet supporting Flutter 3 I added this PR. I also adjusted the package to match the current valid flutter package configuration. I also added flutter_lints to it.

    Feel free to merge or use my branch it in your project:

    flutter_time_picker_spinner:
        url: https://github.com/novas1r1/flutter_time_picker_spinner
        ref: master
    
    opened by novas1r1 1
Owner
Bobby Stenly Irawan
Bobby Stenly Irawan
A flutter date time picker inspired by flutter-cupertino-date-picker

Flutter Datetime Picker (Pub) flutter_datetime_picker A flutter date time picker inspired by flutter-cupertino-date-picker you can choose date / time

null 0 Nov 30, 2021
A Very Flexible Widget that can Implement Material Sheets on all Directions, both modal and persistent, and consequently a Material Navigation Drawer

Flutter_MaterialSheetAndNavigationDrawer If this project helped you reduce developement time or you just want to help me continue making useful tools

Bryan Cancel 30 Dec 4, 2021
A flutter package that developers have pretty logs instead just printing everything like a newbie

A flutter package that developers have pretty logs instead just printing everything like a newbie. Features Makes it easy to log to console without us

null 2 Nov 28, 2021
Cross-platform flutter plugin for reading and writing NFC tags. Not maintained anymore - not looking for new maintainer, fork instead.

nfc_in_flutter NFC in Flutter is a plugin for reading and writing NFC tags in Flutter. It works on both Android and iOS with a simple stream interface

Andi Semler 113 Sep 28, 2022
A simple screen that is shown when your app gets crashed instead of the normal crash dialog. It's very similar to the one in Flutter.

Red Screen Of Death What A simple screen that is shown when your app gets crashed instead of the normal crash dialog. It's very similar to the one in

Ahmad Melegy 178 Dec 9, 2022
A simple dart package to convert large numbers to a human readable format. 1278 to 1.2K instead, for example.

A simple dart package to convert large numbers to a human readable format. 1278 to 1.2K instead, for example. Features Represents large numbers in ter

Rohit V 1 Oct 8, 2022
A modified version of the existing checkbox with the shape of a circle instead of a rounded rectangle!

A modified version of the existing checkbox with the shape of a circle instead of a rounded rectangle!

Mash Ibtesum 53 Oct 24, 2022
The Material Design Icons Icon pack available as set of Flutter Icons.

material_design_icons_flutter The Material Design Icons Icon pack available as set of Flutter Icons. Based on Material Design Icons 6.5.95. See a web

ziofat 147 Oct 26, 2022
Target the specific design of Material for Android and Cupertino for iOS widgets through a common set of Platform aware widgets

Flutter Platform Widgets This project is an attempt to see if it is possible to create widgets that are platform aware. Currently in order to render t

null 1.3k Jan 4, 2023
Target the specific design of Material for Android and Cupertino for iOS widgets through a common set of Platform aware widgets

Flutter Platform Widgets This project is an attempt to see if it is possible to create widgets that are platform aware. Currently in order to render t

null 1.3k Jan 4, 2023