Generic fixes (#1823)

* add timeout for mempool fee api and make it only in bitcoin

* disable Monero Ledger for desktop

* handle onramper tag issue

* better handle main actions UI

* make service status scrollable with a better UI

* fix stupid race condition

* minor handling

* update btc fee api
update our xmr node to use ssl

* manually add supported unstoppable domains for now

* change bitcoin default node
code enhancement

* revert debugging code [skip ci]

* minor enhancements [skip ci]

* increase sync indicator size [skip ci]

* fix selecting USA country not triggering the reaction

* fix scrolling on cake features page [skip ci]
This commit is contained in:
Omar Hatem
2024-11-25 18:26:41 +02:00
committed by GitHub
parent 367c36b4d5
commit 59e8550e4e
19 changed files with 271 additions and 152 deletions
+24 -22
View File
@@ -291,32 +291,34 @@ class _DashboardPageView extends BasePage {
children: MainActions.all
.where((element) => element.canShow?.call(dashboardViewModel) ?? true)
.map(
(action) => 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
(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,
),
title: action.name(context),
onClick: () async =>
await action.onTap(context, dashboardViewModel),
textColor: action.isEnabled?.call(dashboardViewModel) ?? true
? null
: Theme.of(context)
.extension<BalancePageTheme>()!
.labelTextColor,
),
),
)
@@ -10,91 +10,81 @@ import 'package:cake_wallet/view_model/dashboard/cake_features_view_model.dart';
import 'package:flutter/material.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:flutter_svg/flutter_svg.dart';
class CakeFeaturesPage extends StatelessWidget {
CakeFeaturesPage({required this.dashboardViewModel, required this.cakeFeaturesViewModel});
final DashboardViewModel dashboardViewModel;
final CakeFeaturesViewModel cakeFeaturesViewModel;
final _scrollController = ScrollController();
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
child: RawScrollbar(
thumbColor: Colors.white.withOpacity(0.15),
radius: Radius.circular(20),
thumbVisibility: true,
thickness: 2,
controller: _scrollController,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 50),
Text(
'Cake ${S.of(context).features}',
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.w500,
color: Theme.of(context).extension<DashboardPageTheme>()!.pageTitleTextColor,
),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 50),
Text(
'Cake ${S.of(context).features}',
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.w500,
color: Theme.of(context).extension<DashboardPageTheme>()!.pageTitleTextColor,
),
Expanded(
child: ListView(
controller: _scrollController,
children: <Widget>[
SizedBox(height: 20),
DashBoardRoundedCardWidget(
onTap: () => _navigatorToGiftCardsPage(context),
title: 'Cake Pay',
subTitle: S.of(context).cake_pay_subtitle,
image: Image.asset(
'assets/images/cards.png',
height: 100,
width: 115,
fit: BoxFit.cover,
),
),
Expanded(
child: ListView(
children: <Widget>[
SizedBox(height: 20),
DashBoardRoundedCardWidget(
onTap: () => _navigatorToGiftCardsPage(context),
title: 'Cake Pay',
subTitle: S.of(context).cake_pay_subtitle,
image: Image.asset(
'assets/images/cards.png',
height: 100,
width: 115,
fit: BoxFit.cover,
),
SizedBox(height: 10),
DashBoardRoundedCardWidget(
onTap: () => _launchUrl("cake.nano-gpt.com"),
title: "NanoGPT",
subTitle: S.of(context).nanogpt_subtitle,
image: Image.asset(
'assets/images/nanogpt.png',
height: 80,
width: 80,
fit: BoxFit.cover,
),
),
SizedBox(height: 10),
DashBoardRoundedCardWidget(
onTap: () => _launchUrl("cake.nano-gpt.com"),
title: "NanoGPT",
subTitle: S.of(context).nanogpt_subtitle,
image: Image.asset(
'assets/images/nanogpt.png',
height: 80,
width: 80,
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: 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,
),
);
},
),
],
),
],
),
),
],
),
),
);
@@ -8,7 +8,7 @@ class SyncIndicatorIcon extends StatelessWidget {
{this.boolMode = true,
this.isSynced = false,
this.value = waiting,
this.size = 4.0});
this.size = 6.0});
final bool boolMode;
final bool isSynced;
@@ -191,11 +191,13 @@ class BlockchainHeightState extends State<BlockchainHeightWidget> {
height = wownero!.getHeightByDate(date: date);
}
}
setState(() {
dateController.text = DateFormat('yyyy-MM-dd').format(date);
restoreHeightController.text = '$height';
_changeHeight(height);
});
if (mounted) {
setState(() {
dateController.text = DateFormat('yyyy-MM-dd').format(date);
restoreHeightController.text = '$height';
_changeHeight(height);
});
}
}
}
+6 -4
View File
@@ -92,15 +92,17 @@ class _ServicesUpdatesWidgetState extends State<ServicesUpdatesWidget> {
);
}
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 20),
child: Stack(
padding: const EdgeInsets.symmetric(horizontal: 12),
child: Column(
children: [
body,
Expanded(child: body),
Align(
alignment: Alignment.bottomCenter,
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: MediaQuery.of(context).size.width / 8),
horizontal: MediaQuery.of(context).size.width / 8,
vertical: 20,
),
child: PrimaryImageButton(
onPressed: () {
try {