mirror of
https://github.com/gskinnerTeam/flutter-wonderous-app.git
synced 2025-05-19 22:06:36 +08:00
Merge pull request #207 from gskinnerTeam/accessibility-pass-semanticslabels
Accessibility Pass - Semantics Labels
This commit is contained in:
@ -133,8 +133,10 @@ class _OpenedTimeRange extends StatelessWidget {
|
||||
final TimeRangePainter painter;
|
||||
final void Function() onClose;
|
||||
|
||||
List<Widget> _buildChineseDateLayout(TextStyle headingTextStyle, TextStyle captionTextStyle, int startYr, int endYr) {
|
||||
return [
|
||||
Widget _buildChineseDateLayout(TextStyle headingTextStyle, TextStyle captionTextStyle, int startYr, int endYr) {
|
||||
return MergeSemantics(
|
||||
child: Row(
|
||||
children: [
|
||||
Text(StringUtils.getYrSuffix(startYr), style: captionTextStyle),
|
||||
Gap($styles.insets.xxs),
|
||||
Text(startYr.abs().toString(), style: headingTextStyle),
|
||||
@ -146,11 +148,15 @@ class _OpenedTimeRange extends StatelessWidget {
|
||||
Gap($styles.insets.xxs),
|
||||
Text(endYr.abs().toString(), style: headingTextStyle),
|
||||
Text($strings.year, style: captionTextStyle),
|
||||
];
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
List<Widget> _buildDefaultDateLayout(TextStyle headingTextStyle, TextStyle captionTextStyle, int startYr, int endYr) {
|
||||
return [
|
||||
Widget _buildDefaultDateLayout(TextStyle headingTextStyle, TextStyle captionTextStyle, int startYr, int endYr) {
|
||||
return MergeSemantics(
|
||||
child: Row(
|
||||
children: [
|
||||
Text(startYr.abs().toString(), style: headingTextStyle),
|
||||
Gap($styles.insets.xxs),
|
||||
Text(StringUtils.getYrSuffix(startYr), style: captionTextStyle),
|
||||
@ -160,7 +166,9 @@ class _OpenedTimeRange extends StatelessWidget {
|
||||
Text(endYr.abs().toString(), style: headingTextStyle),
|
||||
Gap($styles.insets.xxs),
|
||||
Text(StringUtils.getYrSuffix(endYr.round()), style: captionTextStyle),
|
||||
];
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
@ -181,16 +189,16 @@ class _OpenedTimeRange extends StatelessWidget {
|
||||
Gap($styles.insets.xl),
|
||||
Spacer(),
|
||||
if (localeLogic.strings.localeName == 'zh') ...{
|
||||
..._buildChineseDateLayout(headingTextStyle, captionTextStyle, startYr, endYr),
|
||||
_buildChineseDateLayout(headingTextStyle, captionTextStyle, startYr, endYr),
|
||||
} else ...{
|
||||
..._buildDefaultDateLayout(headingTextStyle, captionTextStyle, startYr, endYr),
|
||||
_buildDefaultDateLayout(headingTextStyle, captionTextStyle, startYr, endYr),
|
||||
},
|
||||
Spacer(),
|
||||
SizedBox(
|
||||
width: $styles.insets.xl,
|
||||
child: AppBtn.from(
|
||||
onPressed: onClose,
|
||||
semanticLabel: $strings.expandingTimeSelectorSemanticSelector,
|
||||
semanticLabel: $strings.circleButtonsSemanticClose,
|
||||
enableFeedback: false, // handled when panelController changes.
|
||||
icon: AppIcons.close,
|
||||
iconSize: 20,
|
||||
@ -206,7 +214,8 @@ class _OpenedTimeRange extends StatelessWidget {
|
||||
// Timeframe slider
|
||||
SizedBox(
|
||||
height: $styles.insets.lg * 2,
|
||||
child: Stack(children: [
|
||||
child: Stack(
|
||||
children: [
|
||||
// grid lines:
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
@ -249,6 +258,9 @@ class _OpenedTimeRange extends StatelessWidget {
|
||||
|
||||
// Time slider itself
|
||||
Positioned.fill(
|
||||
child: MergeSemantics(
|
||||
child: Semantics(
|
||||
label: $strings.bottomScrubberSemanticTimeline,
|
||||
child: RangeSelector(
|
||||
key: ValueKey('RangeSelectorIsWonderTime'),
|
||||
min: wondersLogic.timelineStartYear * 1.0,
|
||||
@ -259,7 +271,10 @@ class _OpenedTimeRange extends StatelessWidget {
|
||||
onUpdated: onChange,
|
||||
),
|
||||
),
|
||||
]),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Gap(safeBottom),
|
||||
|
Reference in New Issue
Block a user