Coder Social home page Coder Social logo

ludy2015 / flutter_time_range_picker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chris1234567899/flutter_time_range_picker

0.0 0.0 0.0 1.57 MB

A time range picker for Flutter

License: Other

Kotlin 0.32% Swift 1.04% Objective-C 0.10% Dart 98.55%

flutter_time_range_picker's Introduction

Time Range Picker

A time range picker for flutter.

Getting Started

Installation

Add

time_range_picker : any

to your pubspec.yaml, and run

flutter packages get

in your project's root directory.

Basic Usage

import 'package:flutter/material.dart';

import 'package:time_range_picker/time_range_picker.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        backgroundColor: Colors.blueGrey,
        body: Center(
          child: RaisedButton(
            onPressed: () async {
              TimeRange result = await showTimeRangePicker(
                context: context,
              );
              print("result " + result.toString());
            },
            child: Text("Pure"),
          ),
        ));
  }
}

Examples

Simple

Simple

Interval

Interval

Filled Style

Filled Style

Disabled Timeframe

Disabled Timeframe

Background Widget

Background Widget

Parameters

type param default description
TimeOfDay start TimeOfDay.now() preselected start time
TimeOfDay end now + 3h preselected end time
TimeRange disabledTime disabled time range (this time cannot be selected)
Color disabledColor Colors.red.withOpacity(0.5) the color for the disabled section
PaintingStyle paintingStyle PaintingStyle.stroke Style of the arc (filled or stroke)
Function(TimeOfDay) onStartChange
Function(TimeOfDay) onEndChange
Duration interval Duration(minutes: 5) Minimum time steps that can be selected
String fromText "From" label for start time
String toText "To" label for end time
bool use24HourFormat true use 24 hours or am / pm
double padding 26 the padding of the ring
double strokeWidth 12 the thickness of the ring
Color strokeColor primaryColor the color of the active arc from start time to end time
double handlerRadius 12 the radius of the handler to drag the arc
Color handlerColor primaryColor the color of a handler
Color selectedColor primaryColorLight the color of a selected handler
Color backgroundColor Colors.grey[200] the color of the circle outline
Widget backgroundWidget a widget displayed in the background, use e.g. an image
int ticks number of ticks displayed
double ticksOffset 0 the offset for ticks
double ticksLength strokeWidth ticks length
double ticksWidth 1 ticks thickness
Color ticksColor Colors.white Color of ticks
bool snap false Snap time bar to interval
List labels Show labels around the circle (start at 0 hours)
double labelOffset 20 Offset of the labels
bool rotateLabels true rotate labels
bool autoAdjustLabels true flip labels if the angle woulb be upside down (only if rotate labels is active)
TextStyle labelStyle Style of the labels
TextStyle timeTextStyle TextStyle of the time texts
TextStyle activeTimeTextStyle TextStyle of the currently moving time text
bool hideTimes false hide the time texts

flutter_time_range_picker's People

Contributors

chris1234567899 avatar

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.