mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-10 20:54:33 +00:00
feat: wrap with semantic widget for talkback
This commit is contained in:
parent
7ea374d6e4
commit
4c145e1412
1 changed files with 51 additions and 47 deletions
|
@ -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,
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue