GithubHelp home page GithubHelp logo

av153k / time_range Goto Github PK

View Code? Open in Web Editor NEW

This project forked from muhammadtalhasultan/time_range

1.0 0.0 1.0 2.47 MB

Flutter package for selecting a time range

License: MIT License

Objective-C 0.06% Kotlin 0.86% Dart 56.29% Swift 0.63% CMake 14.68% C++ 26.34% C 1.15%

time_range's Introduction

header.jpg

Flutter package for selecting a time range with time blocks.

Getting Started

You can use this package when you need to add a time range selector to your application. You can indicate the size of the steps of the initial time and the blocks of time that the range must contain. You can also customize the component styles.

time_range_example.gif

Properties

Property Type Description
fromTitle Widget Widget displayed as the start time selector title
toTitle Widget Widget displayed as the end time selector title
titlePadding double Left padding applied to fromTitle and toTitle
borderColor Color Time selection button border color color
activeBorderColor Color Time selection button border color selected color
textStyle TextStyle Time selection button textstyle
activeTextStyle TextStyle Time selection button selected textstyle
backgroundColor Color Time selection button background color
activeBackgroundColor Color Time selection button selected background color
firstTime TimeOfDay Picker start time
lastTime TimeOfDay Picker end time
initialRange TimeRangeResult Initial range selected
timeStep double Minutes jumps between initial selector hours
timeBlock double Size in minutes of time blocks. The final selector will be recalculated depending on the selected start time for the user to select a range that contains a multiple of this time range
onRangeCompleted void Function(TimeRangeResult) Callback that notifies a change in the selected range. If, with a selected range, an initial time is selected again, the callback will return null.

Use example

You can review the example folder for a complete example of using the widget.

TimeRange(
    fromTitle: Text('From', style: TextStyle(fontSize: 18, color: gray),),
    toTitle: Text('To', style: TextStyle(fontSize: 18, color: gray),),
    titlePadding: 20,
    textStyle: TextStyle(fontWeight: FontWeight.normal, color: Colors.black87),
    activeTextStyle: TextStyle(fontWeight: FontWeight.bold, color: Colors.white),
    borderColor: dark,
    backgroundColor: Colors.transparent,
    activeBackgroundColor: orange,
    firstTime: TimeOfDay(hour: 14, minute: 30),
    lastTime: TimeOfDay(hour: 20, minute: 00),
    timeStep: 10,
    timeBlock: 30,
    onRangeCompleted: (range) => setState(() => print(range)),
  )

time_range's People

Contributors

ikicodedev avatar manuelperez96 avatar av153k avatar dkobia avatar derrick56007 avatar jobmoll avatar matthewtsmith avatar sooryasu avatar stefanschaller avatar

Stargazers

Ilyas LEFEBVRE avatar

Forkers

cedvdb

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.