feat: wrap with semantic widget for talkback

This commit is contained in:
detherminal 2023-04-27 21:31:54 +03:00
parent 7ea374d6e4
commit 4c145e1412

View file

@ -99,56 +99,60 @@ class _RefreshButtonState extends ConsumerState<WalletRefreshButton> {
return SizedBox( return SizedBox(
height: isDesktop ? 22 : 36, height: isDesktop ? 22 : 36,
width: isDesktop ? 22 : 36, width: isDesktop ? 22 : 36,
child: MaterialButton( child: Semantics(
color: isDesktop label: "Refresh Button. Refreshes The Values In Summary.",
? Theme.of(context).extension<StackColors>()!.buttonBackSecondary excludeSemantics: true,
: null, child: MaterialButton(
splashColor: Theme.of(context).extension<StackColors>()!.highlight, color: isDesktop
onPressed: () { ? Theme.of(context).extension<StackColors>()!.buttonBackSecondary
if (widget.tokenContractAddress == null) { : null,
final managerProvider = ref splashColor: Theme.of(context).extension<StackColors>()!.highlight,
.read(walletsChangeNotifierProvider) onPressed: () {
.getManagerProvider(widget.walletId); if (widget.tokenContractAddress == null) {
final isRefreshing = ref.read(managerProvider).isRefreshing; final managerProvider = ref
if (!isRefreshing) { .read(walletsChangeNotifierProvider)
_spinController.repeat?.call(); .getManagerProvider(widget.walletId);
ref final isRefreshing = ref.read(managerProvider).isRefreshing;
.read(managerProvider) if (!isRefreshing) {
.refresh() _spinController.repeat?.call();
.then((_) => _spinController.stop?.call()); ref
.read(managerProvider)
.refresh()
.then((_) => _spinController.stop?.call());
}
} else {
if (!ref.read(tokenServiceProvider)!.isRefreshing) {
ref.read(tokenServiceProvider)!.refresh();
}
} }
} else { },
if (!ref.read(tokenServiceProvider)!.isRefreshing) { elevation: 0,
ref.read(tokenServiceProvider)!.refresh(); highlightElevation: 0,
} hoverElevation: 0,
} padding: EdgeInsets.zero,
}, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
elevation: 0, shape: RoundedRectangleBorder(
highlightElevation: 0, borderRadius: BorderRadius.circular(
hoverElevation: 0, Constants.size.circularBorderRadius,
padding: EdgeInsets.zero, ),
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, ),
shape: RoundedRectangleBorder( child: RotatingArrows(
borderRadius: BorderRadius.circular( spinByDefault: widget.initialSyncStatus == WalletSyncStatus.syncing,
Constants.size.circularBorderRadius, width: isDesktop ? 12 : 24,
height: isDesktop ? 12 : 24,
controller: _spinController,
color: widget.overrideIconColor != null
? widget.overrideIconColor!
: isDesktop
? Theme.of(context)
.extension<StackColors>()!
.textFieldDefaultSearchIconRight
: Theme.of(context)
.extension<StackColors>()!
.textFavoriteCard,
), ),
), ),
child: RotatingArrows( )
spinByDefault: widget.initialSyncStatus == WalletSyncStatus.syncing,
width: isDesktop ? 12 : 24,
height: isDesktop ? 12 : 24,
controller: _spinController,
color: widget.overrideIconColor != null
? widget.overrideIconColor!
: isDesktop
? Theme.of(context)
.extension<StackColors>()!
.textFieldDefaultSearchIconRight
: Theme.of(context)
.extension<StackColors>()!
.textFavoriteCard,
),
),
); );
} }
} }