mirror of
https://github.com/flutter/samples.git
synced 2026-03-22 04:17:50 +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 options = GalleryOptions.of(context);
|
||||
|
||||
return Container(
|
||||
margin: settingItemHeaderMargin,
|
||||
child: Material(
|
||||
shape: RoundedRectangleBorder(borderRadius: settingItemBorderRadius),
|
||||
color: colorScheme.secondary,
|
||||
clipBehavior: Clip.antiAlias,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
GalleryLocalizations.of(context).settingsSlowMotion,
|
||||
style: textTheme.subhead.apply(
|
||||
color: colorScheme.onSurface,
|
||||
return Semantics(
|
||||
container: true,
|
||||
child: Container(
|
||||
margin: settingItemHeaderMargin,
|
||||
child: Material(
|
||||
shape: RoundedRectangleBorder(borderRadius: settingItemBorderRadius),
|
||||
color: colorScheme.secondary,
|
||||
clipBehavior: Clip.antiAlias,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
GalleryLocalizations.of(context).settingsSlowMotion,
|
||||
style: textTheme.subhead.apply(
|
||||
color: colorScheme.onSurface,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.only(end: 8),
|
||||
child: Switch(
|
||||
activeColor: colorScheme.primary,
|
||||
value: options.timeDilation != 1.0,
|
||||
onChanged: (isOn) => GalleryOptions.update(
|
||||
context,
|
||||
options.copyWith(timeDilation: isOn ? 5.0 : 1.0),
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.only(end: 8),
|
||||
child: Switch(
|
||||
activeColor: colorScheme.primary,
|
||||
value: options.timeDilation != 1.0,
|
||||
onChanged: (isOn) => GalleryOptions.update(
|
||||
context,
|
||||
options.copyWith(timeDilation: isOn ? 5.0 : 1.0),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user