Merge pull request #259 from cypherstack/desktop

Desktop
This commit is contained in:
Diego Salazar 2022-12-06 15:29:18 -07:00 committed by GitHub
commit 24817096b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 237 additions and 204 deletions

View file

@ -307,6 +307,7 @@ class _SendViewState extends ConsumerState<SendView> {
_addressToggleFlag = true;
}
if (coin != Coin.epicCash) {
_cryptoFocus.addListener(() {
if (!_cryptoFocus.hasFocus && !_baseFocus.hasFocus) {
if (_amountToSend == null) {
@ -336,7 +337,7 @@ class _SendViewState extends ConsumerState<SendView> {
}
}
});
}
super.initState();
}
@ -1324,14 +1325,17 @@ class _SendViewState extends ConsumerState<SendView> {
const SizedBox(
height: 12,
),
if (coin != Coin.epicCash)
Text(
"Transaction fee (estimated)",
style: STextStyles.smallMed12(context),
textAlign: TextAlign.left,
),
if (coin != Coin.epicCash)
const SizedBox(
height: 8,
),
if (coin != Coin.epicCash)
Stack(
children: [
TextField(
@ -1366,9 +1370,11 @@ class _SendViewState extends ConsumerState<SendView> {
? null
: () {
showModalBottomSheet<dynamic>(
backgroundColor: Colors.transparent,
backgroundColor:
Colors.transparent,
context: context,
shape: const RoundedRectangleBorder(
shape:
const RoundedRectangleBorder(
borderRadius:
BorderRadius.vertical(
top: Radius.circular(20),
@ -1404,12 +1410,14 @@ class _SendViewState extends ConsumerState<SendView> {
future: _calculateFeesFuture,
builder: (context, snapshot) {
if (snapshot.connectionState ==
ConnectionState.done &&
ConnectionState
.done &&
snapshot.hasData) {
return Text(
"~${snapshot.data! as String} ${coin.ticker}",
style: STextStyles
.itemSubtitle(context),
.itemSubtitle(
context),
);
} else {
return AnimatedText(
@ -1420,7 +1428,8 @@ class _SendViewState extends ConsumerState<SendView> {
"Calculating...",
],
style: STextStyles
.itemSubtitle(context),
.itemSubtitle(
context),
);
}
},
@ -1441,14 +1450,17 @@ class _SendViewState extends ConsumerState<SendView> {
.state
.prettyName,
style: STextStyles
.itemSubtitle12(context),
.itemSubtitle12(
context),
),
const SizedBox(
width: 10,
),
FutureBuilder(
future: _calculateFeesFuture,
builder: (context, snapshot) {
future:
_calculateFeesFuture,
builder:
(context, snapshot) {
if (snapshot.connectionState ==
ConnectionState
.done &&

View file

@ -1364,6 +1364,7 @@ class _DesktopSendState extends ConsumerState<DesktopSend> {
const SizedBox(
height: 20,
),
if (coin != Coin.epicCash)
Text(
"Transaction fee (estimated)",
style: STextStyles.desktopTextExtraSmall(context).copyWith(
@ -1373,9 +1374,11 @@ class _DesktopSendState extends ConsumerState<DesktopSend> {
),
textAlign: TextAlign.left,
),
if (coin != Coin.epicCash)
const SizedBox(
height: 10,
),
if (coin != Coin.epicCash)
DesktopFeeDropDown(
walletId: walletId,
),

View file

@ -1,4 +1,5 @@
import 'dart:async';
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
@ -41,7 +42,24 @@ class _ForgotPasswordDesktopViewState
try {
await Hive.close();
if (Platform.isWindows || Platform.isLinux) {
await appRoot.delete(recursive: true);
} else {
// macos in ipad mode
final xmrDir = Directory("${appRoot.path}/wallets");
if (xmrDir.existsSync()) {
await xmrDir.delete(recursive: true);
}
final epicDir = Directory("${appRoot.path}/epiccash");
if (epicDir.existsSync()) {
await epicDir.delete(recursive: true);
}
await (await StackFileSystem.applicationHiveDirectory())
.delete(recursive: true);
await (await StackFileSystem.applicationIsarDirectory())
.delete(recursive: true);
}
await DB.instance.init();
} catch (e, s) {
Logging.instance.log(