Fix issue from code review

This commit is contained in:
Godwin Asuquo 2023-02-18 14:23:48 +02:00
parent 59a79242af
commit cf125d1e06
3 changed files with 9 additions and 16 deletions

View file

@ -1,8 +1,6 @@
import 'package:cake_wallet/entities/contact_base.dart';
import 'package:cake_wallet/routes.dart';
import 'package:cake_wallet/src/screens/dashboard/desktop_dashboard_page.dart';
import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
import 'package:cake_wallet/utils/responsive_layout_util.dart';
import 'package:cake_wallet/utils/show_bar.dart';
import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:cake_wallet/utils/payment_request.dart';
@ -432,11 +430,9 @@ class ExchangeCardState extends State<ExchangeCard> {
padding: EdgeInsets.only(top: 0),
child: InkWell(
onTap: () async {
final navigatorState = ResponsiveLayoutUtil.instance.isMobile(context)
? Navigator.of(context, rootNavigator: true)
: DesktopDashboardPage.desktopKey.currentState!;
final contact = await navigatorState.pushNamed(Routes
.pickerAddressBook);
final contact =
await Navigator.of(context)
.pushNamed(Routes.pickerAddressBook);
if (contact is ContactBase &&
contact.address != null) {

View file

@ -6,6 +6,7 @@ import 'package:cake_wallet/src/widgets/keyboard_done_button.dart';
import 'package:cake_wallet/src/widgets/primary_button.dart';
import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
import 'package:cake_wallet/themes/theme_base.dart';
import 'package:cake_wallet/utils/responsive_layout_util.dart';
import 'package:cake_wallet/view_model/ionia/ionia_buy_card_view_model.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
@ -44,6 +45,7 @@ class IoniaBuyGiftCardPage extends BasePage {
@override
Widget body(BuildContext context) {
final _width = MediaQuery.of(context).size.width;
final merchant = ioniaBuyCardViewModel.ioniaMerchant;
return KeyboardActions(
disableScroll: true,
@ -100,9 +102,8 @@ class IoniaBuyGiftCardPage extends BasePage {
prefixIcon: Padding(
padding: EdgeInsets.only(
top: 5.0,
left: 150,
),
child: Text(
left: ResponsiveLayoutUtil.kDesktopMaxWidthConstraint) / 3,
child: Text(
'USD: ',
style: TextStyle(
color: Colors.white,

View file

@ -1,5 +1,3 @@
import 'package:cake_wallet/src/screens/dashboard/desktop_dashboard_page.dart';
import 'package:cake_wallet/utils/responsive_layout_util.dart';
import 'package:flutter/services.dart';
import 'package:flutter/material.dart';
import 'package:cake_wallet/routes.dart';
@ -211,10 +209,8 @@ class AddressTextField extends StatelessWidget {
}
Future<void> _presetAddressBookPicker(BuildContext context) async {
final navigatorState = ResponsiveLayoutUtil.instance.isMobile(context) ? Navigator.of(context, rootNavigator: true)
: DesktopDashboardPage.desktopKey.currentState!;
final contact = await navigatorState.pushNamed(Routes.pickerAddressBook,arguments: selectedCurrency);
final contact = await Navigator.of(context)
.pushNamed(Routes.pickerAddressBook,arguments: selectedCurrency);
if (contact is ContactBase && contact.address != null) {
controller?.text = contact.address;