Skip to content

Commit

Permalink
Seventh Version
Browse files Browse the repository at this point in the history
  • Loading branch information
yulieth9109 committed Dec 11, 2023
1 parent efd1d9f commit 05e021d
Show file tree
Hide file tree
Showing 8 changed files with 192 additions and 212 deletions.
319 changes: 153 additions & 166 deletions lib/screens/home.dart

Large diffs are not rendered by default.

13 changes: 0 additions & 13 deletions lib/widgets/home_sidebar/home_sidebar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,6 @@ class HomeSidebar extends ViewFragment<HomeViewModel> {
title: appLocale.helpTitle,
onTap: () => Navigator.push(context, Routes.help),
),
Visibility(
visible: false,
maintainState: true,
maintainSemantics: true,
maintainSize: true,
maintainAnimation: true,
maintainInteractivity: true,
child: CustomListTile(
leadingIcon: Icons.arrow_back,
title: appLocale.semanticsCloseNavigationMenuButton,
onTap: () => Navigator.pop(context),
),
),
],
),
);
Expand Down
4 changes: 0 additions & 4 deletions lib/widgets/map_overlay/zoom_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ class ZoomButton extends StatelessWidget {
child: Column(
children: [
Semantics(
container: true,
sortKey: const OrdinalSortKey(1.0, name: 'ZoomButton'),
child: SizedBox(
height: (Theme.of(context).floatingActionButtonTheme.smallSizeConstraints?.minHeight ?? 48.0) * 1.25,
width: Theme.of(context).floatingActionButtonTheme.smallSizeConstraints?.minWidth ?? 48.0,
Expand All @@ -47,8 +45,6 @@ class ZoomButton extends StatelessWidget {
color: Theme.of(context).colorScheme.onPrimaryContainer.withOpacity(0.1),
),
Semantics(
container: true,
sortKey: const OrdinalSortKey(2.0, name: 'ZoomButton'),
child: SizedBox(
height: (Theme.of(context).floatingActionButtonTheme.smallSizeConstraints?.minHeight ?? 48.0) * 1.25,
width: Theme.of(context).floatingActionButtonTheme.smallSizeConstraints?.minWidth ?? 48.0,
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/osm_element_layer/osm_element_marker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ class _OsmElementMarkerState extends State<OsmElementMarker> with SingleTickerPr
// add repaint boundary for performance improvement
// this way a marker will only be redrawn if itself changes
return Semantics(
label: widget.label,
excludeSemantics: widget.active ? true : false,
blockUserActions: widget.active ? true : false,
label: widget.active ? null : widget.label,
child: RepaintBoundary(
child: Center(
child: GestureDetector(
Expand Down
42 changes: 22 additions & 20 deletions lib/widgets/question_dialog/question_navigation_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,27 +70,29 @@ class QuestionNavigationBar extends StatelessWidget {
child: nextText == null
? null
: Semantics(
container: true,
button: true,
enabled: onNext != null,
sortKey: const OrdinalSortKey(1.0, name: 'questionDialog'),
child: TextButton(
key: ValueKey(nextText),
// mimic disabled style
style: onNext != null
? _buttonStyle
: _buttonStyle.merge(disabledButtonStyle),
// if button is disabled vibrate when pressed as additional feedback
onPressed: onNext ?? HapticFeedback.vibrate,
isSemanticButton: true,
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Text(nextText!, semanticsLabel: nextTextSemantics,),
const Icon(Icons.chevron_right_rounded),
],
container: true,
sortKey: const OrdinalSortKey(1.0, name: 'questionDialog'),
child: TextButton(
key: ValueKey(nextText),
// mimic disabled style
style: onNext != null
? _buttonStyle
: _buttonStyle.merge(disabledButtonStyle),
// if button is disabled vibrate when pressed as additional feedback
onPressed: onNext ?? HapticFeedback.vibrate,
isSemanticButton: false,
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Semantics(
button: true,
enabled: onNext != null,
child: Text(nextText!, semanticsLabel: nextTextSemantics,),
),
const Icon(Icons.chevron_right_rounded),
],
),
),
),
),
),
),
Expand Down
16 changes: 9 additions & 7 deletions lib/widgets/question_inputs/bool_input.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,19 @@ class BoolInput extends QuestionInputWidget<BoolAnswerDefinition, BoolAnswer> {
child:_BoolInputItem(
label: Semantics(
container: true,
checked: controller.answer?.value == state,
selected: controller.answer?.value == state,
child: Text(definition.input[index].name ??
(state ? appLocale.yes : appLocale.no)),
),
onTap: () => _handleChange(state, appLocale),
active: controller.answer?.value == state,
backgroundColor: theme.colorScheme.primary.withOpacity(0),
activeBackgroundColor: theme.colorScheme.primary,
foregroundColor: theme.colorScheme.primary,
activeForegroundColor: theme.colorScheme.onPrimary,
),);
onTap: () => _handleChange(state, appLocale),
active: controller.answer?.value == state,
backgroundColor: theme.colorScheme.primary.withOpacity(0),
activeBackgroundColor: theme.colorScheme.primary,
foregroundColor: theme.colorScheme.primary,
activeForegroundColor: theme.colorScheme.onPrimary,
),
);
}, growable: false),
),
);
Expand Down
7 changes: 6 additions & 1 deletion lib/widgets/question_inputs/list_input.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class ListInput extends QuestionInputWidget<ListAnswerDefinition, ListAnswer> {
description: item.description,
imagePath: item.image,
onTap: () => _handleChange(index, appLocale),
isMultiList: false,
);
}, growable: false),
);
Expand All @@ -49,10 +50,12 @@ class ListInputItem extends StatefulWidget {
final double imagePadding;
final bool active;
final VoidCallback onTap;
final bool isMultiList;

const ListInputItem({
required this.label,
required this.onTap,
required this.isMultiList,
this.active = false,
this.description,
this.imagePath,
Expand Down Expand Up @@ -123,7 +126,9 @@ class _ListInputItemState extends State<ListInputItem> with SingleTickerProvider
),
child: Semantics(
container: true,
selected: widget.active,
inMutuallyExclusiveGroup: widget.isMultiList ? true : null,
checked: widget.active,
selected: widget.isMultiList ? widget.active : null,
child: Text(
semanticsLabel: '${widget.label} ${widget.description ?? ''}',
widget.label,
Expand Down
1 change: 1 addition & 0 deletions lib/widgets/question_inputs/multi_list_input.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class MultiListInput extends QuestionInputWidget<MultiListAnswerDefinition, Mult
description: item.description,
imagePath: item.image,
onTap: () => _handleChange(index, appLocale),
isMultiList: true,
);
}, growable: false),
);
Expand Down

0 comments on commit 05e021d

Please sign in to comment.