Cw 355 more talkback unlabeled (#913)

* feat(Talkback): make add contact button labeled

* feat(Talkback): add labeled semantics to cakepay buttons

- Use BasePage's default labeled back button instead of override
- Add filter button semantics
- Add ExcludeSemantics to search icon because it was messing with the whole search input box semantics and making it sound like an unlabeled button
- Add profile button label

* feat(Talkback): add labeled semantics to send page buttons

- Add semantics label to Paste button
- Add semantics label to Scan button
- Add semantics label to Address Book button

* fix: use i18n strings instead of hardcoded semantics labels and add missing 'profile' string

* fix: also add localization to back button on base page

* fix(Talkback): add the rest of localized strings & add missing close string

* fix: pt strings

* feat: add correct strings using translate script

* Update strings_yo.arb [skip ci]

---------

Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
This commit is contained in:
Rafael Saes
2023-07-12 00:21:59 +03:00
committed by GitHub
co-authored by Omar Hatem
parent 02fd12f5f8
commit d5642fa0ff
38 changed files with 348 additions and 195 deletions
+2 -1
View File
@@ -5,6 +5,7 @@ import 'package:cake_wallet/palette.dart';
import 'package:cake_wallet/di.dart';
import 'package:cake_wallet/store/settings_store.dart';
import 'package:cake_wallet/src/widgets/nav_bar.dart';
import 'package:cake_wallet/generated/i18n.dart';
enum AppBarStyle { regular, withShadow, transparent }
@@ -58,7 +59,7 @@ abstract class BasePage extends StatelessWidget {
child: ButtonTheme(
minWidth: double.minPositive,
child: Semantics(
label: 'Back',
label: S.of(context).seed_alert_back,
child: TextButton(
style: ButtonStyle(
overlayColor: MaterialStateColor.resolveWith(
+31 -26
View File
@@ -24,35 +24,40 @@ class ContactListPage extends BasePage {
@override
Widget? trailing(BuildContext context) {
return Container(
width: 32.0,
height: 32.0,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Theme.of(context)
return MergeSemantics(
child: Container(
width: 32.0,
height: 32.0,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Theme.of(context)
.accentTextTheme!
.bodySmall!
.color!),
child: Stack(
alignment: Alignment.center,
children: <Widget>[
Icon(Icons.add,
color: Theme.of(context).primaryTextTheme!.titleLarge!.color!,
size: 22.0),
ButtonTheme(
minWidth: 32.0,
height: 32.0,
child: TextButton(
// FIX-ME: Style
//shape: CircleBorder(),
onPressed: () async {
await Navigator.of(context)
.pushNamed(Routes.addressBookAddContact);
},
child: Offstage()),
)
],
));
child: Stack(
alignment: Alignment.center,
children: <Widget>[
Icon(Icons.add,
color: Theme.of(context).primaryTextTheme!.titleLarge!.color!,
size: 22.0),
ButtonTheme(
minWidth: 32.0,
height: 32.0,
child: Semantics(
label: S.of(context).add,
child: TextButton(
// FIX-ME: Style
//shape: CircleBorder(),
onPressed: () async {
await Navigator.of(context)
.pushNamed(Routes.addressBookAddContact);
},
child: Offstage()),
),
)
],
)),
);
}
@override
@@ -111,7 +111,8 @@ class _DashboardPageView extends BasePage {
//splashColor: Colors.transparent,
//padding: EdgeInsets.all(0),
onPressed: () => onOpenEndDrawer(),
child: Semantics(label: 'Menu', child: menuButton)));
child: Semantics(
label: S.of(context).wallet_menu, child: menuButton)));
}
final DashboardViewModel dashboardViewModel;
@@ -248,7 +249,7 @@ class _DashboardPageView extends BasePage {
}
if (dashboardViewModel.shouldShowMarketPlaceInDashboard) {
pages.add(Semantics(
label: 'Marketplace Page',
label: S.of(context).market_place,
child: MarketPlacePage(
dashboardViewModel: dashboardViewModel,
marketPlaceViewModel: getIt.get<MarketPlaceViewModel>(),
@@ -256,9 +257,9 @@ class _DashboardPageView extends BasePage {
),
);
}
pages.add(Semantics(label: 'Balance Page', child: balancePage));
pages.add(Semantics(label: S.of(context).balance_page, child: balancePage));
pages.add(Semantics(
label: 'Transactions Page',
label: S.of(context).settings_transactions,
child: TransactionsPage(dashboardViewModel: dashboardViewModel)));
_isEffectsInstalled = true;
@@ -82,7 +82,9 @@ class AddressPage extends BasePage {
child: ButtonTheme(
minWidth: double.minPositive,
child: Semantics(
label: !isMobileView ? 'Close' : 'Back',
label: !isMobileView
? S.of(context).close
: S.of(context).seed_alert_back,
child: TextButton(
style: ButtonStyle(
overlayColor: MaterialStateColor.resolveWith(
+3 -1
View File
@@ -126,7 +126,9 @@ class ExchangePage extends BasePage {
child: ButtonTheme(
minWidth: double.minPositive,
child: Semantics(
label: !isMobileView ? 'Close' : 'Back',
label: !isMobileView
? S.of(context).close
: S.of(context).seed_alert_back,
child: TextButton(
style: ButtonStyle(
overlayColor: MaterialStateColor.resolveWith(
@@ -66,40 +66,6 @@ class IoniaManageCardsPage extends BasePage {
@override
Widget get endDrawer => CardMenu();
@override
Widget leading(BuildContext context) {
final _backButton = Icon(
Icons.arrow_back_ios,
color: Theme.of(context)
.accentTextTheme!
.displayMedium!
.backgroundColor!,
size: 16,
);
return SizedBox(
height: 37,
width: 37,
child: ButtonTheme(
minWidth: double.minPositive,
child: TextButton(
// FIX-ME: Style
//highlightColor: Colors.transparent,
//splashColor: Colors.transparent,
//padding: EdgeInsets.all(0),
onPressed: (){
if (searchFocusNode.hasFocus) {
searchFocusNode.unfocus();
return;
}
Navigator.of(context).pop();
},
child: _backButton),
),
);
}
@override
Widget middle(BuildContext context) {
return Text(
@@ -123,26 +89,28 @@ class IoniaManageCardsPage extends BasePage {
@override
Widget body(BuildContext context) {
final filterButton = InkWell(
onTap: () async {
await showCategoryFilter(context);
_cardsListViewModel.getMerchants();
},
child: Container(
width: 32,
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
color: Theme.of(context).textTheme!.titleLarge!.backgroundColor!,
border: Border.all(
color: Colors.white.withOpacity(0.2),
final filterButton = Semantics(
label: S.of(context).filter_by,
child: InkWell(
onTap: () async {
await showCategoryFilter(context);
_cardsListViewModel.getMerchants();
},
child: Container(
width: 32,
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
color: Theme.of(context).textTheme!.titleLarge!.backgroundColor!,
border: Border.all(
color: Colors.white.withOpacity(0.2),
),
borderRadius: BorderRadius.circular(10),
),
borderRadius: BorderRadius.circular(10),
),
child: Image.asset(
'assets/images/filter.png',
color: Theme.of(context).textTheme!.bodySmall!.decorationColor!,
),
)
child: Image.asset(
'assets/images/filter.png',
color: Theme.of(context).textTheme!.bodySmall!.decorationColor!,
),
)),
);
return Padding(
@@ -281,11 +249,13 @@ class _SearchWidget extends StatelessWidget {
final FocusNode focusNode;
@override
Widget build(BuildContext context) {
final searchIcon = Padding(
padding: EdgeInsets.all(8),
child: Image.asset(
'assets/images/mini_search_icon.png',
color: Theme.of(context).textTheme!.bodySmall!.decorationColor!,
final searchIcon = ExcludeSemantics(
child: Padding(
padding: EdgeInsets.all(8),
child: Image.asset(
'assets/images/mini_search_icon.png',
color: Theme.of(context).textTheme!.bodySmall!.decorationColor!,
),
),
);
@@ -335,18 +305,22 @@ class _TrailingIcon extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Material(
color: Colors.transparent,
child: IconButton(
padding: EdgeInsets.zero,
constraints: BoxConstraints(),
highlightColor: Colors.transparent,
splashColor: Colors.transparent,
iconSize: 25,
onPressed: onPressed,
icon: Image.asset(
asset,
color: Theme.of(context).accentTextTheme!.displayMedium!.backgroundColor!,
return Semantics(
label: S.of(context).profile,
child: Material(
color: Colors.transparent,
child: IconButton(
padding: EdgeInsets.zero,
constraints: BoxConstraints(),
highlightColor: Colors.transparent,
splashColor: Colors.transparent,
iconSize: 25,
onPressed: onPressed,
icon: Image.asset(
asset,
color:
Theme.of(context).accentTextTheme!.displayMedium!.backgroundColor!,
),
),
),
);
@@ -146,7 +146,7 @@ class _WalletNameFormState extends State<WalletNameForm> {
width: 1.0),
),
suffixIcon: Semantics(
label: 'Generate Name',
label: S.of(context).generate_name,
child: IconButton(
onPressed: () async {
final rName = await generateName();
@@ -226,7 +226,7 @@ class PinCodeState<T extends PinCodeWidget> extends State<T> {
child: Container(
margin: EdgeInsets.only(left: marginLeft, right: marginRight),
child: Semantics(
label: 'Delete',
label: S.of(context).delete,
button: true,
onTap: () => _pop(),
child: TextButton(
+1 -1
View File
@@ -87,7 +87,7 @@ class ReceivePage extends BasePage {
return Material(
color: Colors.transparent,
child: Semantics(
label: 'Share',
label: S.of(context).share,
child: IconButton(
padding: EdgeInsets.zero,
constraints: BoxConstraints(),
@@ -71,7 +71,7 @@ class AddressCell extends StatelessWidget {
),
));
return Semantics(
label: 'Slidable',
label: S.of(context).slidable,
selected: isCurrent,
enabled: !isCurrent,
child: Slidable(
+3 -1
View File
@@ -71,7 +71,9 @@ class SendPage extends BasePage {
child: ButtonTheme(
minWidth: double.minPositive,
child: Semantics(
label: !isMobileView ? 'Close' : 'Back',
label: !isMobileView
? S.of(context).close
: S.of(context).seed_alert_back,
child: TextButton(
style: ButtonStyle(
overlayColor: MaterialStateColor.resolveWith(
+74 -57
View File
@@ -114,55 +114,66 @@ class AddressTextField extends StatelessWidget {
width: prefixIconWidth,
height: prefixIconHeight,
padding: EdgeInsets.only(top: 0),
child: InkWell(
onTap: () async => _pasteAddress(context),
child: Container(
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
color: buttonColor ??
Theme.of(context)
.accentTextTheme!
child: Semantics(
label: S.of(context).paste,
child: InkWell(
onTap: () async => _pasteAddress(context),
child: Container(
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
color: buttonColor ??
Theme.of(context)
.accentTextTheme
!
.titleLarge!
.color!,
borderRadius:
BorderRadius.all(Radius.circular(6))),
child: Image.asset(
'assets/images/paste_ios.png',
color: iconColor ??
Theme.of(context)
.primaryTextTheme!
.color!,
borderRadius:
BorderRadius.all(Radius.circular(6))),
child: Image.asset(
'assets/images/paste_ios.png',
color: iconColor ??
Theme.of(context)
.primaryTextTheme
!
.headlineMedium!
.decorationColor!,
)),
.decorationColor!,
)),
),
)),
],
if (this.options.contains(AddressTextFieldOption.qrCode) && DeviceInfo.instance.isMobile)
...[
if (this.options.contains(AddressTextFieldOption.qrCode) &&
DeviceInfo.instance.isMobile) ...[
Container(
width: prefixIconWidth,
height: prefixIconHeight,
padding: EdgeInsets.only(top: 0),
child: InkWell(
onTap: () async => _presentQRScanner(context),
child: Container(
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
color: buttonColor ??
Theme.of(context)
.accentTextTheme
child: Semantics(
label: S.of(context).scan_qr_code,
child: InkWell(
onTap: () async => _presentQRScanner(context),
child: Container(
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
color: buttonColor ??
Theme.of(context)
.accentTextTheme
.titleLarge!
.color!,
borderRadius:
BorderRadius.all(Radius.circular(6))),
child: Image.asset(
'assets/images/qr_code_icon.png',
color: iconColor ??
Theme.of(context)
.primaryTextTheme!.headlineMedium!
.decorationColor!,
)),
.color!,
borderRadius:
BorderRadius.all(Radius.circular(6))),
child: Image.asset(
'assets/images/qr_code_icon.png',
color: iconColor ??
Theme.of(context)
.primaryTextTheme
!.headlineMedium!
.decorationColor!,
)),
),
))
] else SizedBox(width: 5),
] else
SizedBox(width: 5),
if (this
.options
.contains(AddressTextFieldOption.addressBook)) ...[
@@ -170,26 +181,32 @@ class AddressTextField extends StatelessWidget {
width: prefixIconWidth,
height: prefixIconHeight,
padding: EdgeInsets.only(top: 0),
child: InkWell(
onTap: () async => _presetAddressBookPicker(context),
child: Container(
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
color: buttonColor ??
Theme.of(context)
.accentTextTheme!
child: Semantics(
label: S.of(context).address_book,
child: InkWell(
onTap: () async =>
_presetAddressBookPicker(context),
child: Container(
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
color: buttonColor ??
Theme.of(context)
.accentTextTheme
!
.titleLarge!
.color!,
borderRadius:
BorderRadius.all(Radius.circular(6))),
child: Image.asset(
'assets/images/open_book.png',
color: iconColor ??
Theme.of(context)
.primaryTextTheme!
.color!,
borderRadius:
BorderRadius.all(Radius.circular(6))),
child: Image.asset(
'assets/images/open_book.png',
color: iconColor ??
Theme.of(context)
.primaryTextTheme
!
.headlineMedium!
.decorationColor!,
)),
.decorationColor!,
)),
),
))
]
],
+2 -1
View File
@@ -1,6 +1,7 @@
import 'package:auto_size_text/auto_size_text.dart';
import 'package:flutter/material.dart';
import 'package:cake_wallet/palette.dart';
import 'package:cake_wallet/generated/i18n.dart';
class IntroducingCard extends StatelessWidget {
IntroducingCard(
@@ -70,7 +71,7 @@ class IntroducingCard extends StatelessWidget {
Padding(
padding: const EdgeInsets.fromLTRB(0,16,16,0),
child: Semantics(
label: 'Close',
label: S.of(context).close,
child: GestureDetector(
onTap: closeCard,
child: Container(