mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-19 05:58:50 +02:00
Generic fixes (#1320)
* New price API * Fix test app package id * Fix workflow * change environment variable to use pr number [skip ci] * Fix un-needed padding * Fix raw value for usdtSol * Remove duplicate fetching for balance and transactions at start [skip ci] * Fix address validation of spl tokens * Add Service Status * Update lib/src/widgets/service_status_tile.dart Co-authored-by: Konstantin Ullrich <konstantinullrich12@gmail.com> * Update lib/src/widgets/services_updates_widget.dart Co-authored-by: Konstantin Ullrich <konstantinullrich12@gmail.com> * Update monero version * update sodium script * Change automatic priority fee rate --------- Co-authored-by: Konstantin Ullrich <konstantinullrich12@gmail.com>
This commit is contained in:
co-authored by
Konstantin Ullrich
parent
c7deeaea9b
commit
6414364602
@@ -7,6 +7,7 @@ import 'package:cake_wallet/src/screens/dashboard/desktop_widgets/desktop_sideba
|
||||
import 'package:cake_wallet/src/screens/dashboard/pages/market_place_page.dart';
|
||||
import 'package:cake_wallet/src/screens/wallet_connect/widgets/modals/bottom_sheet_listener.dart';
|
||||
import 'package:cake_wallet/src/widgets/gradient_background.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';
|
||||
@@ -101,6 +102,9 @@ class _DashboardPageView extends BasePage {
|
||||
@override
|
||||
Widget get endDrawer => MenuWidget(dashboardViewModel);
|
||||
|
||||
@override
|
||||
Widget leading(BuildContext context) => ServicesUpdatesWidget(dashboardViewModel.getServicesStatus());
|
||||
|
||||
@override
|
||||
Widget middle(BuildContext context) {
|
||||
return SyncIndicator(
|
||||
|
||||
@@ -179,7 +179,7 @@ class BaseAlertDialog extends StatelessWidget {
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
if (headerText != null) headerTitle(context),
|
||||
if (headerText?.isNotEmpty ?? false) headerTitle(context),
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(24, 20, 24, 0),
|
||||
child: title(context),
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
import 'package:auto_size_text/auto_size_text.dart';
|
||||
import 'package:cake_wallet/entities/service_status.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
class ServiceStatusTile extends StatelessWidget {
|
||||
final ServiceStatus status;
|
||||
|
||||
const ServiceStatusTile(this.status, {super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListTile(
|
||||
contentPadding: const EdgeInsets.all(8),
|
||||
title: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 8),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Expanded(
|
||||
child: AutoSizeText(
|
||||
"${status.title}${status.status != null ? " - ${status.status}" : ""}",
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontFamily: 'Lato',
|
||||
fontWeight: FontWeight.w800,
|
||||
height: 1,
|
||||
),
|
||||
maxLines: 1,
|
||||
textAlign: TextAlign.start,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
_getTimeString(status.date),
|
||||
style: TextStyle(fontSize: 12),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
leading: RotatedBox(
|
||||
child: Icon(
|
||||
Icons.info,
|
||||
color: status.status == "resolved" ? Colors.green : Colors.red,
|
||||
),
|
||||
quarterTurns: 2,
|
||||
),
|
||||
subtitle: Row(
|
||||
children: [
|
||||
Expanded(child: Text(status.description)),
|
||||
if (status.image != null)
|
||||
SizedBox(
|
||||
height: 50,
|
||||
width: 50,
|
||||
child: Image.network(status.image!),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
String _getTimeString(DateTime date) {
|
||||
int difference = DateTime.now().difference(date).inHours;
|
||||
if (difference == 0) {
|
||||
return "few minutes ago";
|
||||
}
|
||||
if (difference < 24) {
|
||||
return DateFormat('h:mm a').format(date);
|
||||
}
|
||||
return DateFormat('d-MM-yyyy').format(date);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
import 'package:cake_wallet/di.dart';
|
||||
import 'package:cake_wallet/entities/preferences_key.dart';
|
||||
import 'package:cake_wallet/entities/service_status.dart';
|
||||
import 'package:cake_wallet/src/widgets/primary_button.dart';
|
||||
import 'package:cake_wallet/src/widgets/service_status_tile.dart';
|
||||
import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
|
||||
import 'package:cake_wallet/themes/extensions/wallet_list_theme.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class ServicesUpdatesWidget extends StatelessWidget {
|
||||
final Future<ServicesResponse> servicesResponse;
|
||||
|
||||
const ServicesUpdatesWidget(this.servicesResponse, {super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: FutureBuilder<ServicesResponse>(
|
||||
future: servicesResponse,
|
||||
builder: (context, state) {
|
||||
return InkWell(
|
||||
onTap: state.hasData
|
||||
? () {
|
||||
// save currentSha when the user see the status
|
||||
getIt
|
||||
.get<SharedPreferences>()
|
||||
.setString(PreferencesKey.serviceStatusShaKey, state.data!.currentSha);
|
||||
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(50),
|
||||
topRight: Radius.circular(50),
|
||||
),
|
||||
),
|
||||
constraints: BoxConstraints(
|
||||
maxHeight: MediaQuery.of(context).size.height / 2,
|
||||
minHeight: MediaQuery.of(context).size.height / 4,
|
||||
),
|
||||
builder: (context) {
|
||||
Widget body;
|
||||
if (state.data!.servicesStatus.isEmpty) {
|
||||
body = Center(
|
||||
child: Text("Everything is up and running as expected"),
|
||||
);
|
||||
} else {
|
||||
body = SingleChildScrollView(
|
||||
child: Column(
|
||||
children: state.data!.servicesStatus
|
||||
.map((status) => ServiceStatusTile(status))
|
||||
.toList()),
|
||||
);
|
||||
}
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 20),
|
||||
child: Stack(
|
||||
children: [
|
||||
body,
|
||||
Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: MediaQuery.of(context).size.width / 8),
|
||||
child: PrimaryImageButton(
|
||||
onPressed: () {
|
||||
try {
|
||||
launchUrl(Uri.parse("https://status.cakewallet.com/"));
|
||||
} catch (_) {}
|
||||
},
|
||||
image: Image.asset(
|
||||
"assets/images/status_website_image.png",
|
||||
color: Theme.of(context).brightness == Brightness.light
|
||||
? Colors.white
|
||||
: null,
|
||||
),
|
||||
text: "Status Website",
|
||||
color: Theme.of(context)
|
||||
.extension<WalletListTheme>()!
|
||||
.createNewWalletButtonBackgroundColor,
|
||||
textColor: Theme.of(context)
|
||||
.extension<WalletListTheme>()!
|
||||
.restoreWalletButtonTextColor,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
: null,
|
||||
child: Stack(
|
||||
children: [
|
||||
Image.asset(
|
||||
"assets/images/notification_icon.png",
|
||||
color: Theme.of(context).extension<DashboardPageTheme>()!.pageTitleTextColor,
|
||||
),
|
||||
if (state.hasData && state.data!.hasUpdates)
|
||||
Container(
|
||||
height: 7,
|
||||
width: 7,
|
||||
margin: EdgeInsetsDirectional.only(start: 8),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.red,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user