mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-16 17:27:37 +00:00
Accessibility fixes (#1128)
This commit is contained in:
parent
2a3b5644d7
commit
8889f09509
5 changed files with 163 additions and 147 deletions
|
@ -99,19 +99,22 @@ class AddressPage extends BasePage {
|
|||
Widget? trailing(BuildContext context) {
|
||||
return Material(
|
||||
color: Colors.transparent,
|
||||
child: IconButton(
|
||||
padding: EdgeInsets.zero,
|
||||
constraints: BoxConstraints(),
|
||||
highlightColor: Colors.transparent,
|
||||
splashColor: Colors.transparent,
|
||||
iconSize: 25,
|
||||
onPressed: () {
|
||||
ShareUtil.share(
|
||||
text: addressListViewModel.uri.toString(),
|
||||
context: context,
|
||||
);
|
||||
},
|
||||
icon: Icon(Icons.share, size: 20, color: pageIconColor(context)),
|
||||
child: Semantics(
|
||||
label: S.of(context).share,
|
||||
child: IconButton(
|
||||
padding: EdgeInsets.zero,
|
||||
constraints: BoxConstraints(),
|
||||
highlightColor: Colors.transparent,
|
||||
splashColor: Colors.transparent,
|
||||
iconSize: 25,
|
||||
onPressed: () {
|
||||
ShareUtil.share(
|
||||
text: addressListViewModel.uri.toString(),
|
||||
context: context,
|
||||
);
|
||||
},
|
||||
icon: Icon(Icons.share, size: 20, color: pageIconColor(context)),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -31,21 +31,29 @@ class HeaderRow extends StatelessWidget {
|
|||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).extension<DashboardPageTheme>()!.pageTitleTextColor),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
showPopUp<void>(
|
||||
context: context,
|
||||
builder: (context) =>
|
||||
FilterWidget(dashboardViewModel: dashboardViewModel)
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
height: 36,
|
||||
width: 36,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Theme.of(context).extension<FilterTheme>()!.buttonColor),
|
||||
child: filterIcon,
|
||||
Semantics(
|
||||
container: true,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
showPopUp<void>(
|
||||
context: context,
|
||||
builder: (context) => FilterWidget(dashboardViewModel: dashboardViewModel),
|
||||
);
|
||||
},
|
||||
child: Semantics(
|
||||
label: 'Transaction Filter',
|
||||
button: true,
|
||||
enabled: true,
|
||||
child: Container(
|
||||
height: 36,
|
||||
width: 36,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Theme.of(context).extension<FilterTheme>()!.buttonColor,
|
||||
),
|
||||
child: filterIcon,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import 'package:cake_wallet/src/widgets/alert_close_button.dart';
|
||||
import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
import 'package:cake_wallet/src/screens/ionia/widgets/rounded_checkbox.dart';
|
||||
import 'package:cake_wallet/src/widgets/alert_background.dart';
|
||||
import 'package:cake_wallet/typography.dart';
|
||||
|
@ -71,77 +71,69 @@ class PresentReceiveOptionPicker extends StatelessWidget {
|
|||
builder: (BuildContext popUpContext) => Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
backgroundColor: Colors.transparent,
|
||||
body: AlertBackground(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Spacer(),
|
||||
Container(
|
||||
margin: EdgeInsets.symmetric(horizontal: 24),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
color: Theme.of(context).colorScheme.background,
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(top: 24, bottom: 24),
|
||||
child: (ListView.separated(
|
||||
padding: EdgeInsets.zero,
|
||||
shrinkWrap: true,
|
||||
itemCount: receiveOptionViewModel.options.length,
|
||||
itemBuilder: (_, index) {
|
||||
final option = receiveOptionViewModel.options[index];
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
Navigator.pop(popUpContext);
|
||||
body: Stack(
|
||||
alignment: AlignmentDirectional.center,
|
||||
children:[ AlertBackground(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Spacer(),
|
||||
Container(
|
||||
margin: EdgeInsets.symmetric(horizontal: 24),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
color: Theme.of(context).colorScheme.background,
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(top: 24, bottom: 24),
|
||||
child: (ListView.separated(
|
||||
padding: EdgeInsets.zero,
|
||||
shrinkWrap: true,
|
||||
itemCount: receiveOptionViewModel.options.length,
|
||||
itemBuilder: (_, index) {
|
||||
final option = receiveOptionViewModel.options[index];
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
Navigator.pop(popUpContext);
|
||||
|
||||
receiveOptionViewModel.selectReceiveOption(option);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(left: 24, right: 24),
|
||||
child: Observer(builder: (_) {
|
||||
final value = receiveOptionViewModel.selectedReceiveOption;
|
||||
receiveOptionViewModel.selectReceiveOption(option);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(left: 24, right: 24),
|
||||
child: Observer(builder: (_) {
|
||||
final value = receiveOptionViewModel.selectedReceiveOption;
|
||||
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(option.toString(),
|
||||
textAlign: TextAlign.left,
|
||||
style: textSmall(
|
||||
color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
|
||||
).copyWith(
|
||||
fontWeight:
|
||||
value == option ? FontWeight.w800 : FontWeight.w500,
|
||||
)),
|
||||
RoundedCheckbox(
|
||||
value: value == option,
|
||||
)
|
||||
],
|
||||
);
|
||||
}),
|
||||
),
|
||||
);
|
||||
},
|
||||
separatorBuilder: (_, index) => SizedBox(height: 30),
|
||||
)),
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
Container(
|
||||
margin: EdgeInsets.only(bottom: 40),
|
||||
child: InkWell(
|
||||
onTap: () => Navigator.pop(popUpContext),
|
||||
child: CircleAvatar(
|
||||
child: Icon(
|
||||
Icons.close,
|
||||
color: Palette.darkBlueCraiola,
|
||||
),
|
||||
backgroundColor: Colors.white,
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(option.toString(),
|
||||
textAlign: TextAlign.left,
|
||||
style: textSmall(
|
||||
color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
|
||||
).copyWith(
|
||||
fontWeight:
|
||||
value == option ? FontWeight.w800 : FontWeight.w500,
|
||||
)),
|
||||
RoundedCheckbox(
|
||||
value: value == option,
|
||||
)
|
||||
],
|
||||
);
|
||||
}),
|
||||
),
|
||||
);
|
||||
},
|
||||
separatorBuilder: (_, index) => SizedBox(height: 30),
|
||||
)),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
Spacer()
|
||||
],
|
||||
),
|
||||
),
|
||||
AlertCloseButton(onTap: () => Navigator.of(popUpContext).pop(), bottom: 40)
|
||||
],
|
||||
),
|
||||
),
|
||||
context: context,
|
||||
|
|
|
@ -416,37 +416,40 @@ class ExchangeCardState extends State<ExchangeCard> {
|
|||
width: 34,
|
||||
height: 34,
|
||||
padding: EdgeInsets.only(top: 0),
|
||||
child: InkWell(
|
||||
onTap: () async {
|
||||
final contact =
|
||||
await Navigator.of(context)
|
||||
.pushNamed(
|
||||
Routes.pickerAddressBook,
|
||||
arguments: widget.initialCurrency,
|
||||
);
|
||||
child: Semantics(
|
||||
label: S.of(context).address_book,
|
||||
child: InkWell(
|
||||
onTap: () async {
|
||||
final contact =
|
||||
await Navigator.of(context)
|
||||
.pushNamed(
|
||||
Routes.pickerAddressBook,
|
||||
arguments: widget.initialCurrency,
|
||||
);
|
||||
|
||||
if (contact is ContactBase &&
|
||||
contact.address != null) {
|
||||
setState(() =>
|
||||
addressController.text =
|
||||
contact.address);
|
||||
widget.onPushAddressBookButton
|
||||
?.call(context);
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
color: widget
|
||||
.addressButtonsColor,
|
||||
borderRadius:
|
||||
BorderRadius.all(
|
||||
Radius.circular(
|
||||
6))),
|
||||
child: Image.asset(
|
||||
'assets/images/open_book.png',
|
||||
color: Theme.of(context).extension<SendPageTheme>()!.textFieldButtonIconColor,
|
||||
)),
|
||||
if (contact is ContactBase &&
|
||||
contact.address != null) {
|
||||
setState(() =>
|
||||
addressController.text =
|
||||
contact.address);
|
||||
widget.onPushAddressBookButton
|
||||
?.call(context);
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
color: widget
|
||||
.addressButtonsColor,
|
||||
borderRadius:
|
||||
BorderRadius.all(
|
||||
Radius.circular(
|
||||
6))),
|
||||
child: Image.asset(
|
||||
'assets/images/open_book.png',
|
||||
color: Theme.of(context).extension<SendPageTheme>()!.textFieldButtonIconColor,
|
||||
)),
|
||||
),
|
||||
)),
|
||||
),
|
||||
Padding(
|
||||
|
@ -455,22 +458,25 @@ class ExchangeCardState extends State<ExchangeCard> {
|
|||
width: 34,
|
||||
height: 34,
|
||||
padding: EdgeInsets.only(top: 0),
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Clipboard.setData(ClipboardData(
|
||||
text: addressController
|
||||
.text));
|
||||
showBar<void>(
|
||||
context,
|
||||
S
|
||||
.of(context)
|
||||
.copied_to_clipboard);
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.fromLTRB(
|
||||
8, 8, 0, 8),
|
||||
color: Colors.transparent,
|
||||
child: copyImage),
|
||||
child: Semantics(
|
||||
label: S.of(context).copy_address,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Clipboard.setData(ClipboardData(
|
||||
text: addressController
|
||||
.text));
|
||||
showBar<void>(
|
||||
context,
|
||||
S
|
||||
.of(context)
|
||||
.copied_to_clipboard);
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.fromLTRB(
|
||||
8, 8, 0, 8),
|
||||
color: Colors.transparent,
|
||||
child: copyImage),
|
||||
),
|
||||
)))
|
||||
])))
|
||||
])),
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class AlertCloseButton extends StatelessWidget {
|
||||
AlertCloseButton({this.image, this.bottom, this.onTap});
|
||||
|
||||
final VoidCallback? onTap;
|
||||
|
||||
final Image? image;
|
||||
|
@ -19,12 +21,17 @@ class AlertCloseButton extends StatelessWidget {
|
|||
bottom: bottom ?? 60,
|
||||
child: GestureDetector(
|
||||
onTap: onTap ?? () => Navigator.of(context).pop(),
|
||||
child: Container(
|
||||
height: 42,
|
||||
width: 42,
|
||||
decoration: BoxDecoration(color: Colors.white, shape: BoxShape.circle),
|
||||
child: Center(
|
||||
child: image ?? closeButton,
|
||||
child: Semantics(
|
||||
label: S.of(context).close,
|
||||
button: true,
|
||||
enabled: true,
|
||||
child: Container(
|
||||
height: 42,
|
||||
width: 42,
|
||||
decoration: BoxDecoration(color: Colors.white, shape: BoxShape.circle),
|
||||
child: Center(
|
||||
child: image ?? closeButton,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
Loading…
Reference in a new issue