Merge pull request #791 from cake-tech/fix-desktop-colors-addressbook

Fix desktop background color and address book view issues
This commit is contained in:
Omar Hatem 2023-02-23 21:56:50 +02:00 committed by GitHub
commit f8acc1c007
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 65 additions and 54 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

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

View file

@ -431,10 +431,8 @@ class ExchangeCardState extends State<ExchangeCard> {
child: InkWell(
onTap: () async {
final contact =
await Navigator.of(context,
rootNavigator: true)
.pushNamed(Routes
.pickerAddressBook);
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,7 +45,6 @@ class IoniaBuyGiftCardPage extends BasePage {
@override
Widget body(BuildContext context) {
final _width = MediaQuery.of(context).size.width;
final merchant = ioniaBuyCardViewModel.ioniaMerchant;
return KeyboardActions(
disableScroll: true,
@ -67,7 +67,10 @@ class IoniaBuyGiftCardPage extends BasePage {
Container(
padding: EdgeInsets.symmetric(horizontal: 25),
decoration: BoxDecoration(
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(24), bottomRight: Radius.circular(24)),
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(24),
bottomRight: Radius.circular(24),
),
gradient: LinearGradient(colors: [
Theme.of(context).primaryTextTheme!.subtitle1!.color!,
Theme.of(context).primaryTextTheme!.subtitle1!.decorationColor!,
@ -75,35 +78,28 @@ class IoniaBuyGiftCardPage extends BasePage {
),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(height: 150),
BaseTextFormField(
controller: _amountController,
focusNode: _amountFieldFocus,
keyboardType: TextInputType.numberWithOptions(signed: false, decimal: true),
inputFormatters: [
FilteringTextInputFormatter.deny(RegExp('[\-|\ ]')),
FilteringTextInputFormatter.allow(RegExp(r'^\d+(\.|\,)?\d{0,2}'))],
hintText: '1000',
placeholderTextStyle: TextStyle(
color: Theme.of(context).primaryTextTheme!.headline5!.color!,
fontWeight: FontWeight.w600,
fontSize: 36,
),
borderColor: Theme.of(context).primaryTextTheme!.headline5!.color!,
textColor: Colors.white,
textStyle: TextStyle(
color: Colors.white,
fontSize: 36,
),
prefixIcon: Padding(
padding: EdgeInsets.only(
top: 5.0,
left: _width / 4,
SizedBox(
width: 200,
child: BaseTextFormField(
controller: _amountController,
focusNode: _amountFieldFocus,
keyboardType: TextInputType.numberWithOptions(signed: false, decimal: true),
inputFormatters: [
FilteringTextInputFormatter.deny(RegExp('[\-|\ ]')),
FilteringTextInputFormatter.allow(
RegExp(r'^\d+(\.|\,)?\d{0,2}'),
),
],
hintText: '1000',
placeholderTextStyle: TextStyle(
color: Theme.of(context).primaryTextTheme.headline5!.color!,
fontWeight: FontWeight.w600,
fontSize: 36,
),
child: Text(
prefixIcon: Text(
'USD: ',
style: TextStyle(
color: Colors.white,
@ -111,8 +107,17 @@ class IoniaBuyGiftCardPage extends BasePage {
fontSize: 36,
),
),
textColor: Colors.white,
textStyle: TextStyle(
color: Colors.white,
fontSize: 36,
),
),
),
Divider(
color: Theme.of(context).primaryTextTheme.headline5!.color!,
height: 1,
),
SizedBox(height: 8),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -140,7 +145,11 @@ class IoniaBuyGiftCardPage extends BasePage {
padding: const EdgeInsets.all(24.0),
child: CardItem(
title: merchant.legalName,
backgroundColor: Theme.of(context).accentTextTheme!.headline1!.backgroundColor!.withOpacity(0.1),
backgroundColor: Theme.of(context)
.accentTextTheme!
.headline1!
.backgroundColor!
.withOpacity(0.1),
discount: merchant.discount,
titleColor: Theme.of(context).accentTextTheme!.headline1!.backgroundColor!,
subtitleColor: Theme.of(context).hintColor,

View file

@ -208,7 +208,7 @@ class AddressTextField extends StatelessWidget {
}
Future<void> _presetAddressBookPicker(BuildContext context) async {
final contact = await Navigator.of(context, rootNavigator: true)
final contact = await Navigator.of(context)
.pushNamed(Routes.pickerAddressBook,arguments: selectedCurrency);
if (contact is ContactBase && contact.address != null) {