Browse Source

add Portuguese

Liu Yanbo 6 năm trước cách đây
mục cha
commit
51d12f8364
5 tập tin đã thay đổi với 63 bổ sung22 xóa
  1. 2 1
      CHANGELOG.md
  2. 9 7
      README.md
  3. 23 10
      example/lib/main.dart
  4. 28 3
      lib/src/i18n_model.dart
  5. 1 1
      pubspec.yaml

+ 2 - 1
CHANGELOG.md

@@ -20,4 +20,5 @@
 ## [1.0.8] - add Russian
 ## [1.0.9] - fix readme
 ## [1.1.0] - fix readme
-## [1.1.1] - add 3 more languages
+## [1.1.1] - add 3 more languages
+## [1.1.2] - add Portuguese

+ 9 - 7
README.md

@@ -5,13 +5,15 @@
 A flutter date time picker inspired by [flutter-cupertino-date-picker](https://github.com/wuzhendev/flutter-cupertino-date-picker)
 
 you can choose date / time / date&time in multiple languages:
-- English
-- Dutch
-- Chinese
-- Russian
-- Italian
-- French
-- Spanish
+
+- English(en)
+- Dutch(nl)
+- Chinese(zh)
+- Russian(ru)
+- Italian(it)
+- French(fr)
+- Spanish(es)
+- Portuguese(pt)
 
 and you can also custom your own picker content
 

+ 23 - 10
example/lib/main.dart

@@ -35,8 +35,10 @@ 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) {
@@ -49,7 +51,8 @@ class HomePage extends StatelessWidget {
                 )),
             FlatButton(
                 onPressed: () {
-                  DatePicker.showTimePicker(context, showTitleActions: true, onChanged: (date) {
+                  DatePicker.showTimePicker(context, showTitleActions: true,
+                      onChanged: (date) {
                     print('change $date');
                   }, onConfirm: (date) {
                     print('confirm $date');
@@ -61,11 +64,14 @@ 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)',
@@ -73,7 +79,8 @@ 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');
@@ -85,11 +92,14 @@ 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)',
@@ -97,11 +107,14 @@ 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)',

+ 28 - 3
lib/src/i18n_model.dart

@@ -51,8 +51,34 @@ final _i18nModel = {
     'cancel': '取消',
     'done': '确定',
     'today': '今天',
-    'monthShort': ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
-    'monthLong': ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
+    'monthShort': [
+      '一月',
+      '二月',
+      '三月',
+      '四月',
+      '五月',
+      '六月',
+      '七月',
+      '八月',
+      '九月',
+      '十月',
+      '十一月',
+      '十二月'
+    ],
+    'monthLong': [
+      '一月',
+      '二月',
+      '三月',
+      '四月',
+      '五月',
+      '六月',
+      '七月',
+      '八月',
+      '九月',
+      '十月',
+      '十一月',
+      '十二月'
+    ],
     'day': ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期日'],
     'am': '上午',
     'pm': '下午'
@@ -247,7 +273,6 @@ final _i18nModel = {
     'pm': 'PM'
   },
   'pt': {
-    //default
     'cancel': 'Cancelar',
     'done': 'Confirmar',
     'today': 'Hoje',

+ 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.1
+version: 1.1.2
 author: Realank <realank@126.com>
 homepage: https://github.com/Realank/flutter_datetime_picker