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
b2cf1a24
Unverified
Commit
b2cf1a24
authored
Aug 09, 2018
by
Natalie Sampsell
Committed by
GitHub
Aug 09, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SegmentedControl -> CupertinoSegmentedControl (#20267)
parent
a49bffa5
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
45 deletions
+48
-45
segmented_control.dart
packages/flutter/lib/src/cupertino/segmented_control.dart
+6
-6
segmented_control_test.dart
packages/flutter/test/cupertino/segmented_control_test.dart
+42
-39
No files found.
packages/flutter/lib/src/cupertino/segmented_control.dart
View file @
b2cf1a24
...
@@ -63,7 +63,7 @@ const Duration _kFadeDuration = Duration(milliseconds: 165);
...
@@ -63,7 +63,7 @@ const Duration _kFadeDuration = Duration(milliseconds: 165);
/// See also:
/// See also:
///
///
/// * <https://developer.apple.com/design/human-interface-guidelines/ios/controls/segmented-controls/>
/// * <https://developer.apple.com/design/human-interface-guidelines/ios/controls/segmented-controls/>
class
SegmentedControl
<
T
>
extends
StatefulWidget
{
class
Cupertino
SegmentedControl
<
T
>
extends
StatefulWidget
{
/// Creates an iOS-style segmented control bar.
/// Creates an iOS-style segmented control bar.
///
///
/// The [children], [onValueChanged], [unselectedColor], [selectedColor],
/// The [children], [onValueChanged], [unselectedColor], [selectedColor],
...
@@ -80,7 +80,7 @@ class SegmentedControl<T> extends StatefulWidget {
...
@@ -80,7 +80,7 @@ class SegmentedControl<T> extends StatefulWidget {
/// If no [groupValue] is provided, or the [groupValue] is null, no widget will
/// If no [groupValue] is provided, or the [groupValue] is null, no widget will
/// appear as selected. The [groupValue] must be either null or one of the keys
/// appear as selected. The [groupValue] must be either null or one of the keys
/// in the [children] map.
/// in the [children] map.
SegmentedControl
({
Cupertino
SegmentedControl
({
Key
key
,
Key
key
,
@required
this
.
children
,
@required
this
.
children
,
@required
this
.
onValueChanged
,
@required
this
.
onValueChanged
,
...
@@ -144,7 +144,7 @@ class SegmentedControl<T> extends StatefulWidget {
...
@@ -144,7 +144,7 @@ class SegmentedControl<T> extends StatefulWidget {
/// @override
/// @override
/// Widget build(BuildContext context) {
/// Widget build(BuildContext context) {
/// return new Container(
/// return new Container(
/// child: new SegmentedControl<int>(
/// child: new
Cupertino
SegmentedControl<int>(
/// children: children,
/// children: children,
/// onValueChanged: (int newValue) {
/// onValueChanged: (int newValue) {
/// setState(() {
/// setState(() {
...
@@ -198,8 +198,8 @@ class SegmentedControl<T> extends StatefulWidget {
...
@@ -198,8 +198,8 @@ class SegmentedControl<T> extends StatefulWidget {
_SegmentedControlState
<
T
>
createState
()
=>
_SegmentedControlState
<
T
>();
_SegmentedControlState
<
T
>
createState
()
=>
_SegmentedControlState
<
T
>();
}
}
class
_SegmentedControlState
<
T
>
extends
State
<
SegmentedControl
<
T
>>
class
_SegmentedControlState
<
T
>
extends
State
<
Cupertino
SegmentedControl
<
T
>>
with
TickerProviderStateMixin
<
SegmentedControl
<
T
>>
{
with
TickerProviderStateMixin
<
Cupertino
SegmentedControl
<
T
>>
{
T
_pressedKey
;
T
_pressedKey
;
final
List
<
AnimationController
>
_selectionControllers
=
<
AnimationController
>[];
final
List
<
AnimationController
>
_selectionControllers
=
<
AnimationController
>[];
...
@@ -308,7 +308,7 @@ class _SegmentedControlState<T> extends State<SegmentedControl<T>>
...
@@ -308,7 +308,7 @@ class _SegmentedControlState<T> extends State<SegmentedControl<T>>
}
}
@override
@override
void
didUpdateWidget
(
SegmentedControl
<
T
>
oldWidget
)
{
void
didUpdateWidget
(
Cupertino
SegmentedControl
<
T
>
oldWidget
)
{
super
.
didUpdateWidget
(
oldWidget
);
super
.
didUpdateWidget
(
oldWidget
);
if
(
oldWidget
.
children
.
length
!=
widget
.
children
.
length
)
{
if
(
oldWidget
.
children
.
length
!=
widget
.
children
.
length
)
{
...
...
packages/flutter/test/cupertino/segmented_control_test.dart
View file @
b2cf1a24
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