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
629395f7
Unverified
Commit
629395f7
authored
Jul 23, 2020
by
Pierre-Louis
Committed by
GitHub
Jul 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add per thumb Range Slider semantics (#61439)
parent
6d303af9
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
186 additions
and
49 deletions
+186
-49
range_slider.dart
packages/flutter/lib/src/material/range_slider.dart
+126
-40
slider.dart
packages/flutter/lib/src/material/slider.dart
+0
-7
slider_theme.dart
packages/flutter/lib/src/material/slider_theme.dart
+3
-2
range_slider_test.dart
packages/flutter/test/material/range_slider_test.dart
+57
-0
No files found.
packages/flutter/lib/src/material/range_slider.dart
View file @
629395f7
This diff is collapsed.
Click to expand it.
packages/flutter/lib/src/material/slider.dart
View file @
629395f7
...
@@ -28,13 +28,6 @@ import 'theme.dart';
...
@@ -28,13 +28,6 @@ import 'theme.dart';
// int _duelCommandment = 1;
// int _duelCommandment = 1;
// void setState(VoidCallback fn) { }
// void setState(VoidCallback fn) { }
/// A callback that formats a numeric value from a [Slider] widget.
///
/// See also:
///
/// * [Slider.semanticFormatterCallback], which shows an example use case.
typedef
SemanticFormatterCallback
=
String
Function
(
double
value
);
/// [Slider] uses this callback to paint the value indicator on the overlay.
/// [Slider] uses this callback to paint the value indicator on the overlay.
///
///
/// Since the value indicator is painted on the Overlay; this method paints the
/// Since the value indicator is painted on the Overlay; this method paints the
...
...
packages/flutter/lib/src/material/slider_theme.dart
View file @
629395f7
...
@@ -3307,12 +3307,13 @@ class _PaddleSliderValueIndicatorPathPainter {
...
@@ -3307,12 +3307,13 @@ class _PaddleSliderValueIndicatorPathPainter {
}
}
}
}
/// A callback that formats
the numeric values from a [Range
Slider] widget.
/// A callback that formats
a numeric value from a [Slider] or [Ranger
Slider] widget.
///
///
/// See also:
/// See also:
///
///
/// * [Slider.semanticFormatterCallback], which shows an example use case.
/// * [RangeSlider.semanticFormatterCallback], which shows an example use case.
/// * [RangeSlider.semanticFormatterCallback], which shows an example use case.
typedef
RangeSemanticFormatterCallback
=
String
Function
(
RangeValues
values
);
typedef
SemanticFormatterCallback
=
String
Function
(
double
value
);
/// Decides which thumbs (if any) should be selected.
/// Decides which thumbs (if any) should be selected.
///
///
...
...
packages/flutter/test/material/range_slider_test.dart
View file @
629395f7
...
@@ -1742,6 +1742,63 @@ void main() {
...
@@ -1742,6 +1742,63 @@ void main() {
);
);
});
});
testWidgets
(
'Range Slider Semantics'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
MaterialApp
(
home:
Theme
(
data:
ThemeData
.
light
(),
child:
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
MediaQuery
(
data:
MediaQueryData
.
fromWindow
(
window
),
child:
Material
(
child:
RangeSlider
(
values:
const
RangeValues
(
10.0
,
12.0
),
min:
0.0
,
max:
100.0
,
onChanged:
(
RangeValues
v
)
{
},
),
),
),
),
),
)
);
await
tester
.
pumpAndSettle
();
expect
(
tester
.
getSemantics
(
find
.
byType
(
RangeSlider
)),
matchesSemantics
(
scopesRoute:
true
,
children:
<
Matcher
>[
matchesSemantics
(
children:
<
Matcher
>[
matchesSemantics
(
isEnabled:
true
,
hasEnabledState:
true
,
hasIncreaseAction:
true
,
hasDecreaseAction:
true
,
value:
'10%'
,
increasedValue:
'10%'
,
decreasedValue:
'5%'
,
),
matchesSemantics
(
isEnabled:
true
,
hasEnabledState:
true
,
hasIncreaseAction:
true
,
hasDecreaseAction:
true
,
value:
'12%'
,
increasedValue:
'17%'
,
decreasedValue:
'12%'
,
),
],
),
],
),
);
});
testWidgets
(
'Range Slider implements debugFillProperties'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Range Slider implements debugFillProperties'
,
(
WidgetTester
tester
)
async
{
final
DiagnosticPropertiesBuilder
builder
=
DiagnosticPropertiesBuilder
();
final
DiagnosticPropertiesBuilder
builder
=
DiagnosticPropertiesBuilder
();
...
...
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