mirror of
https://github.com/gskinnerTeam/flutter-wonderous-app.git
synced 2025-05-20 14:26:27 +08:00
Merge branch 'accessability-pass' into accessibility-pass-semanticslabels
This commit is contained in:
@ -7,6 +7,7 @@ class AppColors {
|
|||||||
/// Common
|
/// Common
|
||||||
final Color accent1 = Color(0xFFE4935D);
|
final Color accent1 = Color(0xFFE4935D);
|
||||||
final Color accent2 = Color(0xFFBEABA1);
|
final Color accent2 = Color(0xFFBEABA1);
|
||||||
|
final Color accent3 = Color(0xFFC47642);
|
||||||
final Color offWhite = Color(0xFFF8ECE5);
|
final Color offWhite = Color(0xFFF8ECE5);
|
||||||
final Color caption = const Color(0xFF7D7873);
|
final Color caption = const Color(0xFF7D7873);
|
||||||
final Color body = const Color(0xFF514F4D);
|
final Color body = const Color(0xFF514F4D);
|
||||||
|
@ -155,7 +155,7 @@ class AppBtn extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
if (focus.hasFocus)
|
if (focus.hasFocus)
|
||||||
Positioned.fill(
|
Positioned.fill(
|
||||||
child: IgnorePointerWithSemantics(
|
child: IgnorePointerKeepSemantics(
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular($styles.corners.md),
|
borderRadius: BorderRadius.circular($styles.corners.md),
|
||||||
|
@ -65,7 +65,7 @@ class ScrollDecorator extends StatefulWidget {
|
|||||||
bgBuilder = null;
|
bgBuilder = null;
|
||||||
fgBuilder = (controller) {
|
fgBuilder = (controller) {
|
||||||
final double ratio = controller.hasClients ? min(1, controller.position.extentBefore / 60) : 0;
|
final double ratio = controller.hasClients ? min(1, controller.position.extentBefore / 60) : 0;
|
||||||
return IgnorePointerWithSemantics(
|
return IgnorePointerKeepSemantics(
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 24,
|
height: 24,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
|
@ -24,8 +24,7 @@ class GradientContainer extends StatelessWidget {
|
|||||||
final BorderRadius? borderRadius;
|
final BorderRadius? borderRadius;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) => ExcludeSemantics(
|
Widget build(BuildContext context) => IgnorePointerAndSemantics(
|
||||||
child: IgnorePointerWithSemantics(
|
|
||||||
child: Container(
|
child: Container(
|
||||||
width: width,
|
width: width,
|
||||||
height: height,
|
height: height,
|
||||||
@ -42,7 +41,6 @@ class GradientContainer extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
child: child,
|
child: child,
|
||||||
),
|
),
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,18 +1,32 @@
|
|||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import 'package:wonders/common_libs.dart';
|
import 'package:wonders/common_libs.dart';
|
||||||
|
|
||||||
class IgnorePointerWithSemantics extends SingleChildRenderObjectWidget {
|
class IgnorePointerKeepSemantics extends SingleChildRenderObjectWidget {
|
||||||
const IgnorePointerWithSemantics({super.key, super.child});
|
const IgnorePointerKeepSemantics({super.key, super.child});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
RenderIgnorePointerWithSemantics createRenderObject(BuildContext context) {
|
RenderIgnorePointerKeepSemantics createRenderObject(BuildContext context) {
|
||||||
return RenderIgnorePointerWithSemantics();
|
return RenderIgnorePointerKeepSemantics();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class RenderIgnorePointerWithSemantics extends RenderProxyBox {
|
class RenderIgnorePointerKeepSemantics extends RenderProxyBox {
|
||||||
RenderIgnorePointerWithSemantics();
|
RenderIgnorePointerKeepSemantics();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool hitTest(BoxHitTestResult result, { required Offset position }) => false;
|
bool hitTest(BoxHitTestResult result, { required Offset position }) => false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class IgnorePointerAndSemantics extends StatelessWidget {
|
||||||
|
final Widget child;
|
||||||
|
const IgnorePointerAndSemantics({super.key, required this.child});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return ExcludeSemantics(
|
||||||
|
child: IgnorePointer(
|
||||||
|
child: child
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -26,7 +26,7 @@ class _BottomTextContent extends StatelessWidget {
|
|||||||
Gap($styles.insets.md),
|
Gap($styles.insets.md),
|
||||||
Column(
|
Column(
|
||||||
children: [
|
children: [
|
||||||
IgnorePointerWithSemantics(
|
IgnorePointerKeepSemantics(
|
||||||
child: Semantics(
|
child: Semantics(
|
||||||
button: true,
|
button: true,
|
||||||
onIncrease: () => state._handleArtifactTap(_currentPage + 1),
|
onIncrease: () => state._handleArtifactTap(_currentPage + 1),
|
||||||
|
@ -131,19 +131,19 @@ class _SearchInput extends StatelessWidget {
|
|||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Gap($styles.insets.xs * 1.5),
|
Gap($styles.insets.xs * 1.5),
|
||||||
Icon(Icons.search, color: $styles.colors.caption),
|
Icon(Icons.search, color: captionColor),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: TextField(
|
child: TextField(
|
||||||
onSubmitted: onSubmit,
|
onSubmitted: onSubmit,
|
||||||
controller: textController,
|
controller: textController,
|
||||||
focusNode: focusNode,
|
focusNode: focusNode,
|
||||||
style: TextStyle(color: captionColor, ),
|
style: TextStyle(color: $styles.colors.greyStrong),
|
||||||
textAlignVertical: TextAlignVertical.top,
|
textAlignVertical: TextAlignVertical.top,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
isDense: true,
|
isDense: true,
|
||||||
contentPadding: EdgeInsets.all($styles.insets.xs),
|
contentPadding: EdgeInsets.all($styles.insets.xs),
|
||||||
labelStyle: TextStyle(color: captionColor),
|
labelStyle: TextStyle(color: captionColor),
|
||||||
hintStyle: TextStyle(color: captionColor.withOpacity(0.5)),
|
hintStyle: TextStyle(color: $styles.colors.body),
|
||||||
prefixStyle: TextStyle(color: captionColor),
|
prefixStyle: TextStyle(color: captionColor),
|
||||||
focusedBorder: OutlineInputBorder(borderSide: BorderSide.none),
|
focusedBorder: OutlineInputBorder(borderSide: BorderSide.none),
|
||||||
enabledBorder: UnderlineInputBorder(borderSide: BorderSide.none),
|
enabledBorder: UnderlineInputBorder(borderSide: BorderSide.none),
|
||||||
|
@ -133,7 +133,7 @@ class _AnimatedCircleWithTextState extends State<_AnimatedCircleWithText> with S
|
|||||||
Widget _buildCircularText(String title) {
|
Widget _buildCircularText(String title) {
|
||||||
final textStyle = $styles.text.monoTitleFont.copyWith(
|
final textStyle = $styles.text.monoTitleFont.copyWith(
|
||||||
fontSize: 22 * $styles.scale,
|
fontSize: 22 * $styles.scale,
|
||||||
color: $styles.colors.accent1,
|
color: $styles.colors.accent3,
|
||||||
);
|
);
|
||||||
return CircularText(
|
return CircularText(
|
||||||
position: CircularTextPosition.inside,
|
position: CircularTextPosition.inside,
|
||||||
|
@ -18,7 +18,7 @@ class _LargeSimpleQuote extends StatelessWidget {
|
|||||||
child: Text(
|
child: Text(
|
||||||
'“',
|
'“',
|
||||||
style: $styles.text.quote1.copyWith(
|
style: $styles.text.quote1.copyWith(
|
||||||
color: $styles.colors.accent1,
|
color: $styles.colors.accent3,
|
||||||
fontSize: 90 * $styles.scale,
|
fontSize: 90 * $styles.scale,
|
||||||
height: .7,
|
height: .7,
|
||||||
),
|
),
|
||||||
@ -32,7 +32,7 @@ class _LargeSimpleQuote extends StatelessWidget {
|
|||||||
Gap($styles.insets.md),
|
Gap($styles.insets.md),
|
||||||
Text(
|
Text(
|
||||||
'- $author',
|
'- $author',
|
||||||
style: $styles.text.quote2Sub.copyWith(color: $styles.colors.accent1),
|
style: $styles.text.quote2Sub.copyWith(color: $styles.colors.accent3),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@ -43,7 +43,7 @@ class _ScrollingContent extends StatelessWidget {
|
|||||||
dropChar,
|
dropChar,
|
||||||
overflow: TextOverflow.visible,
|
overflow: TextOverflow.visible,
|
||||||
style: $styles.text.dropCase.copyWith(
|
style: $styles.text.dropCase.copyWith(
|
||||||
color: $styles.colors.accent1,
|
color: $styles.colors.accent3,
|
||||||
height: 1,
|
height: 1,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -52,7 +52,7 @@ class _ScrollingContent extends StatelessWidget {
|
|||||||
style: $styles.text.body,
|
style: $styles.text.body,
|
||||||
dropCapPadding: EdgeInsets.only(right: 6),
|
dropCapPadding: EdgeInsets.only(right: 6),
|
||||||
dropCapStyle: $styles.text.dropCase.copyWith(
|
dropCapStyle: $styles.text.dropCase.copyWith(
|
||||||
color: $styles.colors.accent1,
|
color: $styles.colors.accent3,
|
||||||
height: 1,
|
height: 1,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
@ -242,7 +242,7 @@ class _MapsThumbnailState extends State<_MapsThumbnail> {
|
|||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
Positioned.fill(child: ColoredBox(color: Colors.transparent)),
|
Positioned.fill(child: ColoredBox(color: Colors.transparent)),
|
||||||
IgnorePointerWithSemantics(
|
IgnorePointerKeepSemantics(
|
||||||
child: GoogleMap(
|
child: GoogleMap(
|
||||||
markers: {getMapsMarker(startPos.target)},
|
markers: {getMapsMarker(startPos.target)},
|
||||||
zoomControlsEnabled: false,
|
zoomControlsEnabled: false,
|
||||||
|
@ -213,7 +213,7 @@ class _HomeScreenState extends State<HomeScreen> with SingleTickerProviderStateM
|
|||||||
Widget _buildFgAndGradients() {
|
Widget _buildFgAndGradients() {
|
||||||
Widget buildSwipeableBgGradient(Color fgColor) {
|
Widget buildSwipeableBgGradient(Color fgColor) {
|
||||||
return _swipeController.buildListener(builder: (swipeAmt, isPointerDown, _) {
|
return _swipeController.buildListener(builder: (swipeAmt, isPointerDown, _) {
|
||||||
return IgnorePointerWithSemantics(
|
return IgnorePointerKeepSemantics(
|
||||||
child: FractionallySizedBox(
|
child: FractionallySizedBox(
|
||||||
heightFactor: .6,
|
heightFactor: .6,
|
||||||
child: Container(
|
child: Container(
|
||||||
@ -251,7 +251,7 @@ class _HomeScreenState extends State<HomeScreen> with SingleTickerProviderStateM
|
|||||||
return Animate(
|
return Animate(
|
||||||
effects: const [FadeEffect()],
|
effects: const [FadeEffect()],
|
||||||
onPlay: _handleFadeAnimInit,
|
onPlay: _handleFadeAnimInit,
|
||||||
child: IgnorePointerWithSemantics(child: WonderIllustration(e.type, config: config)));
|
child: IgnorePointerKeepSemantics(child: WonderIllustration(e.type, config: config)));
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
|
|
||||||
@ -280,7 +280,7 @@ class _HomeScreenState extends State<HomeScreen> with SingleTickerProviderStateM
|
|||||||
|
|
||||||
/// Title Content
|
/// Title Content
|
||||||
LightText(
|
LightText(
|
||||||
child: IgnorePointerWithSemantics(
|
child: IgnorePointerKeepSemantics(
|
||||||
child: Transform.translate(
|
child: Transform.translate(
|
||||||
offset: Offset(0, 30),
|
offset: Offset(0, 30),
|
||||||
child: Column(
|
child: Column(
|
||||||
|
@ -114,7 +114,7 @@ class _IntroScreenState extends State<IntroScreen> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
IgnorePointerWithSemantics(
|
IgnorePointerKeepSemantics(
|
||||||
child: Column(children: [
|
child: Column(children: [
|
||||||
Spacer(),
|
Spacer(),
|
||||||
|
|
||||||
|
@ -292,7 +292,7 @@ class _PhotoGalleryState extends State<PhotoGallery> {
|
|||||||
Positioned.fill(
|
Positioned.fill(
|
||||||
child: AnimatedOpacity(
|
child: AnimatedOpacity(
|
||||||
duration: $styles.times.med,
|
duration: $styles.times.med,
|
||||||
opacity: isSelected ? 0 : .7,
|
opacity: isSelected ? 0 : ($styles.highContrast ? 0.4 : 0.7),
|
||||||
child: ColoredBox(color: $styles.colors.black),
|
child: ColoredBox(color: $styles.colors.black),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -31,7 +31,7 @@ class _AnimatedCutoutOverlay extends StatelessWidget {
|
|||||||
effects: [CustomEffect(builder: _buildAnimatedCutout, curve: Curves.easeOut, duration: duration)],
|
effects: [CustomEffect(builder: _buildAnimatedCutout, curve: Curves.easeOut, duration: duration)],
|
||||||
key: animationKey,
|
key: animationKey,
|
||||||
onComplete: (c) => c.reverse(),
|
onComplete: (c) => c.reverse(),
|
||||||
child: IgnorePointerWithSemantics(child: Container(color: Colors.black.withOpacity(opacity))),
|
child: IgnorePointerKeepSemantics(child: Container(color: Colors.black.withOpacity(opacity))),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
@ -54,7 +54,7 @@ class _EventMarkersState extends State<_EventMarkers> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return IgnorePointerWithSemantics(
|
return IgnorePointerKeepSemantics(
|
||||||
child: LayoutBuilder(builder: (_, constraints) {
|
child: LayoutBuilder(builder: (_, constraints) {
|
||||||
/// Figure out which event is "selected"
|
/// Figure out which event is "selected"
|
||||||
_updateSelectedEvent(constraints.maxHeight);
|
_updateSelectedEvent(constraints.maxHeight);
|
||||||
|
@ -35,7 +35,7 @@ class _EventPopupsState extends State<_EventPopups> {
|
|||||||
final evt = _eventToShow;
|
final evt = _eventToShow;
|
||||||
return TopCenter(
|
return TopCenter(
|
||||||
child: ClipRect(
|
child: ClipRect(
|
||||||
child: IgnorePointerWithSemantics(
|
child: IgnorePointerKeepSemantics(
|
||||||
child: AnimatedSwitcher(
|
child: AnimatedSwitcher(
|
||||||
duration: $styles.times.fast,
|
duration: $styles.times.fast,
|
||||||
child: evt == null
|
child: evt == null
|
||||||
|
@ -69,7 +69,7 @@ class _ScalingViewportState extends State<_ScrollingViewport> {
|
|||||||
_buildScrollingArea(context).maybeAnimate().fadeIn(),
|
_buildScrollingArea(context).maybeAnimate().fadeIn(),
|
||||||
|
|
||||||
// Dashed line with a year that changes as we scroll
|
// Dashed line with a year that changes as we scroll
|
||||||
IgnorePointerWithSemantics(
|
IgnorePointerKeepSemantics(
|
||||||
child: AnimatedBuilder(
|
child: AnimatedBuilder(
|
||||||
animation: controller.scroller,
|
animation: controller.scroller,
|
||||||
builder: (_, __) {
|
builder: (_, __) {
|
||||||
|
@ -20,7 +20,7 @@ class TimelineSection extends StatelessWidget {
|
|||||||
StringUtils.formatYr(data.startYr),
|
StringUtils.formatYr(data.startYr),
|
||||||
StringUtils.formatYr(data.endYr),
|
StringUtils.formatYr(data.endYr),
|
||||||
)}',
|
)}',
|
||||||
child: IgnorePointerWithSemantics(
|
child: IgnorePointerKeepSemantics(
|
||||||
child: Container(
|
child: Container(
|
||||||
alignment: Alignment(0, -1 + fraction * 2),
|
alignment: Alignment(0, -1 + fraction * 2),
|
||||||
padding: EdgeInsets.all($styles.insets.xs),
|
padding: EdgeInsets.all($styles.insets.xs),
|
||||||
|
@ -13,7 +13,7 @@ class _YearMarkers extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return IgnorePointerWithSemantics(
|
return IgnorePointerKeepSemantics(
|
||||||
child: LayoutBuilder(builder: (_, constraints) {
|
child: LayoutBuilder(builder: (_, constraints) {
|
||||||
int interval = 100;
|
int interval = 100;
|
||||||
if (constraints.maxHeight < 800) {
|
if (constraints.maxHeight < 800) {
|
||||||
|
@ -64,7 +64,7 @@ class _EventsListState extends State<_EventsList> {
|
|||||||
key: PageStorageKey('eventsList'),
|
key: PageStorageKey('eventsList'),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
IgnorePointerWithSemantics(child: Gap(widget.topHeight)),
|
IgnorePointerKeepSemantics(child: Gap(widget.topHeight)),
|
||||||
Container(
|
Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: $styles.colors.black,
|
color: $styles.colors.black,
|
||||||
@ -120,7 +120,7 @@ class _EventsListState extends State<_EventsList> {
|
|||||||
if (showBackdrop) ...[
|
if (showBackdrop) ...[
|
||||||
AppBackdrop(
|
AppBackdrop(
|
||||||
strength: backdropAmt,
|
strength: backdropAmt,
|
||||||
child: IgnorePointerWithSemantics(
|
child: IgnorePointerKeepSemantics(
|
||||||
child: Container(
|
child: Container(
|
||||||
color: $styles.colors.black.withOpacity(backdropAmt * .6),
|
color: $styles.colors.black.withOpacity(backdropAmt * .6),
|
||||||
),
|
),
|
||||||
|
Reference in New Issue
Block a user