Fix desktop background color and address book view issues

This commit is contained in:
Godwin Asuquo 2023-02-17 18:19:26 +02:00
parent 1b89228893
commit 52468e1331
4 changed files with 37 additions and 27 deletions

View file

@ -32,29 +32,32 @@ class DesktopDashboardPage extends StatelessWidget {
Widget build(BuildContext context) {
_setEffects(context);
return Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 400,
child: balancePage,
),
Flexible(
child: ConstrainedBox(
constraints: BoxConstraints(maxWidth: 500),
child: Navigator(
key: desktopKey,
initialRoute: Routes.desktop_actions,
onGenerateRoute: (settings) => Router.createRoute(settings),
onGenerateInitialRoutes: (NavigatorState navigator, String initialRouteName) {
return [
navigator.widget.onGenerateRoute!(RouteSettings(name: initialRouteName))!
];
},
return Container(
color: Theme.of(context).backgroundColor,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 400,
child: balancePage,
),
Flexible(
child: ConstrainedBox(
constraints: BoxConstraints(maxWidth: 500),
child: Navigator(
key: desktopKey,
initialRoute: Routes.desktop_actions,
onGenerateRoute: (settings) => Router.createRoute(settings),
onGenerateInitialRoutes: (NavigatorState navigator, String initialRouteName) {
return [
navigator.widget.onGenerateRoute!(RouteSettings(name: initialRouteName))!
];
},
),
),
),
),
],
],
),
);
}

View file

@ -160,6 +160,7 @@ class DesktopSidebarWrapper extends BasePage {
children: [
child,
Container(
color: Theme.of(context).backgroundColor,
padding: EdgeInsets.all(20),
child: Navigator(
initialRoute: Routes.support,

View file

@ -1,6 +1,8 @@
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';
@ -430,10 +432,10 @@ class ExchangeCardState extends State<ExchangeCard> {
padding: EdgeInsets.only(top: 0),
child: InkWell(
onTap: () async {
final contact =
await Navigator.of(context,
rootNavigator: true)
.pushNamed(Routes
final navigatorState = ResponsiveLayoutUtil.instance.isMobile(context)
? Navigator.of(context, rootNavigator: true)
: DesktopDashboardPage.desktopKey.currentState!;
final contact = await navigatorState.pushNamed(Routes
.pickerAddressBook);
if (contact is ContactBase &&

View file

@ -1,3 +1,5 @@
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';
@ -209,8 +211,10 @@ class AddressTextField extends StatelessWidget {
}
Future<void> _presetAddressBookPicker(BuildContext context) async {
final contact = await Navigator.of(context, rootNavigator: true)
.pushNamed(Routes.pickerAddressBook,arguments: selectedCurrency);
final navigatorState = ResponsiveLayoutUtil.instance.isMobile(context) ? Navigator.of(context, rootNavigator: true)
: DesktopDashboardPage.desktopKey.currentState!;
final contact = await navigatorState.pushNamed(Routes.pickerAddressBook,arguments: selectedCurrency);
if (contact is ContactBase && contact.address != null) {
controller?.text = contact.address;