Dashboard desktop view (#737)

* Add build scripts for macOS. Add macos for cw_monero plugin. Add macos proj to the application.

* - Update Flutter secure storage to work with macos
- Enable uni links only on Mobile
- Update devcelocale to work with macos

* Add network access to mac

* Change Dashboard view on desktop size screens

* Add on Tap to desktop_action_button.dart
Remove unused functions

* Fix arch match for monero lib for darwin x86_64 -> x86-64

* Add Bundle ID in entitlements files through app config script

* Update deployment target to 10.13

* Revert back to Cake fork for secure storage

* Revert back to Cake fork for secure storage

* Revert mac os version

* Revert mac os version

* Add platform channel specific code for mac os

* Add desktop sidebar

* [skip ci] Add desktop sidebar

* [skip ci] Add desktop sidebar

* - Remove legacy migration from macos
- Remove wake lock native code and just use the ready made package

* Remove wake lock native code and just use the ready made package

* Remove unstoppable domain from macos since it's not supported

* Temporarily fetch unstoppable domains only on mobile

* refactor desktop settings sidebar

* Ignore increasing brightness for non-mobile platforms

* Add Wallet selection dropdown to dashboard desktop view

* Generate MacOS icons

* localize settings

* fix dashboard sidebar and responsive utils

* Change Mac os app name and bundle id

* Fix exchange page as fullScreenDialog

* Remove constants

* - Refactor onRamper to have a single point of modification
- Enlarge initial app size
- update Flutter and Packages

* Add pubspec.lock and Podfile.lock to gitignore

* Remove Podfile.lock from cache

* Fix bug on sidebar reset

* Fix issues from code review

* [skip ci] reformat desktop dashboard

* [skip ci] reformat desktop dashboard

* Revert removing .lock files

* Revert changes in .gitignore

* [skip ci] remove .project changes

* [skip ci] remove .project changes

* Separate Dashboard desktop view from mobile view

* constraint images and pincoded box

* Remove drawer from mac os

* - Listen to keyboard events in PIN screen
- Fix PIN buttons style

* Fix desktop nav bar UI

* Add Marketplace to dashboard view

* Update trailing icon to open transaction page

* Update widget contraints

* Add empty trailing to center page title on desktop

* Refresh desktop dashboard actions on wallet change

* Change ionia welcome page animation

* Fix Constrained width screens UI

* Refactor sidebar state management

* remove empty line

* Add max width constrain to Welcome page

* Change Exchange page UI depending on platform

* - Change design/paddings for Send page on desktop view
- Make AddTemplateButton instead of having it duplicated in send/exchange

* Fix Desktop dashboard actions background color

* Constrain primary Buttons width

* Make side menu items toggle back to dashboard

* Add padding to support page

* Add width constraints to desktop dashboard

* Fix UI issues, paddings and alignments

* Rename misleading variable
Change initial mac window size

* Fix wallet create in settings

* remove unnecessary code

* remove unnecessary code

* Remove duplicated constrains

* - Use close icon on main screens
- Minor UI fixes

* fix pageview controller reset index

* Add create and restore wallet options to dropdown menu

* Fix desktop background color and address book view issues

* Fix input field

* Add onFieldSubmitted to allow "enter" button interaction

* Fix issue from code review

* Fix Popup width constraint and add focus orders

* Fix variable name

* Fix issues from code review

* refactor dropdown items

* Fix alignment in create and restore wallet screens

* Fix dropdown change state bug

Hide scanner for desktop

* remove space

* override navbar with desktopnavbar

* Remove autofocus

* remove unused code

* Fix ionia input field alignment

* Replace removed code

* Add app lock feature on mac

* Add assertion to avoid null

* Add Nano currency image

* Enable adding contact from send screen

* Fix UI issues
Add missing translation

* pop only PIN screen after successful auth

* Add back wallet settings page to desktop settings actions

* Fix Navigation animation for settings screens

* Fixate MobX version to fix restore issue

* CW-324 Refresh current settings page if wallet changed (#811)

* Fix refresh current settings page if wallet changed

* Fix refresh current settings page if wallet changed

* Refresh Wallet Seeds/Keys List upon wallet change

---------

Co-authored-by: OmarHatem <omarh.ismail1@gmail.com>

* Remove navigation workaround for duplicate key, and fix the issue by handling creation/disposing of global key (#840)

* Cw 323 add wallet list to settings on mac (#843)

* Remove navigation workaround for duplicate key, and fix the issue by handling creation/disposing of global key

* - Register Wallet List as singleton in Desktop to be modify the same instance from settings and dropdown
- General Fixes and Enhancements

* Fix Changing/Restoring wallet from settings

* Fix Create wallet not showing seeds screens if launched from settings

* Add max width constraint for Alerts

* - Add Desktop API keys
- Fix Change back up password issue
- Fix Popup width

* Sync Mac with latest main updates

* Swap Transactions icon with lock icon

* Save backup file locally on desktop

* Sync with latest main updates

* Fix Navigation issues with anonpay

* Update macos build version

* Remove deprecated custom wake lock code for Android

* Remove Legacy CryptoSwift package from MacOS

* - Refactor Payfura page code
- Add OnRamper new configs to onramper_buy_provider.dart
- Fix Conflicts with main

* Updated device locale package

* Update android tools

* Revert changes and update only gradle version

* Downgrade android tools version

* Update gradle version

* Update package/gradle/plugin version

* - Fixate device locale version
- Downgrade gradle version

* Update kotlin version

* Update gradle version

* Trial for a custom fork from devicelocale

* Fixate shared preferences package version

* Revert gradle version

* Revert kotlin version

* Downgrade gradle version

* Downgrade gradle version

* Repair cache and clean before build

* Fixate flutter version

* update google services version

* revert google services version

* Force shared pref android version

* Override shared prefs android package version

* Override shared prefs android package [skip ci]

---------

Co-authored-by: M <m@cakewallet.com>
Co-authored-by: Godwin Asuquo <godilite@gmail.com>
Co-authored-by: Godwin Asuquo <41484542+godilite@users.noreply.github.com>
This commit is contained in:
Omar Hatem
2023-04-14 06:39:08 +02:00
committed by GitHub
co-authored by M Godwin Asuquo Godwin Asuquo
parent 5c4fd78951
commit c5477e4f9e
231 changed files with 9946 additions and 2653 deletions
+52
View File
@@ -0,0 +1,52 @@
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/utils/responsive_layout_util.dart';
import 'package:dotted_border/dotted_border.dart';
import 'package:flutter/material.dart';
class AddTemplateButton extends StatelessWidget {
final Function() onTap;
final int currentTemplatesLength;
const AddTemplateButton({Key? key, required this.onTap, required this.currentTemplatesLength})
: super(key: key);
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: onTap,
child: Container(
padding: EdgeInsets.only(left: 1, right: 10),
child: DottedBorder(
borderType: BorderType.RRect,
dashPattern: [6, 4],
color: Theme.of(context).primaryTextTheme.headline3!.decorationColor!,
strokeWidth: 2,
radius: Radius.circular(20),
child: Container(
height: 34,
padding: EdgeInsets.symmetric(
horizontal: ResponsiveLayoutUtil.instance.isMobile(context) ? 10 : 30),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(20)),
color: Colors.transparent,
),
child: currentTemplatesLength >= 1
? Icon(
Icons.add,
color: Theme.of(context).primaryTextTheme.headline2!.color!,
)
: Text(
S.of(context).new_template,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
color: Theme.of(context).primaryTextTheme.headline2!.color!,
),
),
),
),
),
);
}
}
+16 -17
View File
@@ -1,3 +1,6 @@
import 'dart:io';
import 'package:cake_wallet/utils/device_info.dart';
import 'package:flutter/services.dart';
import 'package:flutter/material.dart';
import 'package:cake_wallet/routes.dart';
@@ -65,7 +68,7 @@ class AddressTextField extends StatelessWidget {
style: textStyle ??
TextStyle(
fontSize: 16,
color: Theme.of(context).primaryTextTheme!.headline6!.color!),
color: Theme.of(context).primaryTextTheme.headline6!.color!),
decoration: InputDecoration(
suffixIcon: SizedBox(
width: prefixIconWidth * options.length +
@@ -102,7 +105,8 @@ class AddressTextField extends StatelessWidget {
width: prefixIconWidth * options.length +
(spaceBetweenPrefixIcons * options.length),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment: DeviceInfo.instance.isMobile
? MainAxisAlignment.spaceBetween : MainAxisAlignment.end,
children: [
SizedBox(width: 5),
if (this.options.contains(AddressTextFieldOption.paste)) ...[
@@ -117,8 +121,7 @@ class AddressTextField extends StatelessWidget {
decoration: BoxDecoration(
color: buttonColor ??
Theme.of(context)
.accentTextTheme!
.headline6!
.accentTextTheme.headline6!
.color!,
borderRadius:
BorderRadius.all(Radius.circular(6))),
@@ -126,13 +129,13 @@ class AddressTextField extends StatelessWidget {
'assets/images/paste_ios.png',
color: iconColor ??
Theme.of(context)
.primaryTextTheme!
.headline4!
.primaryTextTheme.headline4!
.decorationColor!,
)),
)),
],
if (this.options.contains(AddressTextFieldOption.qrCode)) ...[
if (this.options.contains(AddressTextFieldOption.qrCode) && DeviceInfo.instance.isMobile)
...[
Container(
width: prefixIconWidth,
height: prefixIconHeight,
@@ -144,8 +147,7 @@ class AddressTextField extends StatelessWidget {
decoration: BoxDecoration(
color: buttonColor ??
Theme.of(context)
.accentTextTheme!
.headline6!
.accentTextTheme.headline6!
.color!,
borderRadius:
BorderRadius.all(Radius.circular(6))),
@@ -153,12 +155,11 @@ class AddressTextField extends StatelessWidget {
'assets/images/qr_code_icon.png',
color: iconColor ??
Theme.of(context)
.primaryTextTheme!
.headline4!
.primaryTextTheme.headline4!
.decorationColor!,
)),
))
],
] else SizedBox(width: 5),
if (this
.options
.contains(AddressTextFieldOption.addressBook)) ...[
@@ -173,8 +174,7 @@ class AddressTextField extends StatelessWidget {
decoration: BoxDecoration(
color: buttonColor ??
Theme.of(context)
.accentTextTheme!
.headline6!
.accentTextTheme.headline6!
.color!,
borderRadius:
BorderRadius.all(Radius.circular(6))),
@@ -182,8 +182,7 @@ class AddressTextField extends StatelessWidget {
'assets/images/open_book.png',
color: iconColor ??
Theme.of(context)
.primaryTextTheme!
.headline4!
.primaryTextTheme.headline4!
.decorationColor!,
)),
))
@@ -211,7 +210,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) {
+8 -3
View File
@@ -1,5 +1,5 @@
import 'dart:ui';
import 'package:flutter/cupertino.dart';
import 'package:cake_wallet/utils/responsive_layout_util.dart';
import 'package:flutter/material.dart';
import 'package:cake_wallet/palette.dart';
@@ -21,10 +21,15 @@ class AlertBackground extends StatelessWidget {
filter: ImageFilter.blur(sigmaX: 3.0, sigmaY: 3.0),
child: Container(
decoration: BoxDecoration(color: PaletteDark.darkNightBlue.withOpacity(0.75)),
child: child,
child: Center(
child: Container(
width: ResponsiveLayoutUtil.kDesktopMaxWidthConstraint,
child: child,
),
),
),
),
),
);
}
}
}
+1 -4
View File
@@ -13,9 +13,7 @@ class AlertCloseButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Positioned(
bottom: 60,
child: GestureDetector(
return GestureDetector(
onTap: () => Navigator.of(context).pop(),
child: Container(
height: 42,
@@ -28,7 +26,6 @@ class AlertCloseButton extends StatelessWidget {
child: image ?? closeButton,
),
),
)
);
}
}
+7 -4
View File
@@ -27,6 +27,7 @@ class BaseTextFormField extends StatelessWidget {
this.maxLength,
this.focusNode,
this.initialValue,
this.onSubmit,
this.borderWidth = 1.0});
final TextEditingController? controller;
@@ -54,6 +55,7 @@ class BaseTextFormField extends StatelessWidget {
final bool? enableInteractiveSelection;
final String? initialValue;
final double borderWidth;
final void Function(String)? onSubmit;
@override
Widget build(BuildContext context) {
@@ -71,11 +73,12 @@ class BaseTextFormField extends StatelessWidget {
inputFormatters: inputFormatters,
enabled: enabled,
maxLength: maxLength,
onFieldSubmitted: onSubmit,
style: textStyle ??
TextStyle(
fontSize: 16.0,
color:
textColor ?? Theme.of(context).primaryTextTheme!.headline6!.color!),
textColor ?? Theme.of(context).primaryTextTheme.headline6!.color!),
decoration: InputDecoration(
prefix: prefix,
prefixIcon: prefixIcon,
@@ -89,17 +92,17 @@ class BaseTextFormField extends StatelessWidget {
focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(
color: borderColor ??
Theme.of(context).primaryTextTheme!.headline6!.backgroundColor!,
Theme.of(context).primaryTextTheme.headline6!.backgroundColor!,
width: borderWidth)),
disabledBorder: UnderlineInputBorder(
borderSide: BorderSide(
color: borderColor ??
Theme.of(context).primaryTextTheme!.headline6!.backgroundColor!,
Theme.of(context).primaryTextTheme.headline6!.backgroundColor!,
width: borderWidth)),
enabledBorder: UnderlineInputBorder(
borderSide: BorderSide(
color: borderColor ??
Theme.of(context).primaryTextTheme!.headline6!.backgroundColor!,
Theme.of(context).primaryTextTheme.headline6!.backgroundColor!,
width: borderWidth))),
validator: validator,
);
+50 -50
View File
@@ -1,4 +1,5 @@
import 'package:cake_wallet/palette.dart';
import 'package:cake_wallet/utils/responsive_layout_util.dart';
import 'package:flutter/material.dart';
import 'package:cake_wallet/src/widgets/alert_background.dart';
import 'package:cake_wallet/src/widgets/alert_close_button.dart';
@@ -32,63 +33,62 @@ class CheckBoxPickerState extends State<CheckBoxPicker> {
@override
Widget build(BuildContext context) {
return AlertBackground(
child: Stack(
alignment: Alignment.center,
children: <Widget>[
Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
if (widget.title.isNotEmpty)
Container(
padding: EdgeInsets.symmetric(horizontal: 24),
child: Text(
widget.title,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 18,
fontFamily: 'Lato',
fontWeight: FontWeight.bold,
decoration: TextDecoration.none,
color: Colors.white,
child: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
if (widget.title.isNotEmpty)
Container(
padding: EdgeInsets.symmetric(horizontal: 24),
child: Text(
widget.title,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 18,
fontFamily: 'Lato',
fontWeight: FontWeight.bold,
decoration: TextDecoration.none,
color: Colors.white,
),
),
),
),
Padding(
padding: EdgeInsets.only(left: 24, right: 24, top: 24),
child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(30)),
child: Container(
color: Theme.of(context).accentTextTheme.headline6!.color!,
child: ConstrainedBox(
constraints: BoxConstraints(
maxHeight: MediaQuery.of(context).size.height * 0.65,
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Flexible(
child: Stack(
alignment: Alignment.center,
children: <Widget>[
(items.length) > 3
? Scrollbar(
controller: controller,
child: itemsList(),
)
: itemsList(),
],
Padding(
padding: EdgeInsets.only(left: 24, right: 24, top: 24),
child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(30)),
child: Container(
color: Theme.of(context).accentTextTheme.headline6!.color!,
child: ConstrainedBox(
constraints: BoxConstraints(
maxHeight: MediaQuery.of(context).size.height * 0.65,
maxWidth: ResponsiveLayoutUtil.kPopupWidth,
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Flexible(
child: Stack(
alignment: Alignment.center,
children: <Widget>[
items.length > 3
? Scrollbar(
controller: controller,
child: itemsList(),
)
: itemsList(),
],
),
),
),
],
],
),
),
),
),
),
)
],
),
AlertCloseButton(),
],
SizedBox(height: ResponsiveLayoutUtil.kPopupSpaceHeight),
AlertCloseButton(),
],
),
),
);
}
+3
View File
@@ -17,6 +17,9 @@ class MarketPlaceItem extends StatelessWidget {
Widget build(BuildContext context) {
return InkWell(
onTap: onTap,
hoverColor: Colors.transparent,
splashColor: Colors.transparent,
highlightColor: Colors.transparent,
child: Stack(
children: [
Container(
+16 -21
View File
@@ -1,13 +1,7 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class NavBar extends StatelessWidget implements ObstructingPreferredSizeWidget {
factory NavBar(
{Widget? leading,
Widget? middle,
Widget? trailing,
Color? backgroundColor}) {
factory NavBar({Widget? leading, Widget? middle, Widget? trailing, Color? backgroundColor}) {
return NavBar._internal(
leading: leading,
middle: middle,
@@ -17,11 +11,7 @@ class NavBar extends StatelessWidget implements ObstructingPreferredSizeWidget {
}
factory NavBar.withShadow(
{Widget? leading,
Widget? middle,
Widget? trailing,
Color? backgroundColor}) {
{Widget? leading, Widget? middle, Widget? trailing, Color? backgroundColor}) {
return NavBar._internal(
leading: leading,
middle: middle,
@@ -29,13 +19,15 @@ class NavBar extends StatelessWidget implements ObstructingPreferredSizeWidget {
height: 80,
backgroundColor: backgroundColor,
decoration: BoxDecoration(
color: backgroundColor,
boxShadow: [
BoxShadow(
color: Color.fromRGBO(132, 141, 198, 0.11),
blurRadius: 8,
offset: Offset(0, 2))
]),
color: backgroundColor,
boxShadow: [
BoxShadow(
color: Color.fromRGBO(132, 141, 198, 0.11),
blurRadius: 8,
offset: Offset(0, 2),
),
],
),
);
}
@@ -59,14 +51,17 @@ class NavBar extends StatelessWidget implements ObstructingPreferredSizeWidget {
@override
Widget build(BuildContext context) {
if (leading == null && middle == null && trailing == null) {
return const SizedBox();
}
final pad = height - _originalHeight;
final paddingTop = pad / 2;
final _paddingBottom = (pad / 2);
return Container(
decoration: decoration ?? BoxDecoration(color: backgroundColor),
padding:
EdgeInsetsDirectional.only(bottom: _paddingBottom, top: paddingTop),
padding: EdgeInsetsDirectional.only(bottom: _paddingBottom, top: paddingTop),
child: CupertinoNavigationBar(
leading: leading,
automaticallyImplyLeading: false,
+91 -92
View File
@@ -1,5 +1,6 @@
// ignore_for_file: deprecated_member_use
import 'package:cake_wallet/utils/responsive_layout_util.dart';
import 'package:flutter/material.dart';
import 'package:cake_wallet/src/widgets/alert_background.dart';
import 'package:cake_wallet/src/widgets/alert_close_button.dart';
@@ -70,108 +71,106 @@ class _PickerState<Item> extends State<Picker<Item>> {
@override
Widget build(BuildContext context) {
return AlertBackground(
child: Stack(
alignment: Alignment.center,
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
if (widget.title?.isNotEmpty ?? false)
Container(
padding: EdgeInsets.symmetric(horizontal: 24),
child: Text(
widget.title!,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 18,
fontFamily: 'Lato',
fontWeight: FontWeight.bold,
decoration: TextDecoration.none,
color: Colors.white,
),
),
if (widget.title?.isNotEmpty ?? false)
Container(
padding: EdgeInsets.symmetric(horizontal: 24),
child: Text(
widget.title!,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 18,
fontFamily: 'Lato',
fontWeight: FontWeight.bold,
decoration: TextDecoration.none,
color: Colors.white,
),
Padding(
padding: EdgeInsets.only(left: 24, right: 24, top: 24),
child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(30)),
child: Container(
color: Theme.of(context).accentTextTheme.headline6!.color!,
child: ConstrainedBox(
constraints: BoxConstraints(
maxHeight: MediaQuery.of(context).size.height * 0.65,
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
if (widget.hintText != null)
Padding(
padding: const EdgeInsets.all(16),
child: TextFormField(
controller: searchController,
style: TextStyle(color: Theme.of(context).primaryTextTheme.headline6!.color!),
decoration: InputDecoration(
hintText: widget.hintText,
prefixIcon: Image.asset("assets/images/search_icon.png"),
filled: true,
fillColor: Theme.of(context).accentTextTheme.headline3!.color!,
alignLabelWithHint: false,
contentPadding: const EdgeInsets.symmetric(vertical: 4, horizontal: 16),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(14),
borderSide: const BorderSide(
color: Colors.transparent,
)),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(14),
borderSide: const BorderSide(
color: Colors.transparent,
)),
),
),
),
Padding(
padding: EdgeInsets.only(left: 24, right: 24, top: 24),
child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(30)),
child: Container(
color: Theme.of(context).accentTextTheme.headline6!.color!,
child: ConstrainedBox(
constraints: BoxConstraints(
maxHeight: MediaQuery.of(context).size.height * 0.65,
maxWidth: ResponsiveLayoutUtil.kPopupWidth,
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
if (widget.hintText != null)
Padding(
padding: const EdgeInsets.all(16),
child: TextFormField(
controller: searchController,
style: TextStyle(color: Theme.of(context).primaryTextTheme.headline6!.color!),
decoration: InputDecoration(
hintText: widget.hintText,
prefixIcon: Image.asset("assets/images/search_icon.png"),
filled: true,
fillColor: Theme.of(context).accentTextTheme.headline3!.color!,
alignLabelWithHint: false,
contentPadding: const EdgeInsets.symmetric(vertical: 4, horizontal: 16),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(14),
borderSide: const BorderSide(
color: Colors.transparent,
)),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(14),
borderSide: const BorderSide(
color: Colors.transparent,
)),
),
),
Divider(
color: Theme.of(context).accentTextTheme.headline6!.backgroundColor!,
height: 1,
),
if (widget.selectedAtIndex != -1) buildSelectedItem(),
Flexible(
child: Stack(
alignment: Alignment.center,
children: <Widget>[
items.length > 3 ? Scrollbar(
controller: controller,
child: itemsList(),
) : itemsList(),
(widget.description?.isNotEmpty ?? false)
? Positioned(
bottom: 24,
left: 24,
right: 24,
child: Text(
widget.description!,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w500,
fontFamily: 'Lato',
decoration: TextDecoration.none,
color: Theme.of(context).primaryTextTheme.headline6!.color!,
),
Divider(
color: Theme.of(context).accentTextTheme.headline6!.backgroundColor!,
height: 1,
),
if (widget.selectedAtIndex != -1) buildSelectedItem(),
Flexible(
child: Stack(
alignment: Alignment.center,
children: <Widget>[
items.length > 3 ? Scrollbar(
controller: controller,
child: itemsList(),
) : itemsList(),
(widget.description?.isNotEmpty ?? false)
? Positioned(
bottom: 24,
left: 24,
right: 24,
child: Text(
widget.description!,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w500,
fontFamily: 'Lato',
decoration: TextDecoration.none,
color: Theme.of(context).primaryTextTheme.headline6!.color!,
),
)
: Offstage(),
],
),
),
)
: Offstage(),
],
),
],
),
),
),
],
),
),
)
],
),
),
),
SizedBox(height: ResponsiveLayoutUtil.kPopupSpaceHeight),
AlertCloseButton(),
],
),
+121 -108
View File
@@ -1,3 +1,4 @@
import 'package:cake_wallet/utils/responsive_layout_util.dart';
import 'package:dotted_border/dotted_border.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@@ -24,28 +25,31 @@ class PrimaryButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
final content = SizedBox(
width: double.infinity,
height: 52.0,
child: TextButton(
onPressed: isDisabled
? (onDisabledPressed != null ? onDisabledPressed : null) : onPressed,
style: ButtonStyle(backgroundColor: MaterialStateProperty.all(isDisabled ? color.withOpacity(0.5) : color),
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(26.0),
final content = ConstrainedBox(
constraints: BoxConstraints(maxWidth: ResponsiveLayoutUtil.kDesktopMaxWidthConstraint),
child: SizedBox(
width: double.infinity,
height: 52.0,
child: TextButton(
onPressed: isDisabled
? (onDisabledPressed != null ? onDisabledPressed : null) : onPressed,
style: ButtonStyle(backgroundColor: MaterialStateProperty.all(isDisabled ? color.withOpacity(0.5) : color),
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(26.0),
),
),
),
overlayColor: MaterialStateProperty.all(Colors.transparent)),
child: Text(text,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 15.0,
fontWeight: FontWeight.w600,
color: isDisabled
? textColor.withOpacity(0.5)
: textColor)),
));
overlayColor: MaterialStateProperty.all(Colors.transparent)),
child: Text(text,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 15.0,
fontWeight: FontWeight.w600,
color: isDisabled
? textColor.withOpacity(0.5)
: textColor)),
)),
);
return isDottedBorder
? DottedBorder(
@@ -77,29 +81,32 @@ class LoadingPrimaryButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return SizedBox(
width: double.infinity,
height: 52.0,
child: TextButton(
onPressed: (isLoading || isDisabled) ? null : onPressed,
style: ButtonStyle(backgroundColor: MaterialStateProperty.all(isDisabled ? color.withOpacity(0.5) : color),
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(26.0),
),
)),
child: isLoading
? CupertinoActivityIndicator(animating: true)
: Text(text,
style: TextStyle(
fontSize: 15.0,
fontWeight: FontWeight.w600,
color: isDisabled
? textColor.withOpacity(0.5)
: textColor
return ConstrainedBox(
constraints: BoxConstraints(maxWidth: ResponsiveLayoutUtil.kDesktopMaxWidthConstraint),
child: SizedBox(
width: double.infinity,
height: 52.0,
child: TextButton(
onPressed: (isLoading || isDisabled) ? null : onPressed,
style: ButtonStyle(backgroundColor: MaterialStateProperty.all(isDisabled ? color.withOpacity(0.5) : color),
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(26.0),
),
)),
));
child: isLoading
? CupertinoActivityIndicator(animating: true)
: Text(text,
style: TextStyle(
fontSize: 15.0,
fontWeight: FontWeight.w600,
color: isDisabled
? textColor.withOpacity(0.5)
: textColor
)),
)),
);
}
}
@@ -130,45 +137,48 @@ class PrimaryIconButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return SizedBox(
width: double.infinity,
height: 52.0,
child: TextButton(
onPressed: onPressed,
style: ButtonStyle(backgroundColor: MaterialStateProperty.all(color),
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(radius),
),
)),
child: Stack(
children: <Widget>[
Row(
mainAxisAlignment: mainAxisAlignment,
children: <Widget>[
Container(
width: 26.0,
height: 52.0,
decoration: BoxDecoration(
shape: BoxShape.circle, color: iconBackgroundColor),
child: Center(
child: Icon(iconData, color: iconColor, size: 22.0)
),
return ConstrainedBox(
constraints: BoxConstraints(maxWidth: ResponsiveLayoutUtil.kDesktopMaxWidthConstraint),
child: SizedBox(
width: double.infinity,
height: 52.0,
child: TextButton(
onPressed: onPressed,
style: ButtonStyle(backgroundColor: MaterialStateProperty.all(color),
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(radius),
),
],
),
Container(
height: 52.0,
child: Center(
child: Text(text,
style: TextStyle(
fontSize: 16.0,
color: textColor)),
)),
child: Stack(
children: <Widget>[
Row(
mainAxisAlignment: mainAxisAlignment,
children: <Widget>[
Container(
width: 26.0,
height: 52.0,
decoration: BoxDecoration(
shape: BoxShape.circle, color: iconBackgroundColor),
child: Center(
child: Icon(iconData, color: iconColor, size: 22.0)
),
),
],
),
)
],
),
));
Container(
height: 52.0,
child: Center(
child: Text(text,
style: TextStyle(
fontSize: 16.0,
color: textColor)),
),
)
],
),
)),
);
}
}
@@ -190,34 +200,37 @@ class PrimaryImageButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return SizedBox(
width: double.infinity,
height: 52.0,
child: TextButton(
onPressed: onPressed,
style: ButtonStyle(backgroundColor: MaterialStateProperty.all(color),
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(26.0),
),
)),
child:Center(
child: Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
image,
SizedBox(width: 15),
Text(
text,
style: TextStyle(
fontSize: 15,
fontWeight: FontWeight.w600,
color: textColor
return ConstrainedBox(
constraints: BoxConstraints(maxWidth: ResponsiveLayoutUtil.kDesktopMaxWidthConstraint),
child: SizedBox(
width: double.infinity,
height: 52.0,
child: TextButton(
onPressed: onPressed,
style: ButtonStyle(backgroundColor: MaterialStateProperty.all(color),
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(26.0),
),
)
],
),
)
));
)),
child:Center(
child: Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
image,
SizedBox(width: 15),
Text(
text,
style: TextStyle(
fontSize: 15,
fontWeight: FontWeight.w600,
color: textColor
),
)
],
),
)
)),
);
}
}
@@ -0,0 +1,81 @@
import 'package:cake_wallet/palette.dart';
import 'package:flutter/material.dart';
class SettingActionButton extends StatelessWidget {
final bool isLastTile;
final bool isSelected;
final bool isArrowVisible;
final bool selectionActive;
final VoidCallback onTap;
final String image;
final String title;
final double fromBottomEdge;
final double fromTopEdge;
final double tileHeight;
const SettingActionButton({
super.key,
this.isLastTile = false,
this.isSelected = false,
this.selectionActive = true,
this.isArrowVisible = false,
required this.onTap,
required this.image,
required this.title,
this.tileHeight = 60,
this.fromTopEdge = 50,
this.fromBottomEdge = 25,
});
@override
Widget build(BuildContext context) {
Color? color = isSelected
? Theme.of(context).textTheme.headline3!.color
: selectionActive
? Palette.darkBlue
: Theme.of(context).textTheme.headline3!.color;
return InkWell(
onTap: onTap,
hoverColor: Colors.transparent,
child: Container(
height: tileHeight,
padding: isLastTile
? EdgeInsets.only(
left: 24,
right: 24,
top: fromBottomEdge,
)
: EdgeInsets.only(left: 24, right: 24),
alignment: isLastTile ? Alignment.topLeft : null,
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Image.asset(
image,
height: 16,
width: 16,
color: Palette.darkBlue,
),
SizedBox(width: 16),
Expanded(
child: Text(
title,
style: TextStyle(
color: color,
fontSize: 16,
fontWeight: FontWeight.bold,
),
),
),
if (isArrowVisible)
Icon(
Icons.arrow_forward_ios,
color: color,
size: 16,
)
],
),
),
);
}
}
+109
View File
@@ -0,0 +1,109 @@
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/routes.dart';
import 'package:flutter/material.dart';
class SettingActions {
final String name;
final String image;
final void Function(BuildContext) onTap;
SettingActions._({
required this.name,
required this.image,
required this.onTap,
});
static List<SettingActions> all = [
connectionSettingAction,
walletSettingAction,
addressBookSettingAction,
securityBackupSettingAction,
privacySettingAction,
displaySettingAction,
otherSettingAction,
supportSettingAction,
];
static List<SettingActions> desktopSettings = [
connectionSettingAction,
walletSettingAction,
addressBookSettingAction,
securityBackupSettingAction,
privacySettingAction,
displaySettingAction,
otherSettingAction,
supportSettingAction,
];
static SettingActions connectionSettingAction = SettingActions._(
name: S.current.connection_sync,
image: 'assets/images/nodes_menu.png',
onTap: (BuildContext context) {
Navigator.pop(context);
Navigator.of(context).pushNamed(Routes.connectionSync);
},
);
static SettingActions walletSettingAction = SettingActions._(
name: S.current.wallets,
image: 'assets/images/wallet_menu.png',
onTap: (BuildContext context) {
Navigator.pop(context);
Navigator.of(context).pushNamed(Routes.walletList);
},
);
static SettingActions addressBookSettingAction = SettingActions._(
name: S.current.address_book_menu,
image: 'assets/images/open_book_menu.png',
onTap: (BuildContext context) {
Navigator.pop(context);
Navigator.of(context).pushNamed(Routes.addressBook);
},
);
static SettingActions securityBackupSettingAction = SettingActions._(
name: S.current.security_and_backup,
image: 'assets/images/key_menu.png',
onTap: (BuildContext context) {
Navigator.pop(context);
Navigator.of(context).pushNamed(Routes.securityBackupPage);
},
);
static SettingActions privacySettingAction = SettingActions._(
name: S.current.privacy,
image: 'assets/images/privacy_menu.png',
onTap: (BuildContext context) {
Navigator.pop(context);
Navigator.of(context).pushNamed(Routes.privacyPage);
},
);
static SettingActions displaySettingAction = SettingActions._(
name: S.current.display_settings,
image: 'assets/images/eye_menu.png',
onTap: (BuildContext context) {
Navigator.pop(context);
Navigator.of(context).pushNamed(Routes.displaySettingsPage);
},
);
static SettingActions otherSettingAction = SettingActions._(
name: S.current.other_settings,
image: 'assets/images/settings_menu.png',
onTap: (BuildContext context) {
Navigator.pop(context);
Navigator.of(context).pushNamed(Routes.otherSettingsPage);
},
);
static SettingActions supportSettingAction = SettingActions._(
name: S.current.settings_support,
image: 'assets/images/question_mark.png',
onTap: (BuildContext context) {
Navigator.pop(context);
Navigator.of(context).pushNamed(Routes.support);
},
);
}