mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-10 12:44:31 +00:00
commit
70039f7e4b
4 changed files with 50 additions and 14 deletions
|
@ -23,8 +23,6 @@ import 'package:stackwallet/utilities/util.dart';
|
||||||
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
||||||
import 'package:stackwallet/widgets/desktop/desktop_app_bar.dart';
|
import 'package:stackwallet/widgets/desktop/desktop_app_bar.dart';
|
||||||
import 'package:stackwallet/widgets/desktop/desktop_scaffold.dart';
|
import 'package:stackwallet/widgets/desktop/desktop_scaffold.dart';
|
||||||
import 'package:stackwallet/widgets/rounded_date_picker/flutter_rounded_date_picker_widget.dart'
|
|
||||||
as datePicker;
|
|
||||||
import 'package:stackwallet/widgets/rounded_white_container.dart';
|
import 'package:stackwallet/widgets/rounded_white_container.dart';
|
||||||
import 'package:tuple/tuple.dart';
|
import 'package:tuple/tuple.dart';
|
||||||
|
|
||||||
|
@ -154,10 +152,46 @@ class _RestoreOptionsViewState extends ConsumerState<RestoreOptionsView> {
|
||||||
await Future<void>.delayed(const Duration(milliseconds: 125));
|
await Future<void>.delayed(const Duration(milliseconds: 125));
|
||||||
}
|
}
|
||||||
|
|
||||||
final date = await datePicker.showRoundedDatePicker(
|
final date = await showRoundedDatePicker(
|
||||||
context: context,
|
context: context,
|
||||||
initialDate: DateTime.now(),
|
initialDate: DateTime.now(),
|
||||||
height: height * 0.5,
|
height: height / 3.0,
|
||||||
|
theme: ThemeData(
|
||||||
|
primarySwatch: Util.createMaterialColor(fetchedColor),
|
||||||
|
),
|
||||||
|
//TODO pick a better initial date
|
||||||
|
// 2007 chosen as that is just before bitcoin launched
|
||||||
|
firstDate: DateTime(2007),
|
||||||
|
lastDate: DateTime.now(),
|
||||||
|
borderRadius: Constants.size.circularBorderRadius * 2,
|
||||||
|
|
||||||
|
textPositiveButton: "SELECT",
|
||||||
|
|
||||||
|
styleDatePicker: _buildDatePickerStyle(),
|
||||||
|
styleYearPicker: _buildYearPickerStyle(),
|
||||||
|
);
|
||||||
|
if (date != null) {
|
||||||
|
_restoreFromDate = date;
|
||||||
|
_dateController.text = Format.formatDate(date);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> chooseDesktopDate() async {
|
||||||
|
final height = MediaQuery.of(context).size.height;
|
||||||
|
final fetchedColor =
|
||||||
|
Theme.of(context).extension<StackColors>()!.accentColorDark;
|
||||||
|
// check and hide keyboard
|
||||||
|
if (FocusScope.of(context).hasFocus) {
|
||||||
|
FocusScope.of(context).unfocus();
|
||||||
|
await Future<void>.delayed(const Duration(milliseconds: 125));
|
||||||
|
}
|
||||||
|
|
||||||
|
final now = DateTime.now();
|
||||||
|
|
||||||
|
final date = await showRoundedDatePicker(
|
||||||
|
context: context,
|
||||||
|
initialDate: DateTime.now(),
|
||||||
|
height: height / 3.0,
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
primarySwatch: Util.createMaterialColor(fetchedColor),
|
primarySwatch: Util.createMaterialColor(fetchedColor),
|
||||||
),
|
),
|
||||||
|
@ -283,15 +317,17 @@ class _RestoreOptionsViewState extends ConsumerState<RestoreOptionsView> {
|
||||||
(coin == Coin.wownero &&
|
(coin == Coin.wownero &&
|
||||||
ref.watch(mnemonicWordCountStateProvider.state).state ==
|
ref.watch(mnemonicWordCountStateProvider.state).state ==
|
||||||
25))
|
25))
|
||||||
|
if (!isDesktop)
|
||||||
// if (!isDesktop)
|
RestoreFromDatePicker(
|
||||||
|
onTap: chooseDate,
|
||||||
|
controller: _dateController,
|
||||||
|
),
|
||||||
|
if (isDesktop)
|
||||||
|
// TODO desktop date picker
|
||||||
RestoreFromDatePicker(
|
RestoreFromDatePicker(
|
||||||
onTap: chooseDate,
|
onTap: chooseDesktopDate,
|
||||||
controller: _dateController,
|
controller: _dateController,
|
||||||
),
|
),
|
||||||
|
|
||||||
// if (isDesktop)
|
|
||||||
// // TODO desktop date picker
|
|
||||||
if (coin == Coin.monero ||
|
if (coin == Coin.monero ||
|
||||||
coin == Coin.epicCash ||
|
coin == Coin.epicCash ||
|
||||||
(coin == Coin.wownero &&
|
(coin == Coin.wownero &&
|
||||||
|
@ -412,7 +448,6 @@ class _RestoreOptionsViewState extends ConsumerState<RestoreOptionsView> {
|
||||||
isDesktop: isDesktop,
|
isDesktop: isDesktop,
|
||||||
onPressed: _nextEnabled ? nextPressed : null,
|
onPressed: _nextEnabled ? nextPressed : null,
|
||||||
),
|
),
|
||||||
|
|
||||||
if (isDesktop)
|
if (isDesktop)
|
||||||
const Spacer(
|
const Spacer(
|
||||||
flex: 15,
|
flex: 15,
|
||||||
|
|
|
@ -2666,8 +2666,8 @@ class BitcoinCashWallet extends CoinServiceAPI {
|
||||||
], // dust limit is the minimum amount a change output should be
|
], // dust limit is the minimum amount a change output should be
|
||||||
))["vSize"] as int;
|
))["vSize"] as int;
|
||||||
//todo: check if print needed
|
//todo: check if print needed
|
||||||
debugPrint("vSizeForOneOutput $vSizeForOneOutput");
|
// debugPrint("vSizeForOneOutput $vSizeForOneOutput");
|
||||||
debugPrint("vSizeForTwoOutPuts $vSizeForTwoOutPuts");
|
// debugPrint("vSizeForTwoOutPuts $vSizeForTwoOutPuts");
|
||||||
|
|
||||||
// Assume 1 output, only for recipient and no change
|
// Assume 1 output, only for recipient and no change
|
||||||
var feeForOneOutput = estimateTxFee(
|
var feeForOneOutput = estimateTxFee(
|
||||||
|
|
|
@ -51,6 +51,7 @@ class NotesService extends ChangeNotifier {
|
||||||
_notes[txid] = note;
|
_notes[txid] = note;
|
||||||
await DB.instance
|
await DB.instance
|
||||||
.put<dynamic>(boxName: walletId, key: 'notes', value: _notes);
|
.put<dynamic>(boxName: walletId, key: 'notes', value: _notes);
|
||||||
|
//todo: check if this is needed
|
||||||
Logging.instance.log("editOrAddNote: tx note saved", level: LogLevel.Info);
|
Logging.instance.log("editOrAddNote: tx note saved", level: LogLevel.Info);
|
||||||
await _refreshNotes();
|
await _refreshNotes();
|
||||||
}
|
}
|
||||||
|
|
|
@ -158,7 +158,7 @@ abstract class DefaultNodes {
|
||||||
isDown: false);
|
isDown: false);
|
||||||
|
|
||||||
static NodeModel get bitcoinTestnet => NodeModel(
|
static NodeModel get bitcoinTestnet => NodeModel(
|
||||||
host: "electrumx-testnet.cypherstack.com",
|
host: "bitcoin-testnet.cypherstack.com",
|
||||||
port: 51002,
|
port: 51002,
|
||||||
name: defaultName,
|
name: defaultName,
|
||||||
id: _nodeId(Coin.bitcoinTestNet),
|
id: _nodeId(Coin.bitcoinTestNet),
|
||||||
|
|
Loading…
Reference in a new issue