diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index e8be0a2e..0b87c0b6 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -32,8 +32,8 @@ "appModalsButtonOk": "Ok", "appModalsButtonCancel": "Cancel", "appPageDefaultTitlePage": "page", - "appPageSemanticSwipe": "{pageTitle} {count} of {total}.", - "@appPageSemanticSwipe": {"placeholders": {"pageTitle": {}, "total": {}, "count": {}}}, + "appPageSemanticSwipe": "{pageTitle} {current} of {total}.", + "@appPageSemanticSwipe": {"placeholders": {"pageTitle": {}, "current": {}, "total": {}}}, "artifactsTitleArtifacts": "ARTIFACTS", "semanticsPrevious": "Previous {title}", "@semanticsPrevious": {"placeholders": {"title": {}}}, diff --git a/lib/l10n/app_zh.arb b/lib/l10n/app_zh.arb index e970ed12..c7a2a366 100644 --- a/lib/l10n/app_zh.arb +++ b/lib/l10n/app_zh.arb @@ -25,7 +25,7 @@ "appModalsButtonOk": "确定", "appModalsButtonCancel": "取消", "appPageDefaultTitlePage": "页", - "appPageSemanticSwipe": "{pageTitle} {total} 之 {count}.", + "appPageSemanticSwipe": "{pageTitle} {total} 之 {current}.", "artifactsTitleArtifacts": "文物", "semanticsPrevious": "之前的文物{title}", "semanticsNext": "下一个文物{title}", diff --git a/lib/ui/common/controls/buttons.dart b/lib/ui/common/controls/buttons.dart index 3ffdd087..ac27907c 100644 --- a/lib/ui/common/controls/buttons.dart +++ b/lib/ui/common/controls/buttons.dart @@ -1,5 +1,6 @@ import 'package:wonders/common_libs.dart'; import 'package:wonders/ui/common/app_icons.dart'; +import 'package:wonders/ui/common/ignore_pointer.dart'; /// Shared methods across button types Widget _buildIcon(BuildContext context, AppIcons icon, {required bool isSecondary, required double? size}) => @@ -154,7 +155,7 @@ class AppBtn extends StatelessWidget { ), if (focus.hasFocus) Positioned.fill( - child: IgnorePointer( + child: IgnorePointerWithSemantics( child: Container( decoration: BoxDecoration( borderRadius: BorderRadius.circular($styles.corners.md), diff --git a/lib/ui/common/controls/scroll_decorator.dart b/lib/ui/common/controls/scroll_decorator.dart index 1255999d..c0c124b8 100644 --- a/lib/ui/common/controls/scroll_decorator.dart +++ b/lib/ui/common/controls/scroll_decorator.dart @@ -1,4 +1,5 @@ import 'package:wonders/common_libs.dart'; +import 'package:wonders/ui/common/ignore_pointer.dart'; /// Easily add visual decorations to a scrolling widget based on the state of its controller. class ScrollDecorator extends StatefulWidget { @@ -64,7 +65,7 @@ class ScrollDecorator extends StatefulWidget { bgBuilder = null; fgBuilder = (controller) { final double ratio = controller.hasClients ? min(1, controller.position.extentBefore / 60) : 0; - return IgnorePointer( + return IgnorePointerWithSemantics( child: Container( height: 24, decoration: BoxDecoration( diff --git a/lib/ui/common/gradient_container.dart b/lib/ui/common/gradient_container.dart index 44fb789e..869adb44 100644 --- a/lib/ui/common/gradient_container.dart +++ b/lib/ui/common/gradient_container.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:wonders/ui/common/ignore_pointer.dart'; class GradientContainer extends StatelessWidget { const GradientContainer(this.colors, this.stops, @@ -23,24 +24,26 @@ class GradientContainer extends StatelessWidget { final BorderRadius? borderRadius; @override - Widget build(BuildContext context) => IgnorePointer( - child: Container( - width: width, - height: height, - alignment: alignment, - decoration: BoxDecoration( - gradient: LinearGradient( - begin: begin ?? Alignment.centerLeft, - end: end ?? Alignment.centerRight, - colors: colors, - stops: stops, - ), - backgroundBlendMode: blendMode, - borderRadius: borderRadius, + Widget build(BuildContext context) => ExcludeSemantics( + child: IgnorePointerWithSemantics( + child: Container( + width: width, + height: height, + alignment: alignment, + decoration: BoxDecoration( + gradient: LinearGradient( + begin: begin ?? Alignment.centerLeft, + end: end ?? Alignment.centerRight, + colors: colors, + stops: stops, ), - child: child, + backgroundBlendMode: blendMode, + borderRadius: borderRadius, ), - ); + child: child, + ), + ) + ); } class HzGradient extends GradientContainer { diff --git a/lib/ui/common/ignore_pointer.dart b/lib/ui/common/ignore_pointer.dart new file mode 100644 index 00000000..cc27da96 --- /dev/null +++ b/lib/ui/common/ignore_pointer.dart @@ -0,0 +1,18 @@ +import 'package:flutter/rendering.dart'; +import 'package:wonders/common_libs.dart'; + +class IgnorePointerWithSemantics extends SingleChildRenderObjectWidget { + const IgnorePointerWithSemantics({super.key, super.child}); + + @override + RenderIgnorePointerWithSemantics createRenderObject(BuildContext context) { + return RenderIgnorePointerWithSemantics(); + } +} + +class RenderIgnorePointerWithSemantics extends RenderProxyBox { + RenderIgnorePointerWithSemantics(); + + @override + bool hitTest(BoxHitTestResult result, { required Offset position }) => false; +} \ No newline at end of file diff --git a/lib/ui/common/modals/fullscreen_url_img_viewer.dart b/lib/ui/common/modals/fullscreen_url_img_viewer.dart index 8cb717de..1c88ddf7 100644 --- a/lib/ui/common/modals/fullscreen_url_img_viewer.dart +++ b/lib/ui/common/modals/fullscreen_url_img_viewer.dart @@ -102,7 +102,7 @@ class _FullscreenUrlImgViewerState extends State { CircleIconBtn( icon: AppIcons.prev, onPressed: page == 0 ? null : () => _animateToPage(page - 1), - semanticLabel: $strings.semanticsNext(''), + semanticLabel: $strings.semanticsPrevious(''), ), Gap($styles.insets.xs), CircleIconBtn( diff --git a/lib/ui/common/wonderous_logo.dart b/lib/ui/common/wonderous_logo.dart index fb88e86e..b0e48b28 100644 --- a/lib/ui/common/wonderous_logo.dart +++ b/lib/ui/common/wonderous_logo.dart @@ -9,6 +9,7 @@ class WonderousLogo extends StatelessWidget { @override Widget build(BuildContext context) => Image.asset( ImagePaths.appLogoPlain, + excludeFromSemantics: true, fit: BoxFit.cover, width: width, filterQuality: FilterQuality.high, diff --git a/lib/ui/screens/artifact/artifact_carousel/artifact_carousel_screen.dart b/lib/ui/screens/artifact/artifact_carousel/artifact_carousel_screen.dart index ebc9e030..b3ce0234 100644 --- a/lib/ui/screens/artifact/artifact_carousel/artifact_carousel_screen.dart +++ b/lib/ui/screens/artifact/artifact_carousel/artifact_carousel_screen.dart @@ -5,6 +5,7 @@ import 'package:wonders/logic/data/highlight_data.dart'; import 'package:wonders/ui/common/app_icons.dart'; import 'package:wonders/ui/common/controls/app_header.dart'; import 'package:wonders/ui/common/controls/app_page_indicator.dart'; +import 'package:wonders/ui/common/ignore_pointer.dart'; import 'package:wonders/ui/common/static_text_scale.dart'; part 'widgets/_blurred_image_bg.dart'; diff --git a/lib/ui/screens/artifact/artifact_carousel/widgets/_bottom_text_content.dart b/lib/ui/screens/artifact/artifact_carousel/widgets/_bottom_text_content.dart index 98e73aaa..a47db96a 100644 --- a/lib/ui/screens/artifact/artifact_carousel/widgets/_bottom_text_content.dart +++ b/lib/ui/screens/artifact/artifact_carousel/widgets/_bottom_text_content.dart @@ -26,8 +26,7 @@ class _BottomTextContent extends StatelessWidget { Gap($styles.insets.md), Column( children: [ - IgnorePointer( - ignoringSemantics: false, + IgnorePointerWithSemantics( child: Semantics( button: true, onIncrease: () => state._handleArtifactTap(_currentPage + 1), diff --git a/lib/ui/screens/artifact/artifact_details/widgets/_info_column.dart b/lib/ui/screens/artifact/artifact_details/widgets/_info_column.dart index 637c5046..eeffb437 100644 --- a/lib/ui/screens/artifact/artifact_details/widgets/_info_column.dart +++ b/lib/ui/screens/artifact/artifact_details/widgets/_info_column.dart @@ -9,59 +9,61 @@ class _InfoColumn extends StatelessWidget { return Padding( padding: EdgeInsets.symmetric(horizontal: $styles.insets.lg), child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Gap($styles.insets.xl), - if (data.culture.isNotEmpty) ...[ - Text( - data.culture.toUpperCase(), - style: $styles.text.titleFont.copyWith(color: $styles.colors.accent1), - ).animate().fade(delay: 150.ms, duration: 600.ms), - Gap($styles.insets.xs), - ], - Semantics( - header: true, - child: Text( - data.title, - textAlign: TextAlign.center, - style: $styles.text.h2.copyWith(color: $styles.colors.offWhite, height: 1.2), - maxLines: 5, - overflow: TextOverflow.ellipsis, - ).animate().fade(delay: 250.ms, duration: 600.ms), - ), - Gap($styles.insets.lg), - Animate().toggle( - delay: 500.ms, - builder: (_, value, __) { - return CompassDivider(isExpanded: !value, duration: $styles.times.med); - }), - Gap($styles.insets.lg), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - ...[ - _InfoRow($strings.artifactDetailsLabelDate, data.date), - _InfoRow($strings.artifactDetailsLabelPeriod, data.period), - _InfoRow($strings.artifactDetailsLabelGeography, data.country), - _InfoRow($strings.artifactDetailsLabelMedium, data.medium), - _InfoRow($strings.artifactDetailsLabelDimension, data.dimension), - _InfoRow($strings.artifactDetailsLabelClassification, data.classification), - ] - .animate(interval: 100.ms) - .fadeIn(delay: 600.ms, duration: $styles.times.med) - .slide(begin: Offset(0.2, 0), curve: Curves.easeOut), + child: Focus( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Gap($styles.insets.xl), + if (data.culture.isNotEmpty) ...[ + Text( + data.culture.toUpperCase(), + style: $styles.text.titleFont.copyWith(color: $styles.colors.accent1), + ).animate().fade(delay: 150.ms, duration: 600.ms), + Gap($styles.insets.xs), ], - ), - Gap($styles.insets.md), - Text( - $strings.homeMenuAboutMet, - style: $styles.text.caption.copyWith(color: $styles.colors.accent2), - ).animate(delay: 1.5.seconds).fadeIn().slide(begin: Offset(0.2, 0), curve: Curves.easeOut), - Gap($styles.insets.offset), - ], + Semantics( + header: true, + child: Text( + data.title, + textAlign: TextAlign.center, + style: $styles.text.h2.copyWith(color: $styles.colors.offWhite, height: 1.2), + maxLines: 5, + overflow: TextOverflow.ellipsis, + ).animate().fade(delay: 250.ms, duration: 600.ms), + ), + Gap($styles.insets.lg), + Animate().toggle( + delay: 500.ms, + builder: (_, value, __) { + return CompassDivider(isExpanded: !value, duration: $styles.times.med); + }), + Gap($styles.insets.lg), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ...[ + _InfoRow($strings.artifactDetailsLabelDate, data.date), + _InfoRow($strings.artifactDetailsLabelPeriod, data.period), + _InfoRow($strings.artifactDetailsLabelGeography, data.country), + _InfoRow($strings.artifactDetailsLabelMedium, data.medium), + _InfoRow($strings.artifactDetailsLabelDimension, data.dimension), + _InfoRow($strings.artifactDetailsLabelClassification, data.classification), + ] + .animate(interval: 100.ms) + .fadeIn(delay: 600.ms, duration: $styles.times.med) + .slide(begin: Offset(0.2, 0), curve: Curves.easeOut), + ], + ), + Gap($styles.insets.md), + Text( + $strings.homeMenuAboutMet, + style: $styles.text.caption.copyWith(color: $styles.colors.accent2), + ).animate(delay: 1.5.seconds).fadeIn().slide(begin: Offset(0.2, 0), curve: Curves.easeOut), + Gap($styles.insets.offset), + ], + ), ), - ), + ) ); } } diff --git a/lib/ui/screens/artifact/artifact_search/widgets/_search_input.dart b/lib/ui/screens/artifact/artifact_search/widgets/_search_input.dart index 23f4c5fb..54044209 100644 --- a/lib/ui/screens/artifact/artifact_search/widgets/_search_input.dart +++ b/lib/ui/screens/artifact/artifact_search/widgets/_search_input.dart @@ -1,6 +1,7 @@ part of '../artifact_search_screen.dart'; /// Autopopulating textfield used for searching for Artifacts by name. +const double _inputWidth = 400; class _SearchInput extends StatelessWidget { const _SearchInput({super.key, required this.onSubmit, required this.wonder}); final void Function(String) onSubmit; @@ -49,6 +50,7 @@ class _SearchInput extends StatelessWidget { child: Container( margin: EdgeInsets.only(top: $styles.insets.xxs), width: constraints.maxWidth, + constraints: BoxConstraints(maxWidth: _inputWidth), decoration: BoxDecoration( boxShadow: [ BoxShadow( @@ -120,6 +122,7 @@ class _SearchInput extends StatelessWidget { Widget _buildInput(BuildContext context, TextEditingController textController, FocusNode focusNode, _) { Color captionColor = $styles.colors.caption; return Container( + constraints: BoxConstraints(maxWidth: _inputWidth), height: $styles.insets.xl, decoration: BoxDecoration( color: $styles.colors.offWhite, @@ -134,7 +137,7 @@ class _SearchInput extends StatelessWidget { onSubmitted: onSubmit, controller: textController, focusNode: focusNode, - style: TextStyle(color: captionColor), + style: TextStyle(color: captionColor, ), textAlignVertical: TextAlignVertical.top, decoration: InputDecoration( isDense: true, diff --git a/lib/ui/screens/editorial/editorial_screen.dart b/lib/ui/screens/editorial/editorial_screen.dart index b250bb55..073ff240 100644 --- a/lib/ui/screens/editorial/editorial_screen.dart +++ b/lib/ui/screens/editorial/editorial_screen.dart @@ -17,6 +17,7 @@ import 'package:wonders/ui/common/fullscreen_keyboard_list_scroller.dart'; import 'package:wonders/ui/common/google_maps_marker.dart'; import 'package:wonders/ui/common/gradient_container.dart'; import 'package:wonders/ui/common/hidden_collectible.dart'; +import 'package:wonders/ui/common/ignore_pointer.dart'; import 'package:wonders/ui/common/pop_router_on_over_scroll.dart'; import 'package:wonders/ui/common/scaling_list_item.dart'; import 'package:wonders/ui/common/static_text_scale.dart'; diff --git a/lib/ui/screens/editorial/widgets/_callout.dart b/lib/ui/screens/editorial/widgets/_callout.dart index f682d341..e213deb9 100644 --- a/lib/ui/screens/editorial/widgets/_callout.dart +++ b/lib/ui/screens/editorial/widgets/_callout.dart @@ -6,20 +6,22 @@ class _Callout extends StatelessWidget { const _Callout({super.key, required this.text}); @override Widget build(BuildContext context) { - return IntrinsicHeight( - child: Row( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Container(color: $styles.colors.accent1, width: 1), - Gap($styles.insets.sm), - Expanded( - child: Text( - text, - style: $styles.text.callout, - ), - ) - ], - ), + return Focus( + child: IntrinsicHeight( + child: Row( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Container(color: $styles.colors.accent1, width: 1), + Gap($styles.insets.sm), + Expanded( + child: Text( + text, + style: $styles.text.callout, + ), + ) + ], + ), + ) ); } } diff --git a/lib/ui/screens/editorial/widgets/_scrolling_content.dart b/lib/ui/screens/editorial/widgets/_scrolling_content.dart index fea6e796..4cac7de1 100644 --- a/lib/ui/screens/editorial/widgets/_scrolling_content.dart +++ b/lib/ui/screens/editorial/widgets/_scrolling_content.dart @@ -19,45 +19,45 @@ class _ScrollingContent extends StatelessWidget { @override Widget build(BuildContext context) { - Widget buildText(String value) => Focus(child: Text(_fixNewlines(value), style: $styles.text.body)); - - Widget buildDropCapText(String value) { + Widget buildText(String value, bool useDropCaps) { + final bool skipCaps = !localeLogic.isEnglish || !useDropCaps; final TextStyle dropStyle = $styles.text.dropCase; final TextStyle bodyStyle = $styles.text.body; final String dropChar = value.substring(0, 1); final textScale = MediaQuery.of(context).textScaleFactor; final double dropCapWidth = StringUtils.measure(dropChar, dropStyle).width * textScale; - final bool skipCaps = !localeLogic.isEnglish; - return Semantics( - label: value, - child: ExcludeSemantics( - child: !skipCaps - ? DropCapText( - _fixNewlines(value).substring(1), - dropCap: DropCap( - width: dropCapWidth, - height: $styles.text.body.fontSize! * $styles.text.body.height! * 2, - child: Transform.translate( - offset: Offset(0, bodyStyle.fontSize! * (bodyStyle.height! - 1) - 2), - child: Text( - dropChar, - overflow: TextOverflow.visible, - style: $styles.text.dropCase.copyWith( - color: $styles.colors.accent1, - height: 1, + return Focus( + child: Semantics( + label: value, + child: ExcludeSemantics( + child: skipCaps + ? Text(_fixNewlines(value), style: bodyStyle) + : DropCapText( + _fixNewlines(value).substring(1), + dropCap: DropCap( + width: dropCapWidth, + height: $styles.text.body.fontSize! * $styles.text.body.height! * 2, + child: Transform.translate( + offset: Offset(0, bodyStyle.fontSize! * (bodyStyle.height! - 1) - 2), + child: Text( + dropChar, + overflow: TextOverflow.visible, + style: $styles.text.dropCase.copyWith( + color: $styles.colors.accent1, + height: 1, + ), ), ), ), - ), - style: $styles.text.body, - dropCapPadding: EdgeInsets.only(right: 6), - dropCapStyle: $styles.text.dropCase.copyWith( - color: $styles.colors.accent1, - height: 1, - ), - ) - : Text(value, style: bodyStyle), - ), + style: $styles.text.body, + dropCapPadding: EdgeInsets.only(right: 6), + dropCapStyle: $styles.text.dropCase.copyWith( + color: $styles.colors.accent1, + height: 1, + ), + ) + ), + ) ); } @@ -93,7 +93,7 @@ class _ScrollingContent extends StatelessWidget { Center(child: buildHiddenCollectible(slot: 0)), /// History 1 - buildDropCapText(data.historyInfo1), + buildText(data.historyInfo1, true), /// Quote1 _CollapsingPullQuoteImage(data: data, scrollPos: scrollPos), @@ -103,11 +103,11 @@ class _ScrollingContent extends StatelessWidget { _Callout(text: data.callout1), /// History 2 - buildText(data.historyInfo2), + buildText(data.historyInfo2, false), _SectionDivider(scrollPos, sectionNotifier, index: 1), /// Construction 1 - buildDropCapText(data.constructionInfo1), + buildText(data.constructionInfo1, true), Center(child: buildHiddenCollectible(slot: 2)), ]), Gap($styles.insets.md), @@ -119,14 +119,14 @@ class _ScrollingContent extends StatelessWidget { _Callout(text: data.callout2), /// Construction 2 - buildText(data.constructionInfo2), + buildText(data.constructionInfo2, false), _SlidingImageStack(scrollPos: scrollPos, type: data.type), _SectionDivider(scrollPos, sectionNotifier, index: 2), /// Location - buildDropCapText(data.locationInfo1), + buildText(data.locationInfo1, true), _LargeSimpleQuote(text: data.pullQuote2, author: data.pullQuote2Author), - buildText(data.locationInfo2), + buildText(data.locationInfo2, false), ]), Gap($styles.insets.md), _MapsThumbnail(data), @@ -242,7 +242,7 @@ class _MapsThumbnailState extends State<_MapsThumbnail> { child: Stack( children: [ Positioned.fill(child: ColoredBox(color: Colors.transparent)), - IgnorePointer( + IgnorePointerWithSemantics( child: GoogleMap( markers: {getMapsMarker(startPos.target)}, zoomControlsEnabled: false, diff --git a/lib/ui/screens/home/wonders_home_screen.dart b/lib/ui/screens/home/wonders_home_screen.dart index f8756cf4..e1172c43 100644 --- a/lib/ui/screens/home/wonders_home_screen.dart +++ b/lib/ui/screens/home/wonders_home_screen.dart @@ -4,6 +4,7 @@ import 'package:wonders/ui/common/app_icons.dart'; import 'package:wonders/ui/common/controls/app_header.dart'; import 'package:wonders/ui/common/controls/app_page_indicator.dart'; import 'package:wonders/ui/common/gradient_container.dart'; +import 'package:wonders/ui/common/ignore_pointer.dart'; import 'package:wonders/ui/common/previous_next_navigation.dart'; import 'package:wonders/ui/common/themed_text.dart'; import 'package:wonders/ui/common/utils/app_haptics.dart'; @@ -210,7 +211,7 @@ class _HomeScreenState extends State with SingleTickerProviderStateM Widget _buildFgAndGradients() { Widget buildSwipeableBgGradient(Color fgColor) { return _swipeController.buildListener(builder: (swipeAmt, isPointerDown, _) { - return IgnorePointer( + return IgnorePointerWithSemantics( child: FractionallySizedBox( heightFactor: .6, child: Container( @@ -248,7 +249,7 @@ class _HomeScreenState extends State with SingleTickerProviderStateM return Animate( effects: const [FadeEffect()], onPlay: _handleFadeAnimInit, - child: IgnorePointer(child: WonderIllustration(e.type, config: config))); + child: IgnorePointerWithSemantics(child: WonderIllustration(e.type, config: config))); }); }), @@ -277,8 +278,7 @@ class _HomeScreenState extends State with SingleTickerProviderStateM /// Title Content LightText( - child: IgnorePointer( - ignoringSemantics: false, + child: IgnorePointerWithSemantics( child: Transform.translate( offset: Offset(0, 30), child: Column( diff --git a/lib/ui/screens/intro/intro_screen.dart b/lib/ui/screens/intro/intro_screen.dart index b0c3b151..2cb8e1ac 100644 --- a/lib/ui/screens/intro/intro_screen.dart +++ b/lib/ui/screens/intro/intro_screen.dart @@ -4,6 +4,7 @@ import 'package:wonders/logic/common/platform_info.dart'; import 'package:wonders/ui/common/app_icons.dart'; import 'package:wonders/ui/common/controls/app_page_indicator.dart'; import 'package:wonders/ui/common/gradient_container.dart'; +import 'package:wonders/ui/common/ignore_pointer.dart'; import 'package:wonders/ui/common/previous_next_navigation.dart'; import 'package:wonders/ui/common/static_text_scale.dart'; import 'package:wonders/ui/common/themed_text.dart'; @@ -112,8 +113,7 @@ class _IntroScreenState extends State { ), ), - IgnorePointer( - ignoringSemantics: false, + IgnorePointerWithSemantics( child: Column(children: [ Spacer(), @@ -325,6 +325,7 @@ class _PageImage extends StatelessWidget { SizedBox.expand( child: Image.asset( '${ImagePaths.common}/intro-${data.img}.jpg', + excludeFromSemantics: true, fit: BoxFit.cover, alignment: Alignment.centerRight, ), @@ -332,6 +333,7 @@ class _PageImage extends StatelessWidget { Positioned.fill( child: Image.asset( '${ImagePaths.common}/intro-mask-${data.mask}.png', + excludeFromSemantics: true, fit: BoxFit.fill, )), ], diff --git a/lib/ui/screens/photo_gallery/photo_gallery.dart b/lib/ui/screens/photo_gallery/photo_gallery.dart index 44329549..731288a7 100644 --- a/lib/ui/screens/photo_gallery/photo_gallery.dart +++ b/lib/ui/screens/photo_gallery/photo_gallery.dart @@ -7,6 +7,7 @@ import 'package:wonders/ui/common/controls/app_loading_indicator.dart'; import 'package:wonders/ui/common/controls/eight_way_swipe_detector.dart'; import 'package:wonders/ui/common/fullscreen_keyboard_listener.dart'; import 'package:wonders/ui/common/hidden_collectible.dart'; +import 'package:wonders/ui/common/ignore_pointer.dart'; import 'package:wonders/ui/common/modals/fullscreen_url_img_viewer.dart'; import 'package:wonders/ui/common/unsplash_photo.dart'; import 'package:wonders/ui/common/utils/app_haptics.dart'; diff --git a/lib/ui/screens/photo_gallery/widgets/_animated_cutout_overlay.dart b/lib/ui/screens/photo_gallery/widgets/_animated_cutout_overlay.dart index 2b0e70ef..9f918d51 100644 --- a/lib/ui/screens/photo_gallery/widgets/_animated_cutout_overlay.dart +++ b/lib/ui/screens/photo_gallery/widgets/_animated_cutout_overlay.dart @@ -31,7 +31,7 @@ class _AnimatedCutoutOverlay extends StatelessWidget { effects: [CustomEffect(builder: _buildAnimatedCutout, curve: Curves.easeOut, duration: duration)], key: animationKey, onComplete: (c) => c.reverse(), - child: IgnorePointer(child: Container(color: Colors.black.withOpacity(opacity))), + child: IgnorePointerWithSemantics(child: Container(color: Colors.black.withOpacity(opacity))), ), ], ); diff --git a/lib/ui/screens/timeline/timeline_screen.dart b/lib/ui/screens/timeline/timeline_screen.dart index d1df1bfe..6030ad76 100644 --- a/lib/ui/screens/timeline/timeline_screen.dart +++ b/lib/ui/screens/timeline/timeline_screen.dart @@ -11,6 +11,7 @@ import 'package:wonders/ui/common/blend_mask.dart'; import 'package:wonders/ui/common/centered_box.dart'; import 'package:wonders/ui/common/controls/app_header.dart'; import 'package:wonders/ui/common/dashed_line.dart'; +import 'package:wonders/ui/common/ignore_pointer.dart'; import 'package:wonders/ui/common/list_gradient.dart'; import 'package:wonders/ui/common/timeline_event_card.dart'; import 'package:wonders/ui/common/utils/app_haptics.dart'; diff --git a/lib/ui/screens/timeline/widgets/_event_markers.dart b/lib/ui/screens/timeline/widgets/_event_markers.dart index 1f963ef8..b9107b0e 100644 --- a/lib/ui/screens/timeline/widgets/_event_markers.dart +++ b/lib/ui/screens/timeline/widgets/_event_markers.dart @@ -54,8 +54,7 @@ class _EventMarkersState extends State<_EventMarkers> { @override Widget build(BuildContext context) { - return IgnorePointer( - ignoringSemantics: false, + return IgnorePointerWithSemantics( child: LayoutBuilder(builder: (_, constraints) { /// Figure out which event is "selected" _updateSelectedEvent(constraints.maxHeight); diff --git a/lib/ui/screens/timeline/widgets/_event_popups.dart b/lib/ui/screens/timeline/widgets/_event_popups.dart index bd02ae6c..21a6add7 100644 --- a/lib/ui/screens/timeline/widgets/_event_popups.dart +++ b/lib/ui/screens/timeline/widgets/_event_popups.dart @@ -35,8 +35,7 @@ class _EventPopupsState extends State<_EventPopups> { final evt = _eventToShow; return TopCenter( child: ClipRect( - child: IgnorePointer( - ignoringSemantics: false, + child: IgnorePointerWithSemantics( child: AnimatedSwitcher( duration: $styles.times.fast, child: evt == null diff --git a/lib/ui/screens/timeline/widgets/_scrolling_viewport.dart b/lib/ui/screens/timeline/widgets/_scrolling_viewport.dart index 863b9d9a..21cdea32 100644 --- a/lib/ui/screens/timeline/widgets/_scrolling_viewport.dart +++ b/lib/ui/screens/timeline/widgets/_scrolling_viewport.dart @@ -69,8 +69,7 @@ class _ScalingViewportState extends State<_ScrollingViewport> { _buildScrollingArea(context).animate().fadeIn(), // Dashed line with a year that changes as we scroll - IgnorePointer( - ignoringSemantics: false, + IgnorePointerWithSemantics( child: AnimatedBuilder( animation: controller.scroller, builder: (_, __) { diff --git a/lib/ui/screens/timeline/widgets/_timeline_section.dart b/lib/ui/screens/timeline/widgets/_timeline_section.dart index 99f8841c..c6acb68b 100644 --- a/lib/ui/screens/timeline/widgets/_timeline_section.dart +++ b/lib/ui/screens/timeline/widgets/_timeline_section.dart @@ -20,8 +20,7 @@ class TimelineSection extends StatelessWidget { StringUtils.formatYr(data.startYr), StringUtils.formatYr(data.endYr), )}', - child: IgnorePointer( - ignoringSemantics: false, + child: IgnorePointerWithSemantics( child: Container( alignment: Alignment(0, -1 + fraction * 2), padding: EdgeInsets.all($styles.insets.xs), diff --git a/lib/ui/screens/timeline/widgets/_year_markers.dart b/lib/ui/screens/timeline/widgets/_year_markers.dart index 321c47d9..2d34f98a 100644 --- a/lib/ui/screens/timeline/widgets/_year_markers.dart +++ b/lib/ui/screens/timeline/widgets/_year_markers.dart @@ -13,8 +13,7 @@ class _YearMarkers extends StatelessWidget { @override Widget build(BuildContext context) { - return IgnorePointer( - ignoringSemantics: false, + return IgnorePointerWithSemantics( child: LayoutBuilder(builder: (_, constraints) { int interval = 100; if (constraints.maxHeight < 800) { diff --git a/lib/ui/screens/wonder_events/widgets/_events_list.dart b/lib/ui/screens/wonder_events/widgets/_events_list.dart index 295cf1f6..995b39f4 100644 --- a/lib/ui/screens/wonder_events/widgets/_events_list.dart +++ b/lib/ui/screens/wonder_events/widgets/_events_list.dart @@ -64,7 +64,7 @@ class _EventsListState extends State<_EventsList> { key: PageStorageKey('eventsList'), child: Column( children: [ - IgnorePointer(child: Gap(widget.topHeight)), + IgnorePointerWithSemantics(child: Gap(widget.topHeight)), Container( decoration: BoxDecoration( color: $styles.colors.black, @@ -120,7 +120,7 @@ class _EventsListState extends State<_EventsList> { if (showBackdrop) ...[ AppBackdrop( strength: backdropAmt, - child: IgnorePointer( + child: IgnorePointerWithSemantics( child: Container( color: $styles.colors.black.withOpacity(backdropAmt * .6), ), diff --git a/lib/ui/screens/wonder_events/widgets/_wonder_image_with_timeline.dart b/lib/ui/screens/wonder_events/widgets/_wonder_image_with_timeline.dart index 59544e8f..9d9bb780 100644 --- a/lib/ui/screens/wonder_events/widgets/_wonder_image_with_timeline.dart +++ b/lib/ui/screens/wonder_events/widgets/_wonder_image_with_timeline.dart @@ -73,6 +73,7 @@ class _WonderImageWithTimeline extends StatelessWidget { clipper: CurvedTopClipper(), child: Image.asset( data.type.flattened, + excludeFromSemantics: true, width: 200, fit: BoxFit.cover, alignment: Alignment(0, -.5), diff --git a/lib/ui/screens/wonder_events/wonder_events.dart b/lib/ui/screens/wonder_events/wonder_events.dart index 2d902e6d..3c3007f0 100644 --- a/lib/ui/screens/wonder_events/wonder_events.dart +++ b/lib/ui/screens/wonder_events/wonder_events.dart @@ -8,6 +8,7 @@ import 'package:wonders/ui/common/centered_box.dart'; import 'package:wonders/ui/common/controls/app_header.dart'; import 'package:wonders/ui/common/curved_clippers.dart'; import 'package:wonders/ui/common/hidden_collectible.dart'; +import 'package:wonders/ui/common/ignore_pointer.dart'; import 'package:wonders/ui/common/list_gradient.dart'; import 'package:wonders/ui/common/themed_text.dart'; import 'package:wonders/ui/common/timeline_event_card.dart'; diff --git a/lib/ui/wonder_illustrations/common/animated_clouds.dart b/lib/ui/wonder_illustrations/common/animated_clouds.dart index fa3c7dd3..ea3ff5f2 100644 --- a/lib/ui/wonder_illustrations/common/animated_clouds.dart +++ b/lib/ui/wonder_illustrations/common/animated_clouds.dart @@ -138,6 +138,7 @@ class _Cloud extends StatelessWidget { scaleY: scale * (flipY ? -1 : 1), child: Image.asset( ImagePaths.cloud, + excludeFromSemantics: true, opacity: AlwaysStoppedAnimation(.4 * opacity), width: size * scale, fit: BoxFit.fitWidth, diff --git a/lib/ui/wonder_illustrations/common/illustration_piece.dart b/lib/ui/wonder_illustrations/common/illustration_piece.dart index 54d48534..7997673f 100644 --- a/lib/ui/wonder_illustrations/common/illustration_piece.dart +++ b/lib/ui/wonder_illustrations/common/illustration_piece.dart @@ -86,7 +86,12 @@ class _IllustrationPieceState extends State { final anim = wonderBuilder.anim; final curvedAnim = Curves.easeOut.transform(anim.value); final config = wonderBuilder.widget.config; - Widget img = Image.asset(imgPath, opacity: anim, fit: BoxFit.fitHeight); + Widget img = Image.asset( + imgPath, + excludeFromSemantics: true, + opacity: anim, + fit: BoxFit.fitHeight + ); // Add overflow box so image doesn't get clipped as we translate it around img = OverflowBox(maxWidth: 2500, child: img); diff --git a/lib/ui/wonder_illustrations/common/paint_textures.dart b/lib/ui/wonder_illustrations/common/paint_textures.dart index b8348919..a9d26381 100644 --- a/lib/ui/wonder_illustrations/common/paint_textures.dart +++ b/lib/ui/wonder_illustrations/common/paint_textures.dart @@ -18,6 +18,7 @@ class IllustrationTexture extends StatelessWidget { scaleX: scale * (flipX ? -1 : 1), scaleY: scale * (flipY ? -1 : 1), child: Image.asset(path, + excludeFromSemantics: true, repeat: ImageRepeat.repeat, fit: BoxFit.contain, alignment: Alignment.topCenter, diff --git a/web/index.html b/web/index.html index 8832c744..ee827b5b 100644 --- a/web/index.html +++ b/web/index.html @@ -1,5 +1,5 @@ - + Wonderous