Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
a63e19ba
Unverified
Commit
a63e19ba
authored
2 years ago
by
Michael Goderbauer
Committed by
GitHub
2 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unnecessary null checks in flutter_localizations (#118863)
parent
6cd49455
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
23 deletions
+2
-23
cupertino_localizations.dart
...lutter_localizations/lib/src/cupertino_localizations.dart
+1
-10
material_localizations.dart
...flutter_localizations/lib/src/material_localizations.dart
+1
-13
No files found.
packages/flutter_localizations/lib/src/cupertino_localizations.dart
View file @
a63e19ba
...
...
@@ -63,23 +63,14 @@ abstract class GlobalCupertinoLocalizations implements CupertinoLocalizations {
required
intl
.
DateFormat
doubleDigitMinuteFormat
,
required
intl
.
DateFormat
singleDigitSecondFormat
,
required
intl
.
NumberFormat
decimalFormat
,
})
:
assert
(
localeName
!=
null
),
_localeName
=
localeName
,
assert
(
fullYearFormat
!=
null
),
})
:
_localeName
=
localeName
,
_fullYearFormat
=
fullYearFormat
,
assert
(
dayFormat
!=
null
),
_dayFormat
=
dayFormat
,
assert
(
mediumDateFormat
!=
null
),
_mediumDateFormat
=
mediumDateFormat
,
assert
(
singleDigitHourFormat
!=
null
),
_singleDigitHourFormat
=
singleDigitHourFormat
,
assert
(
singleDigitMinuteFormat
!=
null
),
_singleDigitMinuteFormat
=
singleDigitMinuteFormat
,
assert
(
doubleDigitMinuteFormat
!=
null
),
_doubleDigitMinuteFormat
=
doubleDigitMinuteFormat
,
assert
(
singleDigitSecondFormat
!=
null
),
_singleDigitSecondFormat
=
singleDigitSecondFormat
,
assert
(
decimalFormat
!=
null
),
_decimalFormat
=
decimalFormat
;
final
String
_localeName
;
...
...
This diff is collapsed.
Click to expand it.
packages/flutter_localizations/lib/src/material_localizations.dart
View file @
a63e19ba
...
...
@@ -97,25 +97,15 @@ abstract class GlobalMaterialLocalizations implements MaterialLocalizations {
required
intl
.
DateFormat
shortMonthDayFormat
,
required
intl
.
NumberFormat
decimalFormat
,
required
intl
.
NumberFormat
twoDigitZeroPaddedFormat
,
})
:
assert
(
localeName
!=
null
),
_localeName
=
localeName
,
assert
(
fullYearFormat
!=
null
),
})
:
_localeName
=
localeName
,
_fullYearFormat
=
fullYearFormat
,
assert
(
compactDateFormat
!=
null
),
_compactDateFormat
=
compactDateFormat
,
assert
(
shortDateFormat
!=
null
),
_shortDateFormat
=
shortDateFormat
,
assert
(
mediumDateFormat
!=
null
),
_mediumDateFormat
=
mediumDateFormat
,
assert
(
longDateFormat
!=
null
),
_longDateFormat
=
longDateFormat
,
assert
(
yearMonthFormat
!=
null
),
_yearMonthFormat
=
yearMonthFormat
,
assert
(
shortMonthDayFormat
!=
null
),
_shortMonthDayFormat
=
shortMonthDayFormat
,
assert
(
decimalFormat
!=
null
),
_decimalFormat
=
decimalFormat
,
assert
(
twoDigitZeroPaddedFormat
!=
null
),
_twoDigitZeroPaddedFormat
=
twoDigitZeroPaddedFormat
;
final
String
_localeName
;
...
...
@@ -298,7 +288,6 @@ abstract class GlobalMaterialLocalizations implements MaterialLocalizations {
String
pageRowsInfoTitle
(
int
firstRow
,
int
lastRow
,
int
rowCount
,
bool
rowCountIsApproximate
)
{
String
?
text
=
rowCountIsApproximate
?
pageRowsInfoTitleApproximateRaw
:
null
;
text
??=
pageRowsInfoTitleRaw
;
assert
(
text
!=
null
,
'A
$_localeName
localization was not found for pageRowsInfoTitle or pageRowsInfoTitleApproximate'
);
return
text
.
replaceFirst
(
r'$firstRow'
,
formatDecimal
(
firstRow
))
.
replaceFirst
(
r'$lastRow'
,
formatDecimal
(
lastRow
))
...
...
@@ -446,7 +435,6 @@ abstract class GlobalMaterialLocalizations implements MaterialLocalizations {
/// the short time pattern used in the `en_US` locale.
@override
TimeOfDayFormat
timeOfDayFormat
({
bool
alwaysUse24HourFormat
=
false
})
{
assert
(
alwaysUse24HourFormat
!=
null
);
if
(
alwaysUse24HourFormat
)
{
return
_get24HourVersionOf
(
timeOfDayFormatRaw
);
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment