Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Lao Language and fix divider issue #69

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
5 changes: 4 additions & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class _WidgetPageState extends State<WidgetPage> {
dateFormat:
// "MM-dd(E)",
"dd/MMMM/yyyy",
locale: DatePicker.localeFromString('th'),
locale: DatePicker.localeFromString('lo'),
onChange: (DateTime newDate, _) {
setState(() {
_selectedDate = newDate;
Expand All @@ -109,6 +109,9 @@ class _WidgetPageState extends State<WidgetPage> {
itemTextStyle:
TextStyle(color: Colors.white, fontSize: 19),
dividerColor: Colors.white,
// pickerHeight: 400,
// itemHeight: 80,
// titleHeight: 400,
),
),
),
Expand Down
4 changes: 1 addition & 3 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ description: flutter_holo_date_picker package exmaple project
version: 1.0.0

environment:
sdk: '>=2.18.2 <3.0.0'
sdk: ">=2.18.2 <3.0.0"

dependencies:
flutter:
Expand All @@ -33,13 +33,11 @@ dev_dependencies:
flutter_test:
sdk: flutter


# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

# The following section is specific to Flutter.
flutter:

# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
Expand Down
5 changes: 4 additions & 1 deletion lib/date_picker.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter_holo_date_picker/widget/date_ext.dart';

import 'date_picker_theme.dart';
import 'date_picker_constants.dart';
import 'date_picker_theme.dart';
import 'i18n/date_picker_i18n.dart';
import 'widget/date_picker_widget.dart';

Expand Down Expand Up @@ -92,6 +92,9 @@ class DatePicker {
case 'pl':
return DateTimePickerLocale.pl;

case 'lo':
return DateTimePickerLocale.lo;

default:
return DateTimePickerLocale.en_us;
}
Expand Down
2 changes: 2 additions & 0 deletions lib/date_picker_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ const Color DATETIME_PICKER_ITEM_TEXT_COLOR = Colors.black;
const double DATETIME_PICKER_ITEM_TEXT_SIZE_SMALL = 15;
const double DATETIME_PICKER_ITEM_TEXT_SIZE_BIG = 17;

const double DATETIME_PICKER_DIVIDER_THICKNESS = 2;

/// To support both stable and beta channels until
/// 'DiagnosticableMixin' is officially deprecated.
class DateTimePickerTheme {
Expand Down
49 changes: 14 additions & 35 deletions lib/i18n/date_picker_i18n.dart
Original file line number Diff line number Diff line change
@@ -1,59 +1,34 @@
import 'dart:math';

part 'strings_ar.dart';

part 'strings_bn.dart';

part 'strings_cz.dart';
part 'strings_de.dart';

part 'strings_en_us.dart';

part 'strings_es.dart';

part 'strings_fr.dart';
part 'strings_he.dart';

part 'strings_ht.dart';
part 'strings_hu.dart';

part 'strings_id.dart';

part 'strings_it.dart';

part 'strings_jp.dart';

part 'strings_ko.dart';

part 'strings_lo.dart';
part 'strings_lt.dart';
part 'strings_nl.dart';
part 'strings_no_nb.dart';

part 'strings_no_nn.dart';

part 'strings_pl.dart';
part 'strings_pt_br.dart';

part 'strings_ro.dart';

part 'strings_ru.dart';

part 'strings_sr.dart';
part 'strings_sv.dart';
part 'strings_th.dart';
part 'strings_tr.dart';

part 'strings_zh_cn.dart';

part 'strings_fr.dart';

part 'strings_th.dart';

part 'strings_lt.dart';

part 'strings_nl.dart';

part 'strings_ht.dart';

part 'strings_sv.dart';

part 'strings_cz.dart';

part 'strings_pl.dart';

part 'strings_sr.dart';

abstract class _StringsI18n {
const _StringsI18n();

Expand Down Expand Up @@ -154,6 +129,9 @@ enum DateTimePickerLocale {

/// Serbian (SR)
sr,

/// Lao (LO)
lo,
}

/// Default value of date locale
Expand Down Expand Up @@ -188,6 +166,7 @@ const Map<DateTimePickerLocale, _StringsI18n> datePickerI18n = {
DateTimePickerLocale.cz: const _StringsCz(),
DateTimePickerLocale.pl: const _StringsPl(),
DateTimePickerLocale.sr: const _StringsSr(),
DateTimePickerLocale.lo: const _StringsLo(),
};

class DatePickerI18n {
Expand Down
60 changes: 60 additions & 0 deletions lib/i18n/strings_lo.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
part of 'date_picker_i18n.dart';

/// Lao (LO) Lao
class _StringsLo extends _StringsI18n {
const _StringsLo();

@override
String getCancelText() {
return 'Cancel';
}

@override
String getDoneText() {
return 'Done';
}

@override
List<String> getMonths() {
return [
"ມັງກອນ", // January
"ກຸມພາ", // February
"ມີນາ", // March
"ເມສາ", // April
"ພຶດສະພາ", // May
"ມິຖຸນາ", // June
"ກໍລະກົດ", // July
"ສິງຫາ", // August
"ກັນຍາ", // September
"ຕຸລາ", // October
"ພະຈິກ", // November
"ທັນວາ" // December
];
}

@override
List<String> getWeeksFull() {
return [
"ວັນຈັນ", // Monday
"ວັນອັງຄານ", // Tuesday
"ວັນພຸດ", // Wednesday
"ວັນພະຫັດ", // Thursday
"ວັນສຸກ", // Friday
"ວັນເສົາ", // Saturday
"ວັນອາທິດ", // Sunday
];
}

@override
List<String> getWeeksShort() {
return [
"ຈັນ", // Monday
"ອັງຄານ", // Tuesday
"ພຸດ", // Wednesday
"ພະຫັດ", // Thursday
"ສຸກ", // Friday
"ເສົາ", // Saturday
"ອາທິດ", // Sunday
];
}
}
Loading