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
18141861
Commit
18141861
authored
Sep 14, 2017
by
Ian Hickson
Committed by
GitHub
Sep 14, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make intl dependencies clearer. (#12052)
parent
3be3a66b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
date_picker.dart
packages/flutter/lib/src/material/date_picker.dart
+7
-7
material_localizations.dart
...ages/flutter/lib/src/material/material_localizations.dart
+4
-4
No files found.
packages/flutter/lib/src/material/date_picker.dart
View file @
18141861
...
@@ -9,8 +9,8 @@ import 'package:flutter/foundation.dart';
...
@@ -9,8 +9,8 @@ import 'package:flutter/foundation.dart';
import
'package:flutter/rendering.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter/widgets.dart'
;
import
'package:flutter/widgets.dart'
;
import
'package:intl/date_symbols.dart'
;
import
'package:intl/date_symbols.dart'
as
intl
show
DateSymbols
;
import
'package:intl/intl.dart'
hide
TextDirection
;
import
'package:intl/intl.dart'
as
intl
show
DateFormat
;
import
'button.dart'
;
import
'button.dart'
;
import
'button_bar.dart'
;
import
'button_bar.dart'
;
...
@@ -130,12 +130,12 @@ class _DatePickerHeader extends StatelessWidget {
...
@@ -130,12 +130,12 @@ class _DatePickerHeader extends StatelessWidget {
Widget
yearButton
=
new
_DateHeaderButton
(
Widget
yearButton
=
new
_DateHeaderButton
(
color:
backgroundColor
,
color:
backgroundColor
,
onTap:
Feedback
.
wrapForTap
(()
=>
_handleChangeMode
(
DatePickerMode
.
year
),
context
),
onTap:
Feedback
.
wrapForTap
(()
=>
_handleChangeMode
(
DatePickerMode
.
year
),
context
),
child:
new
Text
(
new
DateFormat
(
'yyyy'
).
format
(
selectedDate
),
style:
yearStyle
),
child:
new
Text
(
new
intl
.
DateFormat
(
'yyyy'
).
format
(
selectedDate
),
style:
yearStyle
),
);
);
Widget
dayButton
=
new
_DateHeaderButton
(
Widget
dayButton
=
new
_DateHeaderButton
(
color:
backgroundColor
,
color:
backgroundColor
,
onTap:
Feedback
.
wrapForTap
(()
=>
_handleChangeMode
(
DatePickerMode
.
day
),
context
),
onTap:
Feedback
.
wrapForTap
(()
=>
_handleChangeMode
(
DatePickerMode
.
day
),
context
),
child:
new
Text
(
new
DateFormat
(
'E, MMM
\
u00a0d'
).
format
(
selectedDate
),
style:
dayStyle
),
child:
new
Text
(
new
intl
.
DateFormat
(
'E, MMM
\
u00a0d'
).
format
(
selectedDate
),
style:
dayStyle
),
);
);
// Disable the button for the current mode.
// Disable the button for the current mode.
...
@@ -276,8 +276,8 @@ class DayPicker extends StatelessWidget {
...
@@ -276,8 +276,8 @@ class DayPicker extends StatelessWidget {
final
SelectableDayPredicate
selectableDayPredicate
;
final
SelectableDayPredicate
selectableDayPredicate
;
List
<
Widget
>
_getDayHeaders
(
TextStyle
headerStyle
)
{
List
<
Widget
>
_getDayHeaders
(
TextStyle
headerStyle
)
{
final
DateFormat
dateFormat
=
new
DateFormat
();
final
intl
.
DateFormat
dateFormat
=
new
intl
.
DateFormat
();
final
DateSymbols
symbols
=
dateFormat
.
dateSymbols
;
final
intl
.
DateSymbols
symbols
=
dateFormat
.
dateSymbols
;
return
symbols
.
NARROWWEEKDAYS
.
map
((
String
weekDay
)
{
return
symbols
.
NARROWWEEKDAYS
.
map
((
String
weekDay
)
{
return
new
Center
(
child:
new
Text
(
weekDay
,
style:
headerStyle
));
return
new
Center
(
child:
new
Text
(
weekDay
,
style:
headerStyle
));
}).
toList
(
growable:
false
);
}).
toList
(
growable:
false
);
...
@@ -370,7 +370,7 @@ class DayPicker extends StatelessWidget {
...
@@ -370,7 +370,7 @@ class DayPicker extends StatelessWidget {
child:
new
Center
(
child:
new
Center
(
child:
new
GestureDetector
(
child:
new
GestureDetector
(
onTap:
onMonthHeaderTap
!=
null
?
Feedback
.
wrapForTap
(
onMonthHeaderTap
,
context
)
:
null
,
onTap:
onMonthHeaderTap
!=
null
?
Feedback
.
wrapForTap
(
onMonthHeaderTap
,
context
)
:
null
,
child:
new
Text
(
new
DateFormat
(
'yMMMM'
).
format
(
displayedMonth
),
child:
new
Text
(
new
intl
.
DateFormat
(
'yMMMM'
).
format
(
displayedMonth
),
style:
themeData
.
textTheme
.
subhead
,
style:
themeData
.
textTheme
.
subhead
,
),
),
),
),
...
...
packages/flutter/lib/src/material/material_localizations.dart
View file @
18141861
...
@@ -6,7 +6,7 @@ import 'dart:async';
...
@@ -6,7 +6,7 @@ import 'dart:async';
import
'package:flutter/foundation.dart'
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/widgets.dart'
;
import
'package:flutter/widgets.dart'
;
import
'package:intl/intl.dart'
;
import
'package:intl/intl.dart'
as
intl
;
import
'i18n/localizations.dart'
;
import
'i18n/localizations.dart'
;
...
@@ -120,7 +120,7 @@ class DefaultMaterialLocalizations implements MaterialLocalizations {
...
@@ -120,7 +120,7 @@ class DefaultMaterialLocalizations implements MaterialLocalizations {
String
get
_localeName
{
String
get
_localeName
{
final
String
localeName
=
locale
.
countryCode
.
isEmpty
?
locale
.
languageCode
:
locale
.
toString
();
final
String
localeName
=
locale
.
countryCode
.
isEmpty
?
locale
.
languageCode
:
locale
.
toString
();
return
Intl
.
canonicalizedLocale
(
localeName
);
return
intl
.
Intl
.
canonicalizedLocale
(
localeName
);
}
}
// TODO(hmuller): the rules for mapping from an integer value to
// TODO(hmuller): the rules for mapping from an integer value to
...
@@ -143,9 +143,9 @@ class DefaultMaterialLocalizations implements MaterialLocalizations {
...
@@ -143,9 +143,9 @@ class DefaultMaterialLocalizations implements MaterialLocalizations {
String
_formatInteger
(
int
n
)
{
String
_formatInteger
(
int
n
)
{
final
String
localeName
=
_localeName
;
final
String
localeName
=
_localeName
;
if
(!
NumberFormat
.
localeExists
(
localeName
))
if
(!
intl
.
NumberFormat
.
localeExists
(
localeName
))
return
n
.
toString
();
return
n
.
toString
();
return
new
NumberFormat
.
decimalPattern
(
localeName
).
format
(
n
);
return
new
intl
.
NumberFormat
.
decimalPattern
(
localeName
).
format
(
n
);
}
}
...
...
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