Code Monkey home page Code Monkey logo

flutter-cupertino-date-picker's People

Contributors

aimsugita avatar anisalibegic avatar bakbalazs avatar bface007 avatar brex900 avatar devarshranpara-simformsolutions avatar dylanwuzh avatar goran-insby avatar ivanjosiel avatar jaceshim avatar jamesmcintosh avatar korkies22 avatar malikdoksoz avatar microdog avatar miroslava-bm avatar nfuad avatar o-gi avatar oli06 avatar rafaeldalbosco avatar rinlv avatar shadyshrif avatar simform-solutions avatar vagrantrobbie avatar wasabia avatar xamelon avatar yousifk avatar zersya 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  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  avatar  avatar

flutter-cupertino-date-picker's Issues

exception when building example

steve@tr4:~/google/flutter-cupertino-date-picker/example$ flutter run
Running "flutter pub get" in example... 3.1s
Launching lib/main.dart on ONEPLUS A5010 in debug mode...
[!] Your app isn't using AndroidX.
To avoid potential build failures, you can quickly migrate your app by following the steps on https://goo.gl/CP92wY.
E/flutter (10053): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: setState() called after dispose(): _LoadStuffButtonState#fb94d(lifecycle state: defunct, not mounted)
E/flutter (10053): This error happens if you call setState() on a State object for a widget that no longer appears in the widget tree (e.g., whose parent widget no longer includes the widget in its build). This error can occur when code calls setState() from a timer or an animation callback.
E/flutter (10053): The preferred solution is to cancel the timer or stop listening to the animation in the dispose() callback. Another solution is to check the "mounted" property of this object before calling setState() to ensure the object is still in the tree.
E/flutter (10053): This error might indicate a memory leak if setState() is being called because another object is retaining a reference to this State object after it has been removed from the tree. To avoid memory leaks, consider breaking the reference to this object during dispose().
E/flutter (10053): #0 State.setState. (package:flutter/src/widgets/framework.dart:1112:9)
E/flutter (10053): #1 State.setState (package:flutter/src/widgets/framework.dart:1147:6)
E/flutter (10053): #2 _LoadStuffButtonState._clickLoadStuff. (package:simple_animations_example_app/examples/load_stuff_button.dart:83:7)
E/flutter (10053): #3 _rootRunUnary (dart:async/zone.dart:1134:38)
E/flutter (10053): #4 _CustomZone.runUnary (dart:async/zone.dart:1031:19)
E/flutter (10053): #5 _FutureListener.handleValue (dart:async/future_impl.dart:139:18)
E/flutter (10053): #6 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:680:45)
E/flutter (10053): #7 Future._propagateToListeners (dart:async/future_impl.dart:709:32)
E/flutter (10053): #8 Future._complete (dart:async/future_impl.dart:514:7)
E/flutter (10053): #9 new Future.delayed. (dart:async/future.dart:313:16)
E/flutter (10053): #10 _rootRun (dart:async/zone.dart:1122:38)
E/flutter (10053): #11 _CustomZone.run (dart:async/zone.dart:1023:19)
E/flutter (10053): #12 _CustomZone.runGuarded (dart:async/zone.dart:925:7)
E/flutter (10053): #13 _CustomZone.bindCallbackGuarded. (dart:async/zone.dart:965:23)
E/flutter (10053): #14 _rootRun (dart:async/zone.dart:1126:13)
E/flutter (10053): #15 _CustomZone.run (dart:async/zone.dart:1023:19)
E/flutter (10053): #16 _CustomZone.bindCallback. (dart:async/zone.dart:949:23)
E/flutter (10053): #17 Timer._createTimer. (dart:async-patch/timer_patch.dart:23:15)
E/flutter (10053): #18 _Timer._runTimers (dart:isolate-patch/timer_impl.dart:384:19)
E/flutter (10053): #19 _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:418:5)
E/flutter (10053): #20 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174:12)
E/flutter (10053):
Running Gradle task 'assembleDebug'...
Checking the license for package Android SDK Build-Tools 26.0.2 in /home/steve/Android/Sdk/licenses
License for package Android SDK Build-Tools 26.0.2 accepted.
Preparing "Install Android SDK Build-Tools 26.0.2 (revision: 26.0.2)".
"Install Android SDK Build-Tools 26.0.2 (revision: 26.0.2)" ready.
Installing Android SDK Build-Tools 26.0.2 in /home/steve/Android/Sdk/build-tools/26.0.2
"Install Android SDK Build-Tools 26.0.2 (revision: 26.0.2)" complete.
"Install Android SDK Build-Tools 26.0.2 (revision: 26.0.2)" finished.
Checking the license for package Android SDK Platform 27 in /home/steve/Android/Sdk/licenses
License for package Android SDK Platform 27 accepted.
Preparing "Install Android SDK Platform 27 (revision: 3)".
"Install Android SDK Platform 27 (revision: 3)" ready.
Installing Android SDK Platform 27 in /home/steve/Android/Sdk/platforms/android-27
"Install Android SDK Platform 27 (revision: 3)" complete.
"Install Android SDK Platform 27 (revision: 3)" finished.

FAILURE: Build failed with an exception.

  • Where:
    Build file '/home/steve/google/flutter-cupertino-date-picker/example/android/app/build.gradle' line: 43

  • What went wrong:
    A problem occurred evaluating project ':app'.

path may not be null or empty string. path='null'

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

  • Get more help at https://help.gradle.org

BUILD FAILED in 3m 13s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 194.2s (!)
Gradle task assembleDebug failed with exit code 1

Please update readme file

there is packages instead of package in
'import 'packages:flutter_cupertino_date_picker/flutter_cupertino_date_picker.dart';'

请问有没有办法支持选择一个时间段?

如题。
如果不能支持一个时间段的选择,那么用户在选择时间段的时候,就需要点两次弹出时间窗口。如果插件能实现选时间段的功能,就可以比较好的优化一个用户交互。
谢谢。

Integration test for the DatePickerWidget

I used the library to integrate the DatePickerWidget and everything is fine.
But unfortunately I need to do the integration tests, but unfortunately I couldn't do them on the DatePickerWidget object.
I wanted to ask but is there any documentation to do this kind of test on the DatePickerWidget?

Italian DateTimePickerLocale

Please add Italian language

const List<String> IT_WEEKS_SHORT = [ "Lu", "Ma", "Me", "Gi", "Ve", "Sa", "Do", ];

const List<String> IT_WEEKS = [ "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato", "Domenica", ];

const List<String> IT_MONTHS = [ "Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre" ];

const Map<DateTimePickerLocale, String> CANCEL = { DateTimePickerLocale.it: 'Annulla', }

const Map<DateTimePickerLocale, String> DONE = { DateTimePickerLocale.it: 'Salva', }

Thanks

Import don't work

When I add the import statement import 'packages:flutter_cupertino_date_picker/flutter_cupertino_date_picker.dart'; an compilatio error appears:

Target of URI doesn't exist: 'packages:flutter_cupertino_date_picker/flutter_cupertino_date_picker.dart'.

How to implement dual datetime picker

i would like to implement dual time picker in my app where the user can pick the date & time in one model though I haven't seen documentation for that, any suggestions?

The getter 'last' was called on null

Hi!
In a widget in an onPressed i use

DatePicker.showDatePicker(context,
dateFormat: 'HH/mm/ss');

When I press the button I get this error:
The following NoSuchMethodError was thrown building DatePickerWidget(dirty, state: _DatePickerWidgetState#7c286):
The getter 'last' was called on null.
Receiver: null
Tried calling: last
The relevant error-causing widget was
MaterialApp
When the exception was thrown, this was the stack
#0 Object.noSuchMethod (dart:core-patch/object_patch.dart:53:5)
#1 _DatePickerWidgetState._renderDatePickerColumnComponent
#2 _DatePickerWidgetState._renderDatePickerWidget.
#4 _DatePickerWidgetState._renderDatePickerWidget

时间选择的bug

const String MIN_DATETIME = '2019-08-25';
const String MAX_DATETIME = '2029-08-29';
const String INIT_DATETIME = '2019-05-17';
const String DATE_FORMAT = 'MM月|d日,yyyy年';

DatePickerWidget 滑动月一格,选择为9月25日,onChange回调为9月07日

path may not be null or empty string. path='null'

打开工程的时候报错:

  • Error running Gradle:
    ProcessException: Process "D:\demo_flutter\flutter-cupertino-date-picker-master\example\android\gradlew.bat" exited abnormally:

FAILURE: Build failed with an exception.

  • Where:
    Build file 'D:\demo_flutter\flutter-cupertino-date-picker-master\example\android\app\build.gradle' line: 43

  • What went wrong:
    A problem occurred evaluating project ':app'.

path may not be null or empty string. path='null'

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

  • Get more help at https://help.gradle.org

BUILD FAILED in 0s
Command: D:\demo_flutter\flutter-cupertino-date-picker-master\example\android\gradlew.bat app:properties

Finished with error: Please review your Gradle project setup in the android/ folder.


[√] Flutter (Channel stable, v1.9.1+hotfix.6, on Microsoft Windows [Version
6.1.7601], locale zh-CN)
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.
2)
[√] Android Studio (version 3.5)
[√] Connected device (1 available)

• No issues found!

Error: The type 'Diagnosticable' can't be used as supertype.

Compiler message:
../../.pub-cache/hosted/pub.flutter-io.cn/flutter_cupertino_date_picker-1.0.12/lib/src/date_picker_theme.dart:23:7: Error: The type 'Diagnosticable' can't be used as supertype.
class DateTimePickerTheme extends Diagnosticable {

Flutter 1.15.22-pre.21
flutter-cupertino-date-picker 1.0.12

Wrong display in month name

I'm using the widget with locale = DateTimePickerLocale.es, and the name of month "january" (must appear like enero) is not appearing well. Instead, the name is like a concatenation of "day of week" with month's name.

For example:
My widget:
FlatButton(
onPressed: () {
DatePicker.showDatePicker(context,
onConfirm: _onConfirm;
}, onClose: _onCLose,
pickerMode: DateTimePickerMode.datetime,

     initialDateTime: DateTime.now(),
     locale: DateTimePickerLocale.es,
     dateFormat: 'EEE dd MMMM yyyy HH mm'
     );

},
child: .... }

I expected to see: "Sab 04 Enero 2020 17 55" but i got "Sab 04 Sabnero 2020 17 55"

imagen

That's happening only with that month, the others seem to be fine

imagen

自定义title问题

自定义title里面有确定按钮,怎么绑定自定义title里面的确定按钮走show方法里面的onConfirm方法?如果不能,怎么用自定义的按钮获取到pick的当前值?

TimePicker minutes excluded

Hi,
thanks for this package!
Could you provide a feature to only show / allow minutes in steps?
Instead of every minute (0-59) just every 5th minute. E.g. (0, 5, 10, 15) or (0, 15, 30, 45)
Would this be possible?

Thanks.

Internation­alizing issue

Hi !

After I added Localizations into my app(following this tutorial ) I got this issue when I interact with the Picker:

[VERBOSE-2:ui_dart_state.cc(148)] Unhandled Exception: NoSuchMethodError: The method 'call' was called on null.
Receiver: null
Tried calling: call()
#0      _rootRun  (dart:async/zone.dart:1120:38)
#1      _CustomZone.run  (dart:async/zone.dart:1021:19)
#2      _FutureListener.handleWhenComplete  (dart:async/future_impl.dart:150:18)
#3      Future._propagateToListeners.handleWhenCompleteCallback  (dart:async/future_impl.dart:609:39)
#4      Future._propagateToListeners  (dart:async/future_impl.dart:665:37)
#5      Future._completeWithValue  (dart:async/future_impl.dart:483:5)
#6      Future._asyncComplete.<anonymous closure>  (dart:async/future_impl.dart:513:7)
#7      _rootRun  (dart:async/zone.dart:1124:13)
#8      _CustomZone.run  (dart:async/zone.dart:1021:19)

Do I need to implement something else ?

My app supported languages:

MaterialApp(
          localizationsDelegates: [
            AppLocalizationsDelegate(),
            GlobalMaterialLocalizations.delegate,
            GlobalWidgetsLocalizations.delegate,
            GlobalCupertinoLocalizations.delegate,
          ],
          supportedLocales: [
            const Locale('pt', 'BR'),
            const Locale('en', 'US'),
          ],

My AppLocalization`s load method:

  static Future<AppLocalizations> load(Locale locale) async {
    final String name =
        (locale.countryCode != null && locale.countryCode.isEmpty)
            ? locale.languageCode
            : locale.toString();
    final String localeName = Intl.canonicalizedLocale(name);
    await initializeMessages(localeName);

    Intl.defaultLocale = localeName;
    return AppLocalizations();
  }

flutter doctor:

[✓] Flutter (Channel stable, v1.7.8+hotfix.4, on Mac OS X 10.14.6 18G87, locale pt-BR)
    • Flutter version 1.7.8+hotfix.4 at /Users/alefcarlos/development/flutter
    • Framework revision 20e59316b8 (5 weeks ago), 2019-07-18 20:04:33 -0700
    • Engine revision fee001c93f
    • Dart version 2.4.0

 
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/alefcarlos/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 10.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.3, Build version 10G8
    • CocoaPods version 1.7.5

[✓] iOS tools - develop for iOS devices
    • ios-deploy 1.9.4

[✓] Android Studio (version 3.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 33.4.1
    • Dart plugin version 182.5215
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)

[✓] VS Code (version 1.37.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.3.0

[✓] Connected device (1 available)
    • iPhone Xʀ • 5023658E-C713-4EC6-9792-56D738EBB720 • ios • com.apple.CoreSimulator.SimRuntime.iOS-12-4 (simulator)

• No issues found!

Thank you for this amazing plugin !

Does not change days in a month properly, when moth changes

Here are the steps performed over the example app:

  1. Open the calendar
  2. Change language to en
  3. Select Feb 29, 2020
  4. Change Feb to Mar ==> number of days for March stays 29. although it is 31.

If I scroll days down a bit the correct numbers appear but initially they are absent.

To change the Done text color

Is there any way to change the color of the text from Blue to my own color for DONE which comes for actions. Thanks

Have picker behave like Keyboard

i.e.:

  • Make it possible to keep the picker displayed despite page clicks

  • Let the Picker displace the Page content so as to not hide fields which are under it (like the keyboard). To keep the field in focus when the Picker is opened.

There may be an easy way to do that, I'm still fairly new to Flutter and trying to get my hangs around it.

i18n support for date and time Numbers ie Arabic and Farsi numbers

The _StringsI18n class contains translation for the weeks and the month's names only.
Some languages like Arabic and Farsi require i18n for the numbers itself.

To get the idea, these are the numbers in English, Farsi, and Arabic

english = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
farsi = ['۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹'];
arabic = ['۰', '۱', '۲', '۳', '٦', '٥', '٤', '۷', '۸', '۹'];

You can find all available languages here https://en.wikipedia.org/wiki/Hindu%E2%80%93Arabic_numeral_system#Glyph_comparison

How to allow that in _StringsI18n ?

12 Hours format

Please add support for 12 hours format in the DateTimePicker

Remove space

Remove space between cancel and date picker . Because UI is not looking good . As per my requirment need to remove space.
06a2d31e-7dc8-4e4e-8cde-e9b1945ffa75

flutter 1.0.0

please update pubspec.yaml to set flutter with out <1.0.0

minDateTime with DateTimePickerMode.time does not work.

These two fields are not playing nice together.

                                                 DatePicker.showDatePicker(
                                                            context,
                                                            minDateTime: _startTime,
                                                            initialDateTime: _endTime,
                                                            pickerMode: DateTimePickerMode.time,
                                                            pickerTheme: DateTimePickerTheme(
                                                              showTitle: true,
                                                            ),
                                                            dateFormat: 'H:mm',
                                                            locale: DateTimePickerLocale.en_us,
                                                            onCancel: (){
                                                              deselectInput();
                                                            },
                                                            onClose: (){
                                                              deselectInput();
                                                            },
                                                            onChange: (dateTime, List<int> index) {
                                                              deselectInput();
                                                            },
                                                            onConfirm: (dateTime, List<int> index) {
                                                              handleEndChange(dateTime);
                                                              deselectInput();
                                                            },
                                                          )

With this setup, If I pass 18:10 into a second time picker, it will return 18:<00 -> 50> rather is should be returning range from 10 -> 59

The DatePickerWidget leaves a space when is drawing in a Modal Bottom Sheet

This is de Code i'm executing:

FormField(
builder: (state) {
return FlatButton(
child: Text("OPEN BOTTOM SHEET"),
onPressed: () {
showModalBottomSheet(
context: context,
builder: (context) {
// return Text('HELLO WORLD');
return DatePickerWidget();
});
},
);
},
),

If i replace the DatePickerWidget with a simple Text, the white bottom sheet adjust to the content perfectly and no white space is between the text and the bottom of the screen

imagen

Add (numeric) keyboard support for the TimePicker

We use the TimePicker a lot. It would be great if it could support numeric keyboard input to type a specific HH:mm time faster.

Example:

image

I also requested this for the Cupertino Datepicker from Flutter, however they are not going to implement it because its not a specific iOS (Cupertino) feature. See: @flutter/flutter#28633

Maybe this is something you want to implement?

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.