mirror of
https://github.com/flutter/samples.git
synced 2026-04-01 01:03:30 +00:00
[Gallery] Fix slow motion setting announcement (#301)
* Enable a11y carousel scrolling
* Fix slow motion announcement on android talkback
* Revert "Enable a11y carousel scrolling"
This reverts commit cc8f233b54.
This commit is contained in:
@@ -26,44 +26,47 @@ class SlowMotionSetting extends StatelessWidget {
|
|||||||
final textTheme = Theme.of(context).textTheme;
|
final textTheme = Theme.of(context).textTheme;
|
||||||
final options = GalleryOptions.of(context);
|
final options = GalleryOptions.of(context);
|
||||||
|
|
||||||
return Container(
|
return Semantics(
|
||||||
margin: settingItemHeaderMargin,
|
container: true,
|
||||||
child: Material(
|
child: Container(
|
||||||
shape: RoundedRectangleBorder(borderRadius: settingItemBorderRadius),
|
margin: settingItemHeaderMargin,
|
||||||
color: colorScheme.secondary,
|
child: Material(
|
||||||
clipBehavior: Clip.antiAlias,
|
shape: RoundedRectangleBorder(borderRadius: settingItemBorderRadius),
|
||||||
child: Row(
|
color: colorScheme.secondary,
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
clipBehavior: Clip.antiAlias,
|
||||||
children: [
|
child: Row(
|
||||||
Expanded(
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
child: Padding(
|
children: [
|
||||||
padding: EdgeInsets.all(16),
|
Expanded(
|
||||||
child: Column(
|
child: Padding(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
padding: EdgeInsets.all(16),
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
child: Column(
|
||||||
children: [
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
Text(
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
GalleryLocalizations.of(context).settingsSlowMotion,
|
children: [
|
||||||
style: textTheme.subhead.apply(
|
Text(
|
||||||
color: colorScheme.onSurface,
|
GalleryLocalizations.of(context).settingsSlowMotion,
|
||||||
|
style: textTheme.subhead.apply(
|
||||||
|
color: colorScheme.onSurface,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
Padding(
|
||||||
Padding(
|
padding: const EdgeInsetsDirectional.only(end: 8),
|
||||||
padding: const EdgeInsetsDirectional.only(end: 8),
|
child: Switch(
|
||||||
child: Switch(
|
activeColor: colorScheme.primary,
|
||||||
activeColor: colorScheme.primary,
|
value: options.timeDilation != 1.0,
|
||||||
value: options.timeDilation != 1.0,
|
onChanged: (isOn) => GalleryOptions.update(
|
||||||
onChanged: (isOn) => GalleryOptions.update(
|
context,
|
||||||
context,
|
options.copyWith(timeDilation: isOn ? 5.0 : 1.0),
|
||||||
options.copyWith(timeDilation: isOn ? 5.0 : 1.0),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user