GithubHelp home page GithubHelp logo

cdharris / flutter_duration_picker Goto Github PK

View Code? Open in Web Editor NEW
78.0 78.0 48.0 2.12 MB

A Flutter Widget for allowing a user to pick a duration (e.g. 5mins, 1h 30mins, etc)

License: MIT License

Java 1.44% Objective-C 2.97% Dart 95.59%

flutter_duration_picker's People

Contributors

aman-malhotra avatar bimms avatar cdharris avatar gwario avatar jmolins avatar solid-software-hq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

flutter_duration_picker's Issues

Method not found: 'ButtonTheme.bar'

Version Info

flutter_duration_picker:
    dependency: "direct main"
    description:
      name: flutter_duration_picker
      url: "https://pub.dartlang.org"
    source: hosted
    version: "1.0.4"

My flutter Version :

Flutter 1.27.0-2.0.pre.98 • channel master • https://github.com/flutter/flutter.git
Framework • revision 696e4f70d1 (3 days ago) • 2021-02-13 18:31:02 -0500
Engine • revision 1d537824d6
Tools • Dart 2.13.0 (build 2.13.0-30.0.dev)

Error Stacktrace :

../../../../../../../../../.pub-cache/hosted/pub.dartlang.org/flutter_duration_picker-1.0.4/lib/flutter_duration_picker.dart:506:44: Error: Method not found: 'ButtonTheme.bar'.
    final Widget actions = new ButtonTheme.bar(
                                           ^^^

As per SO post : https://stackoverflow.com/questions/66027441/error-method-not-found-buttontheme-bar

ButtonTheme.bar is Deprecated. We need to use ButtonBarTheme instead which offers more flexibility to configure ButtonBar widgets. This feature was deprecated after v1.9.1.

So need to change

final Widget actions = new ButtonTheme.bar(

to

final Widget actions = new ButtonBarTheme(

on line 506 of flutter_duration_picker.dart

I am happy to submit PR for the same.

Duration picker issue in scroll view

I have been using duration picker package for my project . The duration picker placed in a singlechildscroll view . When the page scrolls the duration picker not working .

Negative Durations & Glitches

Recent changes since v1.0.4 made it possible to select negative durations by spinning multiple times anti clock-wise. In addition sometimes 1min glitches to 59min while jiggling the spinner a bit.

Default duration is not correct when surpassing 60min

Hello, thanks for this wonderfull widget, it seems that when you set the default duration with more than 60 minutes it always defaults to 30 although the real value is correct and returns 90 minutes.

new IconButton(
                      icon: new Icon(Icons.av_timer),
                      tooltip: 'Elige duración',
                      onPressed: (() async {
                        Duration newDuration = await showDurationPicker(
                            context: context,
                            initialTime:  Duration(minutes: 90);
                        setState(() {
                          _durationCtrler.text =
                              "${newDuration.inMinutes.toString()} minutos.";
                          partidoDuration = newDuration;
                        });
                      }),

captura

[FEAT] - Allow HapticFeedback on value change

It would be great if this library could provide feedback to the user on scroll via the HapticFeedback API. Options for enabling this as I see it:

  1. have an enableHapticFeedback: bool in the settings which calls HapticFeedback.selectionClick() in the _handleTimeChanged method of _DurationPickerDialogState

  2. provide a callback to the consumer on calls to the _handleTimeChanged method of _DurationPickerDialogState

I personally prefer option 2. It's a bit more generic.

Clock Circle is always painted white even in dark mode .

The clock circle being painted in your flutter_duration_picker.dart file is always white in color even when I change the brightness in ThemeData to Brightness.dark.
In the flutter_duration_picket.dart file inside the CustomPainter class named _DialPainter
inside paint overridden function
see this code ( Images attatched are in Brightness.dark mode )

// Draw the inner background circle
    canvas.drawCircle(centerPoint, radius * 0.88,
        new Paint()..color = Colors.white); 

screenshot_20181224-004628
change this code to

// Draw the inner background circle
    canvas.drawCircle(centerPoint, radius * 0.88,
        new Paint()..color = Theme.of(context).canvasColor);

screenshot_20181224-004652
so that the color of clock background depends on the theme of the app i.e if the app is in Dark theme or in Light theme( brightness in ThemeData).

Disable option is not available

There is no option in the date picker to enable or disable.

If the duration picker is disabled, then it should not allow to change the default (selected) value.

Adapt this widget to a circular slider widget

I need a circular slider widget to select value between V1 and V2 with configurable step. (by example select value between 1 and 5 with step of 0.5).
Do you think you can adapt your component and provide this kind of component that does not exist yet in flutter.
Tx in advance.

Shape for popup

Could you provide the shape property for the duration popup so we can easier implement rounded corners?

Bad performance for bigger numbers.

This widget is great, but it creates a new layer for each hour. I get that this creates the effect of darker color, but it stops making any difference after 10h, and the bigger the value, the slower it becomes, until it just crashes the app. 500h is enough to crash the app on some devices.

I would sugest that it should stop creating layers after 10 iterations, or use only two layers by multiplying the color of the firs before going to the next.

2 Bugs

The first bug occurs when initially trying to reach 1 h. It zeroes out.
The second bug occurs when reaching more than 2 h, it is always 2h60 and not 3h, 3h60 and not 4.

Importing the project to Android Studio

hi chris,
I really liked the picker you did, I'm a bit new in the field and unable to add it to Android Studio. I'd love to get help :)

Thanks in advance!

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.