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
286cd359
Commit
286cd359
authored
Apr 23, 2018
by
血心
Committed by
Hans Muller
Apr 23, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug for calling isEmpty on null object. (#16782)
parent
ff58db4a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
2 deletions
+23
-2
material_localizations.dart
...flutter_localizations/lib/src/material_localizations.dart
+1
-2
basics_test.dart
packages/flutter_localizations/test/basics_test.dart
+22
-0
No files found.
packages/flutter_localizations/lib/src/material_localizations.dart
View file @
286cd359
...
@@ -133,8 +133,7 @@ class GlobalMaterialLocalizations implements MaterialLocalizations {
...
@@ -133,8 +133,7 @@ class GlobalMaterialLocalizations implements MaterialLocalizations {
intl
.
DateFormat
_yearMonthFormat
;
intl
.
DateFormat
_yearMonthFormat
;
static
String
_computeLocaleName
(
Locale
locale
)
{
static
String
_computeLocaleName
(
Locale
locale
)
{
final
String
localeName
=
locale
.
countryCode
.
isEmpty
?
locale
.
languageCode
:
locale
.
toString
();
return
intl
.
Intl
.
canonicalizedLocale
(
locale
.
toString
());
return
intl
.
Intl
.
canonicalizedLocale
(
localeName
);
}
}
@override
@override
...
...
packages/flutter_localizations/test/basics_test.dart
View file @
286cd359
...
@@ -47,6 +47,28 @@ void main() {
...
@@ -47,6 +47,28 @@ void main() {
await
tester
.
pump
();
await
tester
.
pump
();
await
tester
.
pumpWidget
(
new
Container
());
await
tester
.
pumpWidget
(
new
Container
());
});
});
testWidgets
(
'Locale without coutryCode'
,
(
WidgetTester
tester
)
async
{
// Regression test for https://github.com/flutter/flutter/pull/16782
await
tester
.
pumpWidget
(
new
MaterialApp
(
localizationsDelegates:
const
<
LocalizationsDelegate
<
dynamic
>>[
GlobalMaterialLocalizations
.
delegate
,
],
supportedLocales:
const
<
Locale
>[
const
Locale
(
'es'
,
'ES'
),
const
Locale
(
'zh'
),
],
home:
new
Container
(),
)
);
await
tester
.
binding
.
setLocale
(
'zh'
,
null
);
await
tester
.
pump
();
await
tester
.
binding
.
setLocale
(
'es'
,
'US'
);
await
tester
.
pump
();
});
}
}
/// A localizations delegate that does not contain any useful data, and is only
/// A localizations delegate that does not contain any useful data, and is only
...
...
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