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(
height: isDesktop ? 22 : 36,
width: isDesktop ? 22 : 36,
child: MaterialButton(
color: isDesktop
? Theme.of(context).extension<StackColors>()!.buttonBackSecondary
: null,
splashColor: Theme.of(context).extension<StackColors>()!.highlight,
onPressed: () {
if (widget.tokenContractAddress == null) {
final managerProvider = ref
.read(walletsChangeNotifierProvider)
.getManagerProvider(widget.walletId);
final isRefreshing = ref.read(managerProvider).isRefreshing;
if (!isRefreshing) {
_spinController.repeat?.call();
ref
.read(managerProvider)
.refresh()
.then((_) => _spinController.stop?.call());
child: Semantics(
label: "Refresh Button. Refreshes The Values In Summary.",
excludeSemantics: true,
child: MaterialButton(
color: isDesktop
? Theme.of(context).extension<StackColors>()!.buttonBackSecondary
: null,
splashColor: Theme.of(context).extension<StackColors>()!.highlight,
onPressed: () {
if (widget.tokenContractAddress == null) {
final managerProvider = ref
.read(walletsChangeNotifierProvider)
.getManagerProvider(widget.walletId);
final isRefreshing = ref.read(managerProvider).isRefreshing;
if (!isRefreshing) {
_spinController.repeat?.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) {
ref.read(tokenServiceProvider)!.refresh();
}
}
},
elevation: 0,
highlightElevation: 0,
hoverElevation: 0,
padding: EdgeInsets.zero,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius,
},
elevation: 0,
highlightElevation: 0,
hoverElevation: 0,
padding: EdgeInsets.zero,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius,
),
),
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,
),
),
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,
),
),
)
);
}
}