Liu Yanbo 6 gadi atpakaļ
vecāks
revīzija
8d42a77c6d
3 mainītis faili ar 23 papildinājumiem un 35 dzēšanām
  1. 5 1
      CHANGELOG.md
  2. 17 33
      example/lib/main.dart
  3. 1 1
      pubspec.yaml

+ 5 - 1
CHANGELOG.md

@@ -24,4 +24,8 @@
 ## [1.1.2] - add Portuguese
 ## [1.1.3] - update date picker format
 ## [1.1.4] - add 2 more languages
-## [1.1.5] - add japanese
+## [1.1.5] - add Japanese
+## [1.1.6] - update something
+## [1.1.7] - update something
+## [1.1.8] - update something
+## [1.1.9] - add German

+ 17 - 33
example/lib/main.dart

@@ -35,10 +35,8 @@ class HomePage extends StatelessWidget {
                       maxTime: DateTime(2019, 6, 7),
                       theme: DatePickerTheme(
                           backgroundColor: Colors.blue,
-                          itemStyle: TextStyle(
-                              color: Colors.white, fontWeight: FontWeight.bold),
-                          doneStyle:
-                              TextStyle(color: Colors.white, fontSize: 16)),
+                          itemStyle: TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
+                          doneStyle: TextStyle(color: Colors.white, fontSize: 16)),
                       onChanged: (date) {
                     print('change $date');
                   }, onConfirm: (date) {
@@ -51,12 +49,11 @@ class HomePage extends StatelessWidget {
                 )),
             FlatButton(
                 onPressed: () {
-                  DatePicker.showTimePicker(context, showTitleActions: true,
-                      onChanged: (date) {
-                    print('change $date');
+                  DatePicker.showTimePicker(context, showTitleActions: true, onChanged: (date) {
+                    print('change $date ' + date.timeZoneOffset.toString());
                   }, onConfirm: (date) {
                     print('confirm $date');
-                  }, currentTime: DateTime(2008, 12, 31, 23, 12, 34));
+                  }, currentTime: DateTime.now().toUtc());
                 },
                 child: Text(
                   'show time picker',
@@ -64,14 +61,11 @@ class HomePage extends StatelessWidget {
                 )),
             FlatButton(
                 onPressed: () {
-                  DatePicker.showDateTimePicker(context, showTitleActions: true,
-                      onChanged: (date) {
+                  DatePicker.showDateTimePicker(context, showTitleActions: true, onChanged: (date) {
                     print('change $date');
                   }, onConfirm: (date) {
                     print('confirm $date');
-                  },
-                      currentTime: DateTime(2008, 12, 31, 23, 12, 34),
-                      locale: LocaleType.zh);
+                  }, currentTime: DateTime(2008, 12, 31, 23, 12, 34), locale: LocaleType.zh);
                 },
                 child: Text(
                   'show date time picker (Chinese)',
@@ -79,8 +73,7 @@ class HomePage extends StatelessWidget {
                 )),
             FlatButton(
                 onPressed: () {
-                  DatePicker.showDateTimePicker(context, showTitleActions: true,
-                      onChanged: (date) {
+                  DatePicker.showDateTimePicker(context, showTitleActions: true, onChanged: (date) {
                     print('change $date');
                   }, onConfirm: (date) {
                     print('confirm $date');
@@ -92,14 +85,11 @@ class HomePage extends StatelessWidget {
                 )),
             FlatButton(
                 onPressed: () {
-                  DatePicker.showDateTimePicker(context, showTitleActions: true,
-                      onChanged: (date) {
+                  DatePicker.showDateTimePicker(context, showTitleActions: true, onChanged: (date) {
                     print('change $date');
                   }, onConfirm: (date) {
                     print('confirm $date');
-                  },
-                      currentTime: DateTime(2008, 12, 31, 23, 12, 34),
-                      locale: LocaleType.nl);
+                  }, currentTime: DateTime(2008, 12, 31, 23, 12, 34), locale: LocaleType.nl);
                 },
                 child: Text(
                   'show date time picker (Dutch)',
@@ -107,14 +97,11 @@ class HomePage extends StatelessWidget {
                 )),
             FlatButton(
                 onPressed: () {
-                  DatePicker.showDateTimePicker(context, showTitleActions: true,
-                      onChanged: (date) {
+                  DatePicker.showDateTimePicker(context, showTitleActions: true, onChanged: (date) {
                     print('change $date');
                   }, onConfirm: (date) {
                     print('confirm $date');
-                  },
-                      currentTime: DateTime(2008, 12, 31, 23, 12, 34),
-                      locale: LocaleType.ru);
+                  }, currentTime: DateTime(2008, 12, 31, 23, 12, 34), locale: LocaleType.ru);
                 },
                 child: Text(
                   'show date time picker (Russian)',
@@ -122,14 +109,11 @@ class HomePage extends StatelessWidget {
                 )),
             FlatButton(
                 onPressed: () {
-                  DatePicker.showDateTimePicker(context, showTitleActions: true,
-                      onChanged: (date) {
-                        print('change $date');
-                      }, onConfirm: (date) {
-                        print('confirm $date');
-                      },
-                      currentTime: DateTime(2019, 12, 31, 23, 12, 34),
-                      locale: LocaleType.de);
+                  DatePicker.showDateTimePicker(context, showTitleActions: true, onChanged: (date) {
+                    print('change $date');
+                  }, onConfirm: (date) {
+                    print('confirm $date');
+                  }, currentTime: DateTime(2019, 12, 31, 23, 12, 34), locale: LocaleType.de);
                 },
                 child: Text(
                   'show date time picker (German)',

+ 1 - 1
pubspec.yaml

@@ -1,6 +1,6 @@
 name: flutter_datetime_picker
 description: A date time picker for flutter, you can choose date / time / date&time in English Dutch and Chinese, and you can also custom your own picker content
-version: 1.1.5
+version: 1.1.9
 author: Realank <realank@126.com>
 homepage: https://github.com/Realank/flutter_datetime_picker