Skip to content

Commit

Permalink
support flutter SDK version 3.16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Novice.Cai committed Nov 29, 2023
1 parent b2f3868 commit 5981e11
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
10 changes: 10 additions & 0 deletions lib/src/basic/input/normal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,12 @@ class FNUITextField extends StatefulWidget {
/// 自定义formatter
final List<TextInputFormatter>? formatter;

/// 文字方向
final TextDirection? textDirection;

/// hint文字方向
final TextDirection? hintTextDirection;

const FNUITextField({
Key? key,
BaseKeyBoardType keyboardType = BaseKeyBoardType.text,
Expand Down Expand Up @@ -230,6 +236,8 @@ class FNUITextField extends StatefulWidget {
this.formatter,
this.prefixIconConstraints,
this.suffixIconConstraints,
this.textDirection,
this.hintTextDirection,
}) : assert(maxLines == null || maxLines > 0),
assert(maxLength == null || maxLength > 0),
keyboardType =
Expand Down Expand Up @@ -385,6 +393,7 @@ class _FNTextField extends State<FNUITextField> {
disabledColor: FNColors.textColor,
),
child: TextField(
textDirection: widget.textDirection,
enabled: widget.enabled,
controller: _controller,
focusNode: _isVerifyCode ? _verifyNode : widget.focusNode,
Expand All @@ -401,6 +410,7 @@ class _FNTextField extends State<FNUITextField> {
),
counterText: '',
hintText: widget.hintText,
hintTextDirection: widget.hintTextDirection,
hintMaxLines: 5,
border: widget.inputBorder ?? InputBorder.none,
enabledBorder: widget.enabledBorder ?? InputBorder.none,
Expand Down
25 changes: 23 additions & 2 deletions lib/src/business/picker/zhCupertinoLocalizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class ZhCupertinoLocalizations implements CupertinoLocalizations {
String datePickerMonth(int monthIndex) => _months[monthIndex - 1];

@override
String datePickerDayOfMonth(int dayIndex, [int? weekDay])=> "$dayIndex日";
String datePickerDayOfMonth(int dayIndex, [int? weekDay]) => "$dayIndex日";

@override
String datePickerHour(int hour) => "$hour时";
Expand All @@ -67,7 +67,8 @@ class ZhCupertinoLocalizations implements CupertinoLocalizations {
String datePickerHourSemanticsLabel(int hour) => "$hour o'clock";

@override
String datePickerMinute(int minute) => "${minute.toString().padLeft(2, '0')}分";
String datePickerMinute(int minute) =>
"${minute.toString().padLeft(2, '0')}分";

@override
String datePickerMinuteSemanticsLabel(int minute) {
Expand Down Expand Up @@ -171,7 +172,27 @@ class ZhCupertinoLocalizations implements CupertinoLocalizations {
// TODO: implement noSpellCheckReplacementsLabel
String get noSpellCheckReplacementsLabel => throw UnimplementedError();

@override
String datePickerStandaloneMonth(int monthIndex) {
// TODO: implement datePickerStandaloneMonth
throw UnimplementedError();
}

@override
// TODO: implement lookUpButtonLabel
String get lookUpButtonLabel => throw UnimplementedError();

@override
// TODO: implement menuDismissLabel
String get menuDismissLabel => throw UnimplementedError();

@override
// TODO: implement searchWebButtonLabel
String get searchWebButtonLabel => throw UnimplementedError();

@override
// TODO: implement shareButtonLabel
String get shareButtonLabel => throw UnimplementedError();
}

class MyLocalizationsDelegate
Expand Down
2 changes: 2 additions & 0 deletions lib/src/theme/var.dart
Original file line number Diff line number Diff line change
Expand Up @@ -346,4 +346,6 @@ class FNColors {

//*************************不在色板里的颜色***************************************
static const Color passwordCheckFailed = Color(0xFFee0a24);

static const Color failStateBackgroundColor = Color(0xFFFFD6D6);
}

0 comments on commit 5981e11

Please sign in to comment.