mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-11-16 09:34:06 +01:00
Added auto saving of wallet address to wallet info. Added users wallet addresses into address book.
This commit is contained in:
@@ -2,8 +2,8 @@ import 'package:flutter/services.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:cake_wallet/routes.dart';
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/entities/contact_record.dart';
|
||||
import 'package:cake_wallet/entities/qr_scanner.dart';
|
||||
import 'package:cake_wallet/entities/contact_base.dart';
|
||||
|
||||
enum AddressTextFieldOption { paste, qrCode, addressBook }
|
||||
|
||||
@@ -42,7 +42,7 @@ class AddressTextField extends StatelessWidget {
|
||||
final Color iconColor;
|
||||
final TextStyle textStyle;
|
||||
final TextStyle hintStyle;
|
||||
FocusNode focusNode;
|
||||
final FocusNode focusNode;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -212,7 +212,7 @@ class AddressTextField extends StatelessWidget {
|
||||
final contact = await Navigator.of(context, rootNavigator: true)
|
||||
.pushNamed(Routes.pickerAddressBook);
|
||||
|
||||
if (contact is ContactRecord && contact.address != null) {
|
||||
if (contact is ContactBase && contact.address != null) {
|
||||
controller.text = contact.address;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,16 +113,19 @@ class SectionStandardList extends StatelessWidget {
|
||||
{@required this.itemCounter,
|
||||
@required this.itemBuilder,
|
||||
@required this.sectionCount,
|
||||
this.sectionTitleBuilder,
|
||||
this.hasTopSeparator = false,
|
||||
BuildContext context})
|
||||
: totalRows = transform(hasTopSeparator, context, sectionCount,
|
||||
itemCounter, itemBuilder);
|
||||
itemCounter, itemBuilder, sectionTitleBuilder);
|
||||
|
||||
final int sectionCount;
|
||||
final bool hasTopSeparator;
|
||||
final int Function(int sectionIndex) itemCounter;
|
||||
final Widget Function(BuildContext context, int sectionIndex, int itemIndex)
|
||||
itemBuilder;
|
||||
final Widget Function(BuildContext context, int sectionIndex)
|
||||
sectionTitleBuilder;
|
||||
final List<Widget> totalRows;
|
||||
|
||||
static List<Widget> transform(
|
||||
@@ -131,14 +134,20 @@ class SectionStandardList extends StatelessWidget {
|
||||
int sectionCount,
|
||||
int Function(int sectionIndex) itemCounter,
|
||||
Widget Function(BuildContext context, int sectionIndex, int itemIndex)
|
||||
itemBuilder) {
|
||||
itemBuilder,
|
||||
Widget Function(BuildContext context, int sectionIndex)
|
||||
sectionTitleBuilder) {
|
||||
final items = <Widget>[];
|
||||
|
||||
for (var sectionIndex = 0; sectionIndex < sectionCount; sectionIndex++) {
|
||||
if ((sectionIndex == 0)&&(hasTopSeparator)) {
|
||||
if ((sectionIndex == 0) && (hasTopSeparator)) {
|
||||
items.add(StandardListSeparator(padding: EdgeInsets.only(left: 24)));
|
||||
}
|
||||
|
||||
if (sectionTitleBuilder != null) {
|
||||
items.add(sectionTitleBuilder(context, sectionIndex));
|
||||
}
|
||||
|
||||
final itemCount = itemCounter(sectionIndex);
|
||||
|
||||
for (var itemIndex = 0; itemIndex < itemCount; itemIndex++) {
|
||||
|
||||
Reference in New Issue
Block a user