UI enhancements (#1895)

* UI enhancements [skip ci]

* Fix spacing for swap screen

* Cleanup and update backup page [skip ci]

* Fix address book page

* Update address book page

* Update standard lists

* Update hamburger menu

* Make toggle rows tappable

* Make more components TextButtons

* Make button dock float

* Fix shadows

* Update [skip ci]

* Update all cards with shadow and proper alignment

* Fix component positioning and scaling

* Cleanup, update strings, rename strings

* Fix spacing on Swap and Send pages [skip ci]

* Remove Wallets action button [skip ci]

* Move Sign/Verify into settings [skip ci]

* Cleanup & fix merge conflicts (pls) [skip ci]

* Fix formatting [skip ci]

* Move bottom bar to navigation_dock.dart [skip ci]

* Fix card spacing

* Conflict resolution [skip ci]

* Conflict resolution [skip ci]

* Update shadow theming

* Update menu

* Temporarily remove shadow

* Temporarily remove shadows again

* Update setting_action_button.dart

---------

Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
This commit is contained in:
tuxsudo
2025-02-12 14:35:59 +03:00
committed by GitHub
co-authored by Omar Hatem
parent ad20d2c3a9
commit 7db23599fa
62 changed files with 1184 additions and 678 deletions
+27 -18
View File
@@ -26,12 +26,6 @@ class BackupPage extends BasePage {
@override
String get title => S.current.backup;
@override
Widget trailing(BuildContext context) => TrailButton(
caption: S.of(context).change_password,
onPressed: () => Navigator.of(context).pushNamed(Routes.editBackupPassword),
textColor: Palette.blueCraiola);
@override
Widget body(BuildContext context) {
return Stack(
@@ -53,7 +47,9 @@ class BackupPage extends BasePage {
builder: (_) => GestureDetector(
onTap: () {
ClipboardUtil.setSensitiveDataToClipboard(
ClipboardData(text: backupViewModelBase.backupPassword));
ClipboardData(
text: backupViewModelBase
.backupPassword));
showBar<void>(
context,
S.of(context).transaction_details_copied(
@@ -74,15 +70,25 @@ class BackupPage extends BasePage {
))
]))),
Positioned(
child: Observer(
builder: (_) => LoadingPrimaryButton(
isLoading: backupViewModelBase.state is IsExecutingState,
onPressed: () => onExportBackup(context),
text: S.of(context).export_backup,
color: Theme.of(context).primaryColor,
child: Column(children: [
PrimaryButton(
onPressed: () =>
Navigator.of(context).pushNamed(Routes.editBackupPassword),
text: S.of(context).change_password,
color: Theme.of(context).cardColor,
textColor: Colors.white,
),
),
SizedBox(height: 10),
Observer(
builder: (_) => LoadingPrimaryButton(
isLoading: backupViewModelBase.state is IsExecutingState,
onPressed: () => onExportBackup(context),
text: S.of(context).export_backup,
color: Theme.of(context).primaryColor,
textColor: Colors.white,
),
),
]),
bottom: 24,
left: 24,
right: 24,
@@ -130,7 +136,8 @@ class BackupPage extends BasePage {
rightButtonText: S.of(context).save_to_downloads,
leftButtonText: S.of(context).share,
actionRightButton: () async {
await backupViewModelBase.saveToDownload(backup.name, backup.content);
await backupViewModelBase.saveToDownload(
backup.name, backup.content);
Navigator.of(dialogContext).pop();
},
actionLeftButton: () async {
@@ -142,13 +149,15 @@ class BackupPage extends BasePage {
Future<void> share(BackupExportFile backup, BuildContext context) async {
final path = await backupViewModelBase.saveBackupFileLocally(backup);
await ShareUtil.shareFile(filePath: path, fileName: backup.name, context: context);
await ShareUtil.shareFile(
filePath: path, fileName: backup.name, context: context);
await backupViewModelBase.removeBackupFileLocally(backup);
}
Future<void> _saveFile(BackupExportFile backup) async {
String? outputFile = await FilePicker.platform
.saveFile(dialogTitle: 'Save Your File to desired location', fileName: backup.name);
String? outputFile = await FilePicker.platform.saveFile(
dialogTitle: 'Save Your File to desired location',
fileName: backup.name);
try {
File returnedFile = File(outputFile!);
+28 -9
View File
@@ -110,10 +110,12 @@ class _ContactPageBodyState extends State<ContactPageBody> with SingleTickerProv
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.only(left: 24),
padding: const EdgeInsets.only(),
child: Column(
children: [
Align(
Padding(
padding: const EdgeInsets.only(left: 24, right: 24, bottom: 8),
child: Align(
alignment: Alignment.centerLeft,
child: TabBar(
controller: _tabController,
@@ -135,7 +137,7 @@ class _ContactPageBodyState extends State<ContactPageBody> with SingleTickerProv
indicatorColor: Theme.of(context).appBarTheme.titleTextStyle!.color,
indicatorPadding: EdgeInsets.zero,
labelPadding: EdgeInsets.only(right: 24),
tabAlignment: TabAlignment.center,
tabAlignment: TabAlignment.start,
dividerColor: Colors.transparent,
padding: EdgeInsets.zero,
tabs: [
@@ -144,6 +146,7 @@ class _ContactPageBodyState extends State<ContactPageBody> with SingleTickerProv
],
),
),
),
Expanded(
child: TabBarView(
controller: _tabController,
@@ -173,7 +176,7 @@ class _ContactPageBodyState extends State<ContactPageBody> with SingleTickerProv
itemCount: groupedContacts.length * 2,
itemBuilder: (context, index) {
if (index.isOdd) {
return StandardListSeparator();
return StandardListSeparator(height: 0);
} else {
final groupIndex = index ~/ 2;
final groupName = groupedContacts.keys.elementAt(groupIndex);
@@ -188,7 +191,9 @@ class _ContactPageBodyState extends State<ContactPageBody> with SingleTickerProv
orElse: () => groupContacts[0],
);
return ExpansionTile(
return Padding(
padding: const EdgeInsets.only(left: 16, right: 16, top: 4, bottom: 4),
child: ExpansionTile(
title: Text(
groupName,
style: TextStyle(
@@ -198,11 +203,16 @@ class _ContactPageBodyState extends State<ContactPageBody> with SingleTickerProv
),
),
leading: _buildCurrencyIcon(activeContact),
tilePadding: EdgeInsets.zero,
tilePadding: const EdgeInsets.only(left: 16, right: 16),
childrenPadding: const EdgeInsets.only(left: 16),
expandedCrossAxisAlignment: CrossAxisAlignment.start,
expandedAlignment: Alignment.topLeft,
backgroundColor: Theme.of(context).cardColor,
collapsedBackgroundColor: Theme.of(context).cardColor,
collapsedShape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
children: groupContacts.map((contact) => generateRaw(context, contact)).toList(),
),
);
}
}
@@ -234,7 +244,12 @@ class _ContactPageBodyState extends State<ContactPageBody> with SingleTickerProv
},
behavior: HitTestBehavior.opaque,
child: Container(
padding: const EdgeInsets.only(top: 16, bottom: 16, right: 24),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10)),
color: Theme.of(context).cardColor,
),
margin: const EdgeInsets.only(top: 4, bottom: 4, left: 16, right: 16),
padding: const EdgeInsets.only(top: 16, bottom: 16, right: 16, left: 16),
child: Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,
@@ -375,7 +390,12 @@ class _ContactListBodyState extends State<ContactListBody> {
children: [
Container(
key: Key('${contact.name}'),
padding: const EdgeInsets.only(top: 16, bottom: 16, right: 24),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(8)),
color: Theme.of(context).cardColor,
),
margin: const EdgeInsets.only(top: 4, bottom: 4, left: 16, right: 16),
padding: const EdgeInsets.only(top: 16, bottom: 16, right: 16, left: 16),
child: Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,
@@ -396,7 +416,6 @@ class _ContactListBodyState extends State<ContactListBody> {
],
),
),
StandardListSeparator()
],
);
}
+46 -108
View File
@@ -2,7 +2,6 @@ import 'dart:async';
import 'package:cake_wallet/core/wallet_connect/wc_bottom_sheet_service.dart';
import 'package:cake_wallet/entities/preferences_key.dart';
import 'package:cake_wallet/di.dart';
import 'package:cake_wallet/entities/main_actions.dart';
import 'package:cake_wallet/src/screens/dashboard/desktop_widgets/desktop_sidebar_wrapper.dart';
import 'package:cake_wallet/src/screens/dashboard/pages/cake_features_page.dart';
import 'package:cake_wallet/src/screens/wallet_connect/widgets/modals/bottom_sheet_listener.dart';
@@ -10,7 +9,6 @@ import 'package:cake_wallet/src/widgets/gradient_background.dart';
import 'package:cake_wallet/src/widgets/haven_wallet_removal_popup.dart';
import 'package:cake_wallet/src/widgets/services_updates_widget.dart';
import 'package:cake_wallet/src/widgets/vulnerable_seeds_popup.dart';
import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart';
import 'package:cake_wallet/utils/device_info.dart';
import 'package:cake_wallet/utils/version_comparator.dart';
import 'package:cake_wallet/view_model/dashboard/cake_features_view_model.dart';
@@ -23,8 +21,8 @@ import 'package:flutter/material.dart';
import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
import 'package:cake_wallet/src/screens/base_page.dart';
import 'package:cake_wallet/src/screens/dashboard/widgets/menu_widget.dart';
import 'package:cake_wallet/src/screens/dashboard/widgets/action_button.dart';
import 'package:cake_wallet/src/screens/dashboard/pages/balance/balance_page.dart';
import 'package:cake_wallet/src/screens/dashboard/pages/navigation_dock.dart';
import 'package:cake_wallet/src/screens/dashboard/pages/transactions_page.dart';
import 'package:cake_wallet/src/screens/dashboard/widgets/sync_indicator.dart';
import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_view_model.dart';
@@ -35,7 +33,6 @@ import 'package:smooth_page_indicator/smooth_page_indicator.dart';
import 'package:cake_wallet/main.dart';
import 'package:cake_wallet/src/screens/release_notes/release_notes_screen.dart';
import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
import 'package:cake_wallet/themes/extensions/balance_page_theme.dart';
class DashboardPage extends StatefulWidget {
DashboardPage({
@@ -140,7 +137,8 @@ class _DashboardPageView extends BasePage {
bool get resizeToAvoidBottomInset => false;
@override
Widget get endDrawer => MenuWidget(dashboardViewModel, ValueKey('dashboard_page_drawer_menu_widget_key'));
Widget get endDrawer =>
MenuWidget(dashboardViewModel, ValueKey('dashboard_page_drawer_menu_widget_key'));
@override
Widget leading(BuildContext context) {
@@ -176,10 +174,6 @@ class _DashboardPageView extends BasePage {
width: 40,
child: TextButton(
key: ValueKey('dashboard_page_wallet_menu_button_key'),
// FIX-ME: Style
//highlightColor: Colors.transparent,
//splashColor: Colors.transparent,
//padding: EdgeInsets.all(0),
onPressed: () => onOpenEndDrawer(),
child: Semantics(label: S.of(context).wallet_menu, child: menuButton),
),
@@ -219,14 +213,15 @@ class _DashboardPageView extends BasePage {
_setEffects(context);
return SafeArea(
minimum: EdgeInsets.only(bottom: 24),
minimum: EdgeInsets.only(bottom: 0),
child: BottomSheetListener(
bottomSheetService: bottomSheetService,
child: Column(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Expanded(
child: Observer(
child: Container(
child: Stack(
alignment: Alignment.bottomCenter,
children: <Widget>[
//new Expanded(
Observer(
builder: (context) {
return PageView.builder(
key: ValueKey('dashboard_page_view_key'),
@@ -236,101 +231,44 @@ class _DashboardPageView extends BasePage {
);
},
),
),
Padding(
padding: EdgeInsets.only(bottom: 24, top: 10),
child: Observer(
builder: (context) {
return Semantics(
button: false,
label: 'Page Indicator',
hint: 'Swipe to change page',
excludeSemantics: true,
child: SmoothPageIndicator(
controller: controller,
count: pages.length,
effect: ColorTransitionEffect(
spacing: 6.0,
radius: 6.0,
dotWidth: 6.0,
dotHeight: 6.0,
dotColor: Theme.of(context)
.extension<DashboardPageTheme>()!
.indicatorDotTheme
.indicatorColor,
activeDotColor: Theme.of(context)
.extension<DashboardPageTheme>()!
.indicatorDotTheme
.activeIndicatorColor,
),
),
);
},
),
),
Observer(
builder: (_) {
return ClipRect(
child: Container(
margin: const EdgeInsets.only(left: 16, right: 16),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(50.0),
border: Border.all(
color: Theme.of(context).extension<BalancePageTheme>()!.cardBorderColor,
width: 1,
//),
Positioned(
child: Container(
alignment: Alignment.bottomCenter,
margin: EdgeInsets.only(bottom: 110),
child: Observer(
builder: (context) {
return Semantics(
button: false,
label: 'Page Indicator',
hint: 'Swipe to change page',
excludeSemantics: true,
child: SmoothPageIndicator(
controller: controller,
count: pages.length,
effect: ColorTransitionEffect(
spacing: 6.0,
radius: 6.0,
dotWidth: 6.0,
dotHeight: 6.0,
dotColor: Theme.of(context)
.extension<DashboardPageTheme>()!
.indicatorDotTheme
.indicatorColor,
activeDotColor: Theme.of(context)
.extension<DashboardPageTheme>()!
.indicatorDotTheme
.activeIndicatorColor,
),
),
color: Theme.of(context)
.extension<SyncIndicatorTheme>()!
.syncedBackgroundColor,
),
child: Container(
padding: EdgeInsets.symmetric(horizontal: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: MainActions.all
.where((element) => element.canShow?.call(dashboardViewModel) ?? true)
.map(
(action) => Expanded(
child: Semantics(
button: true,
enabled: (action.isEnabled?.call(dashboardViewModel) ?? true),
child: ActionButton(
key: ValueKey(
'dashboard_page_${action.name(context)}_action_button_key'),
image: Image.asset(
action.image,
height: 24,
width: 24,
color: action.isEnabled?.call(dashboardViewModel) ?? true
? Theme.of(context)
.extension<DashboardPageTheme>()!
.mainActionsIconColor
: Theme.of(context)
.extension<BalancePageTheme>()!
.labelTextColor,
),
title: action.name(context),
onClick: () async =>
await action.onTap(context, dashboardViewModel),
textColor: action.isEnabled?.call(dashboardViewModel) ?? true
? null
: Theme.of(context)
.extension<BalancePageTheme>()!
.labelTextColor,
),
),
),
)
.toList(),
),
),
),
);
},
),
);
},
),
],
),
),
NavigationDock(dashboardViewModel: dashboardViewModel)
],
),
),
),
);
@@ -30,11 +30,11 @@ class DesktopDashboardActions extends StatelessWidget {
await MainActions.showWalletsAction.onTap(context, dashboardViewModel),
),
DesktopActionButton(
title: MainActions.exchangeAction.name(context),
image: MainActions.exchangeAction.image,
canShow: MainActions.exchangeAction.canShow?.call(dashboardViewModel),
isEnabled: MainActions.exchangeAction.isEnabled?.call(dashboardViewModel),
onTap: () async => await MainActions.exchangeAction.onTap(context, dashboardViewModel),
title: MainActions.swapAction.name(context),
image: MainActions.swapAction.image,
canShow: MainActions.swapAction.canShow?.call(dashboardViewModel),
isEnabled: MainActions.swapAction.isEnabled?.call(dashboardViewModel),
onTap: () async => await MainActions.swapAction.onTap(context, dashboardViewModel),
),
Row(
children: [
@@ -16,6 +16,7 @@ import 'package:cw_core/unspent_coin_type.dart';
import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:cake_wallet/themes/theme_base.dart';
class BalanceRowWidget extends StatelessWidget {
BalanceRowWidget({
@@ -65,6 +66,8 @@ class BalanceRowWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
bool brightThemeType = false;
if (dashboardViewModel.settingsStore.currentTheme.type == ThemeType.bright) brightThemeType = true;
return Column(
children: [
Container(
@@ -76,6 +79,15 @@ class BalanceRowWidget extends StatelessWidget {
width: 1,
),
color: Theme.of(context).extension<SyncIndicatorTheme>()!.syncedBackgroundColor,
// boxShadow: [
// BoxShadow(
// color: Theme.of(context)
// .extension<BalancePageTheme>()!
// .cardBorderColor
// .withAlpha(50),
// spreadRadius: dashboardViewModel.getShadowSpread(),
// blurRadius: dashboardViewModel.getShadowBlur())
// ],
),
child: TextButton(
onPressed: () => Fluttertoast.showToast(
@@ -310,7 +322,7 @@ class BalanceRowWidget extends StatelessWidget {
),
),
if (hasSecondAdditionalBalance || hasSecondAvailableBalance) ...[
SizedBox(height: 10),
SizedBox(height: 16),
Container(
margin: const EdgeInsets.only(left: 16, right: 16),
decoration: BoxDecoration(
@@ -320,6 +332,15 @@ class BalanceRowWidget extends StatelessWidget {
width: 1,
),
color: Theme.of(context).extension<SyncIndicatorTheme>()!.syncedBackgroundColor,
boxShadow: [
BoxShadow(
color: Theme.of(context)
.extension<BalancePageTheme>()!
.cardBorderColor
.withAlpha(50),
spreadRadius: dashboardViewModel.getShadowSpread(),
blurRadius: dashboardViewModel.getShadowBlur())
],
),
child: TextButton(
onPressed: () => Fluttertoast.showToast(
@@ -643,6 +664,25 @@ class BalanceRowWidget extends StatelessWidget {
);
}
// double getShadowSpread(){
// double spread = 3;
// if (dashboardViewModel.settingsStore.currentTheme.type == ThemeType.bright) spread = 3;
// else if (dashboardViewModel.settingsStore.currentTheme.type == ThemeType.light) spread = 3;
// else if (dashboardViewModel.settingsStore.currentTheme.type == ThemeType.dark) spread = 1;
// else if (dashboardViewModel.settingsStore.currentTheme.type == ThemeType.oled) spread = 3;
// return spread;
// }
//
//
// double getShadowBlur(){
// double blur = 7;
// if (dashboardViewModel.settingsStore.currentTheme.type == ThemeType.bright) blur = 7;
// else if (dashboardViewModel.settingsStore.currentTheme.type == ThemeType.light) blur = 7;
// else if (dashboardViewModel.settingsStore.currentTheme.type == ThemeType.dark) blur = 3;
// else if (dashboardViewModel.settingsStore.currentTheme.type == ThemeType.oled) blur = 7;
// return blur;
// }
void _showBalanceDescription(BuildContext context, String content) {
showPopUp<void>(context: context, builder: (_) => InformationPage(information: content));
}
@@ -153,7 +153,7 @@ class CryptoBalanceWidget extends StatelessWidget {
return ListView.separated(
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
separatorBuilder: (_, __) => Container(padding: EdgeInsets.only(bottom: 8)),
separatorBuilder: (_, __) => Container(padding: EdgeInsets.only(bottom: 16)),
itemCount: dashboardViewModel.balanceViewModel.formattedBalances.length,
itemBuilder: (__, index) {
final balance =
@@ -210,10 +210,14 @@ class CryptoBalanceWidget extends StatelessWidget {
))
],
if (dashboardViewModel.showSilentPaymentsCard) ...[
SizedBox(height: 10),
SizedBox(height: 16),
Padding(
padding: const EdgeInsets.fromLTRB(16, 0, 16, 8),
child: DashBoardRoundedCardWidget(
shadowBlur: dashboardViewModel.getShadowBlur(),
shadowSpread: dashboardViewModel.getShadowSpread(),
marginV: 0,
marginH: 0,
customBorder: 30,
title: S.of(context).silent_payments,
subTitle: S.of(context).enable_silent_payments_scanning,
@@ -276,10 +280,12 @@ class CryptoBalanceWidget extends StatelessWidget {
),
],
if (dashboardViewModel.showMwebCard) ...[
SizedBox(height: 10),
SizedBox(height: 16),
Padding(
padding: const EdgeInsets.fromLTRB(16, 0, 16, 8),
child: DashBoardRoundedCardWidget(
marginV: 0,
marginH: 0,
customBorder: 30,
title: S.of(context).litecoin_mweb,
subTitle: S.of(context).litecoin_mweb_description,
@@ -352,6 +358,7 @@ class CryptoBalanceWidget extends StatelessWidget {
),
),
),
SizedBox(height: 150),
],
],
);
@@ -22,15 +22,13 @@ class CakeFeaturesPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
return Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 50),
Text(
Padding(
padding: EdgeInsets.only(left: 24, top: 16),
child: Text(
'Cake ${S.of(context).features}',
style: TextStyle(
fontSize: 24,
@@ -38,11 +36,14 @@ class CakeFeaturesPage extends StatelessWidget {
color: Theme.of(context).extension<DashboardPageTheme>()!.pageTitleTextColor,
),
),
),
Expanded(
child: ListView(
children: <Widget>[
SizedBox(height: 20),
SizedBox(height: 2),
DashBoardRoundedCardWidget(
shadowBlur: dashboardViewModel.getShadowBlur(),
shadowSpread: dashboardViewModel.getShadowSpread(),
onTap: () {
if (Platform.isMacOS) {
_launchUrl("buy.cakepay.com");
@@ -59,8 +60,9 @@ class CakeFeaturesPage extends StatelessWidget {
fit: BoxFit.cover,
),
),
SizedBox(height: 10),
DashBoardRoundedCardWidget(
shadowBlur: dashboardViewModel.getShadowBlur(),
shadowSpread: dashboardViewModel.getShadowSpread(),
onTap: () => _launchUrl("cake.nano-gpt.com"),
title: "NanoGPT",
subTitle: S.of(context).nanogpt_subtitle,
@@ -71,32 +73,13 @@ class CakeFeaturesPage extends StatelessWidget {
fit: BoxFit.cover,
),
),
SizedBox(height: 10),
Observer(
builder: (context) {
if (!dashboardViewModel.hasSignMessages) {
return const SizedBox();
}
return DashBoardRoundedCardWidget(
onTap: () => Navigator.of(context).pushNamed(Routes.signPage),
title: S.current.sign_verify_message,
subTitle: S.current.sign_verify_message_sub,
icon: Icon(
Icons.speaker_notes_rounded,
color:
Theme.of(context).extension<DashboardPageTheme>()!.pageTitleTextColor,
size: 75,
),
);
},
),
SizedBox(height: 125),
],
),
),
],
),
),
);
);
}
void _launchUrl(String url) {
@@ -0,0 +1,229 @@
import 'dart:ui';
import 'package:cake_wallet/entities/main_actions.dart';
import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart';
import 'package:flutter/material.dart';
import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
import 'package:cake_wallet/src/screens/dashboard/widgets/action_button.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
import 'package:cake_wallet/themes/extensions/balance_page_theme.dart';
import '../../../../themes/theme_base.dart';
class NavigationDock extends StatelessWidget {
const NavigationDock({
required this.dashboardViewModel,
});
final DashboardViewModel dashboardViewModel;
@override
Widget build(BuildContext context) {
return dashboardViewModel.settingsStore.currentTheme.type == ThemeType.bright
? Positioned(
child: Observer(
builder: (_) {
return Container(
alignment: Alignment.bottomCenter,
height: 130,
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: <Color>[
Theme.of(context)
.extension<DashboardPageTheme>()!
.thirdGradientBackgroundColor
.withAlpha(10),
Theme.of(context)
.extension<DashboardPageTheme>()!
.thirdGradientBackgroundColor
.withAlpha(75),
Theme.of(context)
.extension<DashboardPageTheme>()!
.thirdGradientBackgroundColor
.withAlpha(150),
Theme.of(context)
.extension<DashboardPageTheme>()!
.thirdGradientBackgroundColor,
Theme.of(context)
.extension<DashboardPageTheme>()!
.thirdGradientBackgroundColor
],
),
),
child: Container(
margin: const EdgeInsets.only(left: 16, right: 16, bottom: 16),
child: ClipRRect(
borderRadius: BorderRadius.circular(50),
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 50, sigmaY: 50),
child: Container(
height: 75,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(50.0),
border: Border.all(
color:
Theme.of(context).extension<BalancePageTheme>()!.cardBorderColor,
width: 1,
),
color: Theme.of(context)
.extension<SyncIndicatorTheme>()!
.syncedBackgroundColor,
),
child: Container(
padding: EdgeInsets.symmetric(horizontal: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: MainActions.all
.where((element) =>
element.canShow?.call(dashboardViewModel) ?? true)
.map(
(action) => Expanded(
child: Semantics(
button: true,
enabled:
(action.isEnabled?.call(dashboardViewModel) ?? true),
child: ActionButton(
key: ValueKey(
'dashboard_page_${action.name(context)}_action_button_key'),
image: Image.asset(
action.image,
height: 24,
width: 24,
color:
action.isEnabled?.call(dashboardViewModel) ?? true
? Theme.of(context)
.extension<DashboardPageTheme>()!
.mainActionsIconColor
: Theme.of(context)
.extension<BalancePageTheme>()!
.labelTextColor,
),
title: action.name(context),
onClick: () async =>
await action.onTap(context, dashboardViewModel),
textColor:
action.isEnabled?.call(dashboardViewModel) ?? true
? null
: Theme.of(context)
.extension<BalancePageTheme>()!
.labelTextColor,
),
),
),
)
.toList(),
),
),
),
),
),
),
);
},
),
)
: Positioned(
child: Observer(
builder: (_) {
return Container(
alignment: Alignment.bottomCenter,
height: 130,
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: <Color>[
Theme.of(context)
.extension<DashboardPageTheme>()!
.thirdGradientBackgroundColor
.withAlpha(10),
Theme.of(context)
.extension<DashboardPageTheme>()!
.thirdGradientBackgroundColor
.withAlpha(75),
Theme.of(context)
.extension<DashboardPageTheme>()!
.thirdGradientBackgroundColor
.withAlpha(150),
Theme.of(context)
.extension<DashboardPageTheme>()!
.thirdGradientBackgroundColor,
Theme.of(context)
.extension<DashboardPageTheme>()!
.thirdGradientBackgroundColor
],
),
),
child: Container(
margin: const EdgeInsets.only(left: 16, right: 16, bottom: 16),
child: Container(
height: 75,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(50.0),
border: Border.all(
color: Theme.of(context).extension<BalancePageTheme>()!.cardBorderColor,
width: 1,
),
color: Theme.of(context)
.extension<SyncIndicatorTheme>()!
.syncedBackgroundColor,
boxShadow: [
BoxShadow(
color: Theme.of(context)
.extension<BalancePageTheme>()!
.cardBorderColor
.withAlpha(50),
spreadRadius: dashboardViewModel.getShadowSpread(),
blurRadius: dashboardViewModel.getShadowBlur())
],
),
child: Container(
padding: EdgeInsets.symmetric(horizontal: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: MainActions.all
.where((element) => element.canShow?.call(dashboardViewModel) ?? true)
.map(
(action) => Expanded(
child: Semantics(
button: true,
enabled: (action.isEnabled?.call(dashboardViewModel) ?? true),
child: ActionButton(
key: ValueKey(
'dashboard_page_${action.name(context)}_action_button_key'),
image: Image.asset(
action.image,
height: 24,
width: 24,
color: action.isEnabled?.call(dashboardViewModel) ?? true
? Theme.of(context)
.extension<DashboardPageTheme>()!
.mainActionsIconColor
: Theme.of(context)
.extension<BalancePageTheme>()!
.labelTextColor,
),
title: action.name(context),
onClick: () async =>
await action.onTap(context, dashboardViewModel),
textColor: action.isEnabled?.call(dashboardViewModel) ?? true
? null
: Theme.of(context)
.extension<BalancePageTheme>()!
.labelTextColor,
),
),
),
)
.toList(),
),
),
),
),
);
},
),
);
}
}
@@ -21,8 +21,8 @@ class ActionButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () {
return TextButton(
onPressed: () {
if (route?.isNotEmpty ?? false) {
Navigator.of(context, rootNavigator: true).pushNamed(route!);
} else {
@@ -31,11 +31,12 @@ class ActionButton extends StatelessWidget {
},
child: Container(
color: Colors.transparent,
padding: EdgeInsets.only(top: 14, bottom: 16, left: 10, right: 10),
padding: EdgeInsets.only(top: 5, bottom: 5, left: 0, right: 0),
alignment: alignment,
child: Column(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
//mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Container(
alignment: Alignment.center,
@@ -47,7 +48,7 @@ class ActionButton extends StatelessWidget {
Text(
title,
style: TextStyle(
fontSize: 10,
fontSize: 9,
color: textColor ??
Theme.of(context).extension<DashboardPageTheme>()!.cardTextColor),
textAlign: TextAlign.center,
@@ -143,6 +143,7 @@ class MenuWidgetState extends State<MenuWidget> {
return Container(
height: headerHeight,
decoration: BoxDecoration(
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(24)),
gradient: LinearGradient(colors: [
Theme.of(context).extension<CakeMenuTheme>()!.headerFirstGradientColor,
Theme.of(context).extension<CakeMenuTheme>()!.headerSecondGradientColor,
@@ -209,7 +210,7 @@ class MenuWidgetState extends State<MenuWidget> {
);
},
separatorBuilder: (_, index) => Container(
height: 1,
height: 0,
color: Theme.of(context).extension<CakeMenuTheme>()!.dividerColor,
),
itemCount: itemCount + 1,
@@ -193,9 +193,11 @@ class ExchangeCardState<T extends Currency> extends State<ExchangeCard<T>> {
width: double.infinity,
color: Colors.transparent,
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
SizedBox(height: 10),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
SizedBox(height: 40),
Text(
key: ValueKey('${_cardInstanceName}_title_key'),
_title,
@@ -207,6 +209,7 @@ class ExchangeCardState<T extends Currency> extends State<ExchangeCard<T>> {
],
),
CurrencyAmountTextField(
padding: EdgeInsets.zero,
currencyPickerButtonKey: ValueKey('${_cardInstanceName}_currency_picker_button_key'),
selectedCurrencyTextKey: ValueKey('${_cardInstanceName}_selected_currency_text_key'),
selectedCurrencyTagTextKey:
@@ -273,7 +276,7 @@ class ExchangeCardState<T extends Currency> extends State<ExchangeCard<T>> {
? FocusTraversalOrder(
order: NumericFocusOrder(2),
child: Padding(
padding: widget.addressRowPadding ?? EdgeInsets.only(top: 20),
padding: widget.addressRowPadding ?? EdgeInsets.only(top: 12),
child: AddressTextField(
addressKey: ValueKey('${_cardInstanceName}_editable_address_textfield_key'),
focusNode: widget.addressFocusNode,
@@ -313,7 +316,7 @@ class ExchangeCardState<T extends Currency> extends State<ExchangeCard<T>> {
)
: Offstage()
: Padding(
padding: EdgeInsets.only(top: 10),
padding: EdgeInsets.only(top: 0),
child: Builder(
builder: (context) => Stack(children: <Widget>[
FocusTraversalOrder(
@@ -23,7 +23,7 @@ class MobileExchangeCardsSection extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.only(bottom: isBuySellOption ? 8 : 32),
padding: EdgeInsets.only(bottom: isBuySellOption ? 16 : 16),
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(24),
@@ -54,7 +54,7 @@ class MobileExchangeCardsSection extends StatelessWidget {
end: Alignment.bottomRight,
),
),
padding: EdgeInsets.fromLTRB(24, 90, 24, isBuySellOption ? 8 : 32),
padding: EdgeInsets.fromLTRB(24, 90, 24, isBuySellOption ? 24 : 16),
child: Column(
children: [
if (isBuySellOption) Column(
@@ -68,7 +68,7 @@ class MobileExchangeCardsSection extends StatelessWidget {
),
),
Padding(
padding: EdgeInsets.only(top: 29, left: 24, right: 24),
padding: EdgeInsets.only(top: 20, left: 24, right: 24),
child: secondExchangeCard,
)
],
@@ -18,6 +18,37 @@ class NodeListRow extends StandardListRow {
final Node node;
final bool isPow;
@override
Widget build(BuildContext context) {
final leading = buildLeading(context);
final trailing = buildTrailing(context);
return Container(
height: 56,
padding: EdgeInsets.only(left: 12, right: 12, top: 2, bottom: 2),
margin: EdgeInsets.only(top: 2, bottom: 2),
child: TextButton(
onPressed: () => onTap?.call(context),
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(Theme.of(context).cardColor),
shape: MaterialStateProperty.all(
RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(10)
),
),
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
if (leading != null) leading,
buildCenter(context, hasLeftOffset: leading != null),
if (trailing != null) trailing,
],
),
),
);
}
@override
Widget buildLeading(BuildContext context) {
return FutureBuilder(
@@ -56,6 +87,36 @@ class NodeHeaderListRow extends StandardListRow {
NodeHeaderListRow({required String title, required void Function(BuildContext context) onTap})
: super(title: title, onTap: onTap, isSelected: false);
@override
Widget build(BuildContext context) {
final leading = buildLeading(context);
final trailing = buildTrailing(context);
return Container(
height: 56,
padding: EdgeInsets.only(left: 12, right: 12, top: 2, bottom: 2),
child: TextButton(
onPressed: () => onTap?.call(context),
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(Theme.of(context).cardColor),
shape: MaterialStateProperty.all(
RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(10)
),
),
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
if (leading != null) leading,
buildCenter(context, hasLeftOffset: leading != null),
if (trailing != null) trailing,
],
),
),
);
}
@override
Widget buildTrailing(BuildContext context) {
return SizedBox(
+1 -1
View File
@@ -142,7 +142,7 @@ class SendCardState extends State<SendCard> with AutomaticKeepAliveClientMixin<S
child: Padding(
padding: EdgeInsets.fromLTRB(
24,
responsiveLayoutUtil.shouldRenderMobileUI ? 100 : 55,
responsiveLayoutUtil.shouldRenderMobileUI ? 110 : 55,
24,
responsiveLayoutUtil.shouldRenderMobileUI ? 32 : 0,
),
@@ -27,12 +27,6 @@ class DisplaySettingsPage extends BasePage {
padding: EdgeInsets.only(top: 10),
child: Column(
children: [
SettingsSwitcherCell(
title: S.current.settings_display_balance,
value: _displaySettingsViewModel.shouldDisplayBalance,
onValueChange: (_, bool value) {
_displaySettingsViewModel.setShouldDisplayBalance(value);
}),
SettingsSwitcherCell(
title: S.current.show_market_place,
value: _displaySettingsViewModel.shouldShowMarketPlaceInDashboard,
@@ -40,6 +34,13 @@ class DisplaySettingsPage extends BasePage {
_displaySettingsViewModel.setShouldShowMarketPlaceInDashbaord(value);
},
),
SettingsSwitcherCell(
title: S.of(context).show_address_book_popup,
value: _displaySettingsViewModel.showAddressBookPopup,
onValueChange: (_, bool value) {
_displaySettingsViewModel.setShowAddressBookPopup(value);
},
),
//if (!isHaven) it does not work correctly
if (!_displaySettingsViewModel.disabledFiatApiMode)
SettingsPickerCell<FiatCurrency>(
@@ -34,7 +34,6 @@ class ManageNodesPage extends BasePage {
onTap: (_) async => await Navigator.of(context).pushNamed(Routes.newNode),
),
),
const StandardListSeparator(padding: EdgeInsets.symmetric(horizontal: 24)),
SizedBox(height: 20),
Observer(
builder: (BuildContext context) {
@@ -63,13 +63,6 @@ class OtherSettingsPage extends BasePage {
handler: (BuildContext context) =>
Navigator.of(context).pushNamed(Routes.readDisclaimer),
),
SettingsSwitcherCell(
title: S.of(context).show_address_book_popup,
value: _otherSettingsViewModel.showAddressBookPopup,
onValueChange: (_, bool value) {
_otherSettingsViewModel.setShowAddressBookPopup(value);
},
),
Spacer(),
SettingsVersionCell(
title: S.of(context).version(_otherSettingsViewModel.currentVersion)),
@@ -35,41 +35,6 @@ class SecurityBackupPage extends BasePage {
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
if (!_isHardwareWallet)
SettingsCellWithArrow(
key: ValueKey('security_backup_page_show_keys_button_key'),
title: S.current.show_keys,
handler: (_) => _authService.authenticateAction(
context,
route: Routes.showKeys,
conditionToDetermineIfToUse2FA:
_securitySettingsViewModel.shouldRequireTOTP2FAForAllSecurityAndBackupSettings,
),
),
if (!SettingsStoreBase.walletPasswordDirectInput)
SettingsCellWithArrow(
key: ValueKey('security_backup_page_create_backup_button_key'),
title: S.current.create_backup,
handler: (_) => _authService.authenticateAction(
context,
route: Routes.backup,
conditionToDetermineIfToUse2FA:
_securitySettingsViewModel.shouldRequireTOTP2FAForAllSecurityAndBackupSettings,
),
),
SettingsCellWithArrow(
key: ValueKey('security_backup_page_change_pin_button_key'),
title: S.current.settings_change_pin,
handler: (_) => _authService.authenticateAction(
context,
route: Routes.setupPin,
arguments: (PinCodeState<PinCodeWidget> setupPinContext, String _) {
setupPinContext.close();
},
conditionToDetermineIfToUse2FA:
_securitySettingsViewModel.shouldRequireTOTP2FAForAllSecurityAndBackupSettings,
),
),
if (DeviceInfo.instance.isMobile || Platform.isMacOS || Platform.isLinux)
Observer(builder: (_) {
return SettingsSwitcherCell(
@@ -110,6 +75,47 @@ class SecurityBackupPage extends BasePage {
},
);
}),
if (!_isHardwareWallet)
SettingsCellWithArrow(
key: ValueKey('security_backup_page_show_keys_button_key'),
title: S.current.show_keys,
handler: (_) => _authService.authenticateAction(
context,
route: Routes.showKeys,
conditionToDetermineIfToUse2FA:
_securitySettingsViewModel.shouldRequireTOTP2FAForAllSecurityAndBackupSettings,
),
),
if (!SettingsStoreBase.walletPasswordDirectInput)
SettingsCellWithArrow(
key: ValueKey('security_backup_page_create_backup_button_key'),
title: S.current.create_backup,
handler: (_) => _authService.authenticateAction(
context,
route: Routes.backup,
conditionToDetermineIfToUse2FA:
_securitySettingsViewModel.shouldRequireTOTP2FAForAllSecurityAndBackupSettings,
),
),
SettingsCellWithArrow(
key: ValueKey('security_backup_page_change_pin_button_key'),
title: S.current.settings_change_pin,
handler: (_) => _authService.authenticateAction(
context,
route: Routes.setupPin,
arguments: (PinCodeState<PinCodeWidget> setupPinContext, String _) {
setupPinContext.close();
},
conditionToDetermineIfToUse2FA:
_securitySettingsViewModel.shouldRequireTOTP2FAForAllSecurityAndBackupSettings,
),
),
SettingsCellWithArrow(
key: ValueKey('security_backup_page_sign_and_verify'),
title: S.current.sign_verify_title,
handler: (_) => Navigator.of(context).pushNamed(Routes.signPage)
//_securitySettingsViewModel.pinCodeRequiredDuration,
),
Observer(
builder: (context) {
return SettingsCellWithArrow(
@@ -12,7 +12,7 @@ class SettingsChoicesCell extends StatelessWidget {
Widget build(BuildContext context) {
return Container(
color: Theme.of(context).colorScheme.background,
padding: EdgeInsets.all(24),
padding: EdgeInsets.only(left: 24, right: 24, top: 16, bottom: 16),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
@@ -30,7 +30,7 @@ class SettingsChoicesCell extends StatelessWidget {
),
],
),
const SizedBox(height: 24),
const SizedBox(height: 12),
],
Center(
child: Container(
@@ -1,6 +1,7 @@
import 'package:flutter/cupertino.dart';
import 'package:cake_wallet/src/widgets/standard_list.dart';
import 'package:cake_wallet/src/widgets/standard_switch.dart';
import 'package:flutter/material.dart';
class SettingsSwitcherCell extends StandardListRow {
SettingsSwitcherCell({
@@ -21,6 +22,37 @@ class SettingsSwitcherCell extends StandardListRow {
Widget buildTrailing(BuildContext context) =>
StandardSwitch(value: value, onTaped: () => onValueChange?.call(context, !value));
@override
Widget build(BuildContext context) {
final leading = buildLeading(context);
final trailing = buildTrailing(context);
return Container(
height: 56,
padding: EdgeInsets.only(left: 12, right: 12),
child: TextButton(
onPressed: () => onValueChange?.call(context, !value),
style: ButtonStyle(
//backgroundColor: MaterialStateProperty.all(Theme.of(context).cardColor),
shape: MaterialStateProperty.all(
RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(10)
),
),
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
if (leading != null) leading,
buildCenter(context, hasLeftOffset: leading != null),
if (trailing != null) trailing,
],
),
),
);
}
@override
Widget? buildLeading(BuildContext context) => leading;
}
+3 -3
View File
@@ -42,7 +42,7 @@ class SupportPage extends BasePage {
child: Column(
children: [
Padding(
padding: EdgeInsets.only(top: 24),
padding: EdgeInsets.only(top: 20),
child: OptionTile(
icon: Icon(
Icons.support_agent,
@@ -61,7 +61,7 @@ class SupportPage extends BasePage {
),
),
Padding(
padding: EdgeInsets.only(top: 24),
padding: EdgeInsets.only(top: 20),
child: OptionTile(
icon: Icon(
Icons.find_in_page,
@@ -74,7 +74,7 @@ class SupportPage extends BasePage {
),
),
Padding(
padding: EdgeInsets.only(top: 24),
padding: EdgeInsets.only(top: 20),
child: OptionTile(
icon: Icon(
Icons.contact_support,
+320 -239
View File
@@ -31,6 +31,8 @@ import 'package:cw_core/wallet_type.dart';
import 'package:flutter/material.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import '../../../themes/extensions/dashboard_page_theme.dart';
class WalletListPage extends BasePage {
WalletListPage({
required this.walletListViewModel,
@@ -88,7 +90,8 @@ class WalletListPage extends BasePage {
width: 36,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Theme.of(context).extension<FilterTheme>()!.buttonColor,
color:
Theme.of(context).extension<FilterTheme>()!.buttonColor,
),
child: filterIcon,
),
@@ -145,259 +148,336 @@ class WalletListBodyState extends State<WalletListBody> {
color: Theme.of(context).extension<CakeTextTheme>()!.buttonTextColor);
return Container(
height: double.infinity,
padding: EdgeInsets.only(top: 16),
child: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (widget.walletListViewModel.multiWalletGroups.isNotEmpty) ...{
Padding(
padding: const EdgeInsets.only(left: 24),
child: Text(
S.current.shared_seed_wallet_groups,
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w500,
color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
),
child: Stack(
alignment: Alignment.bottomCenter,
fit: StackFit.expand,
children: <Widget>[
SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (widget
.walletListViewModel.multiWalletGroups.isNotEmpty) ...{
Padding(
padding: const EdgeInsets.only(left: 24),
child: Text(
S.current.shared_seed_wallet_groups,
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w500,
color: Theme.of(context)
.extension<CakeTextTheme>()!
.titleColor,
),
),
SizedBox(height: 16),
Container(
child: Observer(
builder: (_) => FilteredList(
shrinkWrap: true,
list: widget.walletListViewModel.multiWalletGroups,
updateFunction: widget.walletListViewModel.reorderAccordingToWalletList,
itemBuilder: (context, index) {
final group = widget.walletListViewModel.multiWalletGroups[index];
final groupName = group.groupName ??
'${S.current.wallet_group} ${index + 1}';
),
SizedBox(height: 16),
Container(
child: Observer(
builder: (_) => FilteredList(
shrinkWrap: true,
list: widget.walletListViewModel.multiWalletGroups,
updateFunction: widget
.walletListViewModel.reorderAccordingToWalletList,
itemBuilder: (context, index) {
final group = widget
.walletListViewModel.multiWalletGroups[index];
final groupName = group.groupName ??
'${S.current.wallet_group} ${index + 1}';
widget.walletListViewModel.updateTileState(
index,
widget.walletListViewModel.expansionTileStateTrack[index] ?? false,
);
widget.walletListViewModel.updateTileState(
index,
widget.walletListViewModel
.expansionTileStateTrack[index] ??
false,
);
return GroupedWalletExpansionTile(
onExpansionChanged: (value) {
widget.walletListViewModel.updateTileState(index, value);
setState(() {});
return GroupedWalletExpansionTile(
onExpansionChanged: (value) {
widget.walletListViewModel
.updateTileState(index, value);
setState(() {});
},
shouldShowCurrentWalletPointer: true,
borderRadius: BorderRadius.all(Radius.circular(16)),
margin: EdgeInsets.only(
left: 20, right: 20, bottom: 12),
title: groupName,
tileKey: ValueKey(
'group_wallets_expansion_tile_widget_$index'),
leadingWidget: Icon(
Icons.account_balance_wallet_outlined,
size: 28,
),
trailingWidget: EditWalletButtonWidget(
width: 74,
isGroup: true,
isExpanded: widget.walletListViewModel
.expansionTileStateTrack[index]!,
onTap: () {
final wallet = widget.walletListViewModel
.convertWalletInfoToWalletListItem(
group.wallets.first);
Navigator.of(context).pushNamed(
Routes.walletEdit,
arguments: WalletEditPageArguments(
walletListViewModel:
widget.walletListViewModel,
editingWallet: wallet,
isWalletGroup: true,
groupName: groupName,
parentAddress: group.parentAddress,
),
);
},
shouldShowCurrentWalletPointer: true,
borderRadius: BorderRadius.all(Radius.circular(16)),
margin: EdgeInsets.only(left: 20, right: 20, bottom: 12),
title: groupName,
tileKey: ValueKey('group_wallets_expansion_tile_widget_$index'),
leadingWidget: Icon(
Icons.account_balance_wallet_outlined,
size: 28,
),
trailingWidget: EditWalletButtonWidget(
width: 74,
isGroup: true,
isExpanded: widget.walletListViewModel.expansionTileStateTrack[index]!,
onTap: () {
final wallet = widget.walletListViewModel
.convertWalletInfoToWalletListItem(group.wallets.first);
Navigator.of(context).pushNamed(
Routes.walletEdit,
arguments: WalletEditPageArguments(
walletListViewModel: widget.walletListViewModel,
editingWallet: wallet,
isWalletGroup: true,
groupName: groupName,
parentAddress: group.parentAddress,
),
);
},
),
childWallets: group.wallets.map((walletInfo) {
return widget.walletListViewModel.convertWalletInfoToWalletListItem(walletInfo);
}).toList(),
isSelected: false,
onChildItemTapped: (wallet) =>
wallet.isCurrent ? null : _loadWallet(wallet),
childTrailingWidget: (item) {
return item.isCurrent
? SizedBox.shrink()
: Padding(
padding: const EdgeInsets.only(right: 16),
child: EditWalletButtonWidget(
width: 44,
onTap: () => Navigator.of(context).pushNamed(
Routes.walletEdit,
arguments: WalletEditPageArguments(
walletListViewModel: widget.walletListViewModel,
editingWallet: item,
),
),
),
);
},
);
},
),
),
),
SizedBox(height: 24),
},
if (widget.walletListViewModel.singleWalletsList.isNotEmpty) ...{
Padding(
padding: const EdgeInsets.only(left: 24),
child: Text(
S.current.single_seed_wallets_group,
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w500,
color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
),
),
),
SizedBox(height: 16),
Container(
child: Observer(
builder: (_) => FilteredList(
shrinkWrap: true,
list: widget.walletListViewModel.singleWalletsList,
updateFunction: widget.walletListViewModel.reorderAccordingToWalletList,
itemBuilder: (context, index) {
final wallet = widget.walletListViewModel.singleWalletsList[index];
final currentColor = wallet.isCurrent
? Theme.of(context)
.extension<WalletListTheme>()!
.createNewWalletButtonBackgroundColor
: Theme.of(context).colorScheme.background;
return GroupedWalletExpansionTile(
tileKey: ValueKey('single_wallets_expansion_tile_widget_$index'),
isCurrentlySelectedWallet: wallet.isCurrent,
leadingWidget: SizedBox(
width: wallet.isCurrent ? 56 : 40,
child: Row(
children: [
wallet.isCurrent
? Container(
height: 35,
width: 6,
margin: EdgeInsets.only(right: 16),
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topRight: Radius.circular(16),
bottomRight: Radius.circular(16),
),
color: currentColor,
),
)
: SizedBox(width: 6),
Image.asset(
walletTypeToCryptoCurrency(wallet.type).iconPath!,
width: 32,
height: 32,
),
],
),
),
title: wallet.name,
isSelected: false,
borderRadius: BorderRadius.all(Radius.circular(16)),
margin: EdgeInsets.only(left: 20, right: 20, bottom: 12),
onTitleTapped: () => wallet.isCurrent ? null : _loadWallet(wallet),
trailingWidget: wallet.isCurrent
? null
: EditWalletButtonWidget(
width: 44,
onTap: () {
Navigator.of(context).pushNamed(
),
childWallets: group.wallets.map((walletInfo) {
return widget.walletListViewModel
.convertWalletInfoToWalletListItem(
walletInfo);
}).toList(),
isSelected: false,
onChildItemTapped: (wallet) =>
wallet.isCurrent ? null : _loadWallet(wallet),
childTrailingWidget: (item) {
return item.isCurrent
? SizedBox.shrink()
: Padding(
padding: const EdgeInsets.only(right: 16),
child: EditWalletButtonWidget(
width: 44,
onTap: () =>
Navigator.of(context).pushNamed(
Routes.walletEdit,
arguments: WalletEditPageArguments(
walletListViewModel: widget.walletListViewModel,
editingWallet: wallet,
walletListViewModel:
widget.walletListViewModel,
editingWallet: item,
),
);
},
),
);
},
),
),
),
);
},
);
},
),
),
},
],
),
),
),
Padding(
padding: const EdgeInsets.all(24),
child: Column(
children: <Widget>[
PrimaryImageButton(
key: ValueKey('wallet_list_page_restore_wallet_button_key'),
onPressed: () {
if (widget.walletListViewModel.shouldRequireTOTP2FAForCreatingNewWallets) {
widget.authService.authenticateAction(
context,
route: Routes.restoreOptions,
arguments: false,
conditionToDetermineIfToUse2FA: widget.walletListViewModel.shouldRequireTOTP2FAForCreatingNewWallets,
);
} else {
Navigator.of(context).pushNamed(Routes.restoreOptions, arguments: false);
}
},
image: restoreWalletImage,
text: S.of(context).wallet_list_restore_wallet,
color: Theme.of(context).cardColor,
textColor: Theme.of(context).extension<CakeTextTheme>()!.buttonTextColor,
),
SizedBox(height: 10.0),
PrimaryImageButton(
key: ValueKey('wallet_list_page_create_new_wallet_button_key'),
onPressed: () {
//TODO(David): Find a way to optimize this
if (isSingleCoin) {
if (widget.walletListViewModel.shouldRequireTOTP2FAForCreatingNewWallets) {
widget.authService.authenticateAction(
context,
route: Routes.newWallet,
arguments: NewWalletArguments(
type: widget.walletListViewModel.currentWalletType,
),
conditionToDetermineIfToUse2FA: widget.walletListViewModel.shouldRequireTOTP2FAForCreatingNewWallets,
);
} else {
Navigator.of(context).pushNamed(
Routes.newWallet,
arguments: NewWalletArguments(
type: widget.walletListViewModel.currentWalletType,
),
);
}
} else {
if (widget.walletListViewModel.shouldRequireTOTP2FAForCreatingNewWallets) {
widget.authService.authenticateAction(
context,
route: Routes.newWalletType,
conditionToDetermineIfToUse2FA: widget.walletListViewModel.shouldRequireTOTP2FAForCreatingNewWallets,
);
} else {
Navigator.of(context).pushNamed(Routes.newWalletType);
}
}
},
image: newWalletImage,
text: S.of(context).wallet_list_create_new_wallet,
color: Theme.of(context).primaryColor,
textColor: Colors.white,
),
),
SizedBox(height: 24),
},
if (widget
.walletListViewModel.singleWalletsList.isNotEmpty) ...{
Padding(
padding: const EdgeInsets.only(left: 24),
child: Text(
S.current.single_seed_wallets_group,
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w500,
color: Theme.of(context)
.extension<CakeTextTheme>()!
.titleColor,
),
),
),
SizedBox(height: 16),
Container(
child: Observer(
builder: (_) => FilteredList(
shrinkWrap: true,
list: widget.walletListViewModel.singleWalletsList,
updateFunction: widget
.walletListViewModel.reorderAccordingToWalletList,
itemBuilder: (context, index) {
final wallet = widget
.walletListViewModel.singleWalletsList[index];
final currentColor = wallet.isCurrent
? Theme.of(context)
.extension<WalletListTheme>()!
.createNewWalletButtonBackgroundColor
: Theme.of(context).colorScheme.background;
return GroupedWalletExpansionTile(
tileKey: ValueKey(
'single_wallets_expansion_tile_widget_$index'),
isCurrentlySelectedWallet: wallet.isCurrent,
leadingWidget: SizedBox(
width: wallet.isCurrent ? 56 : 40,
child: Row(
children: [
wallet.isCurrent
? Container(
height: 35,
width: 6,
margin: EdgeInsets.only(right: 16),
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topRight: Radius.circular(16),
bottomRight: Radius.circular(16),
),
color: currentColor,
),
)
: SizedBox(width: 6),
Image.asset(
walletTypeToCryptoCurrency(wallet.type)
.iconPath!,
width: 32,
height: 32,
),
],
),
),
title: wallet.name,
isSelected: false,
borderRadius: BorderRadius.all(Radius.circular(16)),
margin: EdgeInsets.only(
left: 20, right: 20, bottom: 12),
onTitleTapped: () =>
wallet.isCurrent ? null : _loadWallet(wallet),
trailingWidget: wallet.isCurrent
? null
: EditWalletButtonWidget(
width: 44,
onTap: () {
Navigator.of(context).pushNamed(
Routes.walletEdit,
arguments: WalletEditPageArguments(
walletListViewModel:
widget.walletListViewModel,
editingWallet: wallet,
),
);
},
),
);
},
),
),
),
SizedBox(height: 150),
},
],
),
),
Positioned(
bottom: 0.0,
child: Container(
//padding: EdgeInsets.only(top: 100),
alignment: Alignment.bottomCenter,
height: 185,
//width: 600,
//padding: EdgeInsets.only(top: 50),
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: <Color>[
Theme.of(context).colorScheme.background.withAlpha(10),
Theme.of(context).colorScheme.background,
Theme.of(context).colorScheme.background,
Theme.of(context).colorScheme.background
],
),
),
child: Container(
height: 120,
width: MediaQuery.of(context).size.width,
//alignment: Alignment.bottomCenter,
margin: EdgeInsets.only(bottom: 24),
padding: EdgeInsets.only(left: 16, right: 16),
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
PrimaryImageButton(
key: ValueKey(
'wallet_list_page_restore_wallet_button_key'),
onPressed: () {
if (widget.walletListViewModel
.shouldRequireTOTP2FAForCreatingNewWallets) {
widget.authService.authenticateAction(
context,
route: Routes.restoreOptions,
arguments: false,
conditionToDetermineIfToUse2FA: widget
.walletListViewModel
.shouldRequireTOTP2FAForCreatingNewWallets,
);
} else {
Navigator.of(context).pushNamed(Routes.restoreOptions,
arguments: false);
}
},
image: restoreWalletImage,
text: S.of(context).wallet_list_restore_wallet,
color: Theme.of(context).cardColor,
textColor: Theme.of(context)
.extension<CakeTextTheme>()!
.buttonTextColor,
),
SizedBox(height: 10.0),
PrimaryImageButton(
key: ValueKey(
'wallet_list_page_create_new_wallet_button_key'),
onPressed: () {
//TODO(David): Find a way to optimize this
if (isSingleCoin) {
if (widget.walletListViewModel
.shouldRequireTOTP2FAForCreatingNewWallets) {
widget.authService.authenticateAction(
context,
route: Routes.newWallet,
arguments: NewWalletArguments(
type: widget
.walletListViewModel.currentWalletType,
),
conditionToDetermineIfToUse2FA: widget
.walletListViewModel
.shouldRequireTOTP2FAForCreatingNewWallets,
);
} else {
Navigator.of(context).pushNamed(
Routes.newWallet,
arguments: NewWalletArguments(
type: widget
.walletListViewModel.currentWalletType,
),
);
}
} else {
if (widget.walletListViewModel
.shouldRequireTOTP2FAForCreatingNewWallets) {
widget.authService.authenticateAction(
context,
route: Routes.newWalletType,
conditionToDetermineIfToUse2FA: widget
.walletListViewModel
.shouldRequireTOTP2FAForCreatingNewWallets,
);
} else {
Navigator.of(context)
.pushNamed(Routes.newWalletType);
}
}
},
image: newWalletImage,
text: S.of(context).wallet_list_create_new_wallet,
color: Theme.of(context).primaryColor,
textColor: Colors.white,
),
],
),
),
),
),
],
),
);
}
@@ -405,7 +485,8 @@ class WalletListBodyState extends State<WalletListBody> {
if (SettingsStoreBase.walletPasswordDirectInput) {
Navigator.of(context).pushNamed(Routes.walletUnlockLoadable,
arguments: WalletUnlockArguments(
callback: (bool isAuthenticatedSuccessfully, AuthPageState auth) async {
callback:
(bool isAuthenticatedSuccessfully, AuthPageState auth) async {
if (isAuthenticatedSuccessfully) {
auth.close();
setState(() {});
+87 -55
View File
@@ -15,7 +15,11 @@ class DashBoardRoundedCardWidget extends StatelessWidget {
this.icon,
this.onClose,
this.customBorder,
this.shadowSpread,
this.shadowBlur,
super.key,
this.marginV,
this.marginH,
});
final VoidCallback onTap;
@@ -27,71 +31,97 @@ class DashBoardRoundedCardWidget extends StatelessWidget {
final Widget? icon;
final Image? image;
final double? customBorder;
final double? marginV;
final double? marginH;
final double? shadowSpread;
final double? shadowBlur;
@override
Widget build(BuildContext context) {
return InkWell(
onTap: onTap,
hoverColor: Colors.transparent,
splashColor: Colors.transparent,
highlightColor: Colors.transparent,
//onTap: onTap,
//hoverColor: Colors.transparent,
//splashColor: Colors.transparent,
//highlightColor: Colors.transparent,
child: Stack(
children: [
Container(
padding: EdgeInsets.all(20),
width: double.infinity,
decoration: BoxDecoration(
color: Theme.of(context).extension<SyncIndicatorTheme>()!.syncedBackgroundColor,
borderRadius: BorderRadius.circular(customBorder ?? 20),
border: Border.all(
color: Theme.of(context).extension<BalancePageTheme>()!.cardBorderColor,
),
),
child: Column(
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: TextStyle(
color:
Theme.of(context).extension<DashboardPageTheme>()!.cardTextColor,
fontSize: 24,
fontWeight: FontWeight.w900,
),
softWrap: true,
),
SizedBox(height: 5),
Text(
subTitle,
style: TextStyle(
Container(
margin: EdgeInsets.symmetric(horizontal: marginH ?? 20, vertical: marginV ?? 8),
//padding: EdgeInsets.all(20),
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(customBorder ?? 20),
border: Border.all(
color: Theme.of(context).extension<BalancePageTheme>()!.cardBorderColor,
),
// boxShadow: [
// BoxShadow(
// color: Theme.of(context).extension<BalancePageTheme>()!.cardBorderColor
// .withAlpha(50),
// spreadRadius: shadowSpread ?? 3,
// blurRadius: shadowBlur ?? 7,
// )
// ],
),
child: TextButton(
onPressed: onTap,
style: TextButton.styleFrom(
backgroundColor: Theme.of(context)
.extension<SyncIndicatorTheme>()!
.syncedBackgroundColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(customBorder ?? 20)),
padding: EdgeInsets.all(24)
),
child: Column(
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: TextStyle(
color: Theme.of(context)
.extension<DashboardPageTheme>()!
.cardTextColor,
fontWeight: FontWeight.w500,
fontFamily: 'Lato'),
softWrap: true,
),
],
fontSize: 24,
fontWeight: FontWeight.w900,
),
softWrap: true,
),
SizedBox(height: 5),
Text(
subTitle,
style: TextStyle(
color: Theme.of(context)
.extension<DashboardPageTheme>()!
.cardTextColor,
fontWeight: FontWeight.w500,
fontFamily: 'Lato'),
softWrap: true,
),
],
),
),
),
if (image != null) image!
else if (svgPicture != null) svgPicture!,
if (icon != null) icon!
],
),
if (hint != null) ...[
SizedBox(height: 10),
hint!,
]
],
if (image != null)
image!
else if (svgPicture != null)
svgPicture!,
if (icon != null) icon!
],
),
if (hint != null) ...[
SizedBox(height: 10),
hint!,
]
],
),
),
),
),
if (onClose != null)
Positioned(
top: 10,
@@ -99,7 +129,9 @@ class DashBoardRoundedCardWidget extends StatelessWidget {
child: IconButton(
icon: Icon(Icons.close),
onPressed: onClose,
color: Theme.of(context).extension<DashboardPageTheme>()!.cardTextColor,
color: Theme.of(context)
.extension<DashboardPageTheme>()!
.cardTextColor,
),
),
],
+16 -11
View File
@@ -19,16 +19,17 @@ class OptionTile extends StatelessWidget {
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: onPressed,
child: Container(
width: double.infinity,
padding: EdgeInsets.all(24),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(12)),
color: Theme.of(context).cardColor,
return Container(
width: double.infinity,
padding: EdgeInsets.only(left: 6, right: 6),
alignment: Alignment.center,
child: TextButton(
style: TextButton.styleFrom(
backgroundColor: Theme.of(context).cardColor,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
padding: EdgeInsets.all(24)
),
onPressed: onPressed,
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
@@ -48,7 +49,9 @@ class OptionTile extends StatelessWidget {
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
color: Theme.of(context).extension<OptionTileTheme>()!.titleColor,
color: Theme.of(context)
.extension<OptionTileTheme>()!
.titleColor,
),
),
Padding(
@@ -58,7 +61,9 @@ class OptionTile extends StatelessWidget {
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.normal,
color: Theme.of(context).extension<OptionTileTheme>()!.descriptionColor,
color: Theme.of(context)
.extension<OptionTileTheme>()!
.descriptionColor,
),
),
)
+55 -43
View File
@@ -1,6 +1,10 @@
import 'package:cake_wallet/palette.dart';
import 'package:cake_wallet/themes/extensions/menu_theme.dart';
import 'package:flutter/material.dart';
import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart';
import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
import 'package:cake_wallet/themes/extensions/balance_page_theme.dart';
import 'package:cake_wallet/themes/extensions/option_tile_theme.dart';
class SettingActionButton extends StatelessWidget {
final bool isLastTile;
@@ -29,56 +33,64 @@ class SettingActionButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
final isLightMode = Theme.of(context).extension<OptionTileTheme>()?.useDarkImage ?? false;
Color? color = isSelected
? Theme.of(context).extension<CakeMenuTheme>()!.settingTitleColor
: selectionActive
? Palette.darkBlue
: Theme.of(context).extension<CakeMenuTheme>()!.settingTitleColor;
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: Theme.of(context)
.extension<CakeMenuTheme>()!
.settingActionsIconColor,
? Palette.darkBlue
: Theme.of(context).extension<CakeMenuTheme>()!.settingTitleColor;
return Container(
//padding: EdgeInsets.only(top: 5, left: 15, bottom: 5),
margin: EdgeInsets.only(top: 10, left: 20, bottom: 0, right: 20),
child: TextButton(
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(isLightMode ? Theme.of(context).cardColor : Colors.black12),
shape: MaterialStateProperty.all(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
),
SizedBox(width: 16),
Expanded(
child: Text(
title,
style: TextStyle(
color: color,
fontSize: 16,
fontWeight: FontWeight.bold,
),
),
onPressed: onTap,
//hoverColor: Colors.transparent,
child: Container(
width: double.infinity,
padding: EdgeInsets.only(top: 12, left: 20, bottom: 12, right: 15),
//margin: EdgeInsets.only(top: 5, left: 15, bottom: 5),
alignment: isLastTile ? Alignment.topLeft : null,
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Image.asset(
image,
height: 16,
width: 16,
color: Theme.of(context)
.extension<CakeMenuTheme>()!
.settingActionsIconColor,
),
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,
)
],
if(isArrowVisible)
Icon(
Icons.arrow_forward_ios,
color: Colors.grey,
size: 16,
)
],
),
),
),
);
}
}
}
-14
View File
@@ -17,7 +17,6 @@ class SettingActions {
static List<SettingActions> all = [
connectionSettingAction,
walletSettingAction,
addressBookSettingAction,
silentPaymentsSettingAction,
litecoinMwebSettingAction,
@@ -31,7 +30,6 @@ class SettingActions {
static List<SettingActions> desktopSettings = [
connectionSettingAction,
walletSettingAction,
addressBookSettingAction,
silentPaymentsSettingAction,
securityBackupSettingAction,
@@ -77,18 +75,6 @@ class SettingActions {
},
);
static SettingActions walletSettingAction = SettingActions._(
key: ValueKey('dashboard_page_menu_widget_wallet_menu_button_key'),
name: (context) => S.of(context).wallets,
image: 'assets/images/wallet_menu.png',
onTap: (BuildContext context) {
Navigator.of(context).pushNamed(Routes.walletList, arguments: (_) {
Navigator.of(context).pop(); // pops wallet list
Navigator.of(context).pop(); // pops drawer
});
},
);
static SettingActions addressBookSettingAction = SettingActions._(
key: ValueKey('dashboard_page_menu_widget_address_book_button_key'),
name: (context) => S.of(context).address_book_menu,
+15 -10
View File
@@ -21,16 +21,20 @@ class StandardListRow extends StatelessWidget {
Widget build(BuildContext context) {
final leading = buildLeading(context);
final trailing = buildTrailing(context);
return InkWell(
onTap: () => onTap?.call(context),
child: Container(
return Container(
height: 56,
padding: EdgeInsets.only(left: 24, right: 24),
decoration: decoration ??
BoxDecoration(
color: Theme.of(context).colorScheme.background,
padding: EdgeInsets.only(left: 12, right: 12),
child: TextButton(
onPressed: () => onTap?.call(context),
style: ButtonStyle(
//backgroundColor: MaterialStateProperty.all(Theme.of(context).cardColor),
shape: MaterialStateProperty.all(
RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(10)
),
),
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
@@ -97,10 +101,10 @@ class StandardListSeparator extends StatelessWidget {
return Container(
height: height,
padding: padding,
color: Theme.of(context).colorScheme.background,
color: Colors.transparent,
child: Container(
height: height,
color: Theme.of(context).extension<CakeTextTheme>()!.textfieldUnderlineColor,
color: Colors.transparent,
),
);
}
@@ -140,6 +144,7 @@ class SectionStandardList extends StatelessWidget {
final int sectionCount;
final bool hasTopSeparator;
final int Function(int sectionIndex) itemCounter;
final Widget Function(int sectionIndex, int itemIndex) itemBuilder;
final Widget Function(int sectionIndex)? sectionTitleBuilder;