commit
69b58d827b
@ -1,38 +0,0 @@
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:cake_wallet/store/contact_list_store.dart';
|
||||
import 'package:cake_wallet/entities/contact.dart';
|
||||
|
||||
class ContactService {
|
||||
ContactService(this.contactSource, this.contactListStore) {
|
||||
_forceUpdateContactListStore();
|
||||
}
|
||||
|
||||
final Box<Contact> contactSource;
|
||||
final ContactListStore contactListStore;
|
||||
|
||||
Future add(Contact contact) async {
|
||||
await contactSource.add(contact);
|
||||
// contactListStore.contacts.add(contact);
|
||||
}
|
||||
|
||||
Future update(Contact contact) async {
|
||||
await contact.save();
|
||||
final index = contactListStore.contacts.indexOf(contact) ?? -1;
|
||||
|
||||
if (index >= 0) {
|
||||
_forceUpdateContactListStore();
|
||||
} else {
|
||||
contactListStore.contacts.add(contact);
|
||||
}
|
||||
}
|
||||
|
||||
Future delete(Contact contact) async {
|
||||
await contact.delete();
|
||||
contactListStore.contacts.remove(contact);
|
||||
}
|
||||
|
||||
void _forceUpdateContactListStore() {
|
||||
contactListStore.contacts.clear();
|
||||
contactListStore.contacts.addAll(contactSource.values);
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:mobx/mobx.dart';
|
||||
import 'package:cake_wallet/entities/contact.dart';
|
||||
import 'package:cake_wallet/entities/crypto_currency.dart';
|
||||
import 'package:cake_wallet/entities/record.dart';
|
||||
|
||||
part 'contact_record.g.dart';
|
||||
|
||||
class ContactRecord = ContactRecordBase with _$ContactRecord;
|
||||
|
||||
abstract class ContactRecordBase extends Record<Contact> with Store {
|
||||
ContactRecordBase(Box<Contact> source, Contact original)
|
||||
: super(source, original);
|
||||
|
||||
@observable
|
||||
String name;
|
||||
|
||||
@observable
|
||||
String address;
|
||||
|
||||
@observable
|
||||
CryptoCurrency type;
|
||||
|
||||
@override
|
||||
void toBind(Contact original) {
|
||||
reaction((_) => name, (String name) => original.name = name);
|
||||
reaction((_) => address, (String address) => original.address = address);
|
||||
reaction(
|
||||
(_) => type,
|
||||
(CryptoCurrency currency) =>
|
||||
original.updateCryptoCurrency(currency: currency));
|
||||
}
|
||||
|
||||
@override
|
||||
void fromBind(Contact original) {
|
||||
name = original.name;
|
||||
address = original.address;
|
||||
type = original.type;
|
||||
}
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:devicelocale/devicelocale.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
const Map<String, String> languages = {
|
||||
'en': 'English',
|
||||
'de': 'Deutsch (German)',
|
||||
'es': 'Español (Spanish)',
|
||||
'hi': 'हिंदी (Hindi)',
|
||||
'ja': '日本 (Japanese)',
|
||||
'ko': '한국어 (Korean)',
|
||||
'nl': 'Nederlands (Dutch)',
|
||||
'pl': 'Polski (Polish)',
|
||||
'pt': 'Português (Portuguese)',
|
||||
'ru': 'Русский (Russian)',
|
||||
'uk': 'Українська (Ukrainian)',
|
||||
'zh': '中文 (Chinese)'
|
||||
};
|
||||
|
||||
class Language with ChangeNotifier {
|
||||
Language(this._currentLanguage);
|
||||
|
||||
String _currentLanguage;
|
||||
|
||||
String getCurrentLanguage() => _currentLanguage;
|
||||
|
||||
void setCurrentLanguage(String language) {
|
||||
_currentLanguage = language;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
static Future<String> localeDetection() async {
|
||||
var locale = await Devicelocale.currentLocale;
|
||||
locale = Intl.shortLocale(locale);
|
||||
|
||||
return languages.keys.contains(locale) ? locale : 'en';
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
import 'package:devicelocale/devicelocale.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
class LanguageService {
|
||||
static const Map<String, String> list = {
|
||||
'en': 'English',
|
||||
'de': 'Deutsch (German)',
|
||||
'es': 'Español (Spanish)',
|
||||
'hi': 'हिंदी (Hindi)',
|
||||
'ja': '日本 (Japanese)',
|
||||
'ko': '한국어 (Korean)',
|
||||
'nl': 'Nederlands (Dutch)',
|
||||
'pl': 'Polski (Polish)',
|
||||
'pt': 'Português (Portuguese)',
|
||||
'ru': 'Русский (Russian)',
|
||||
'uk': 'Українська (Ukrainian)',
|
||||
'zh': '中文 (Chinese)'
|
||||
};
|
||||
|
||||
static Future<String> localeDetection() async {
|
||||
var locale = await Devicelocale.currentLocale;
|
||||
locale = Intl.shortLocale(locale);
|
||||
|
||||
return list.keys.contains(locale) ? locale : 'en';
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:cake_wallet/utils/mobx.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
|
||||
abstract class Record<T extends HiveObject> with Keyable {
|
||||
Record(this._source, this.original) {
|
||||
key = original.key;
|
||||
_listener?.cancel();
|
||||
_listener = _source.watch(key: original.key).listen((event) {
|
||||
if (!event.deleted) {
|
||||
fromBind(event.value as T);
|
||||
}
|
||||
});
|
||||
|
||||
fromBind(original);
|
||||
toBind(original);
|
||||
}
|
||||
|
||||
dynamic key;
|
||||
|
||||
@override
|
||||
dynamic get keyIndex => key;
|
||||
|
||||
final T original;
|
||||
|
||||
final Box<T> _source;
|
||||
|
||||
StreamSubscription<BoxEvent> _listener;
|
||||
|
||||
void fromBind(T original);
|
||||
|
||||
void toBind(T original);
|
||||
|
||||
Future<void> save() => original.save();
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
import 'package:mobx/mobx.dart';
|
||||
import 'package:cake_wallet/entities/node.dart';
|
||||
import 'package:cake_wallet/store/app_store.dart';
|
||||
|
||||
ReactionDisposer _onCurrentNodeChangeReaction;
|
||||
|
||||
void startOnCurrentNodeChangeReaction(AppStore appStore) {
|
||||
_onCurrentNodeChangeReaction?.reaction?.dispose();
|
||||
_onCurrentNodeChangeReaction =
|
||||
reaction((_) => appStore.settingsStore.currentNode, (Node node) async {
|
||||
try {
|
||||
await appStore.wallet.connectToNode(node: node);
|
||||
} catch (e) {
|
||||
print(e.toString());
|
||||
}
|
||||
});
|
||||
}
|
@ -1,98 +0,0 @@
|
||||
// import 'dart:async';
|
||||
// import 'package:flutter/foundation.dart';
|
||||
// import 'package:mobx/mobx.dart';
|
||||
// import 'package:cake_wallet/entities/node.dart';
|
||||
// import 'package:cake_wallet/entities/sync_status.dart';
|
||||
// import 'package:cake_wallet/src/domain/services/wallet_service.dart';
|
||||
// import 'package:cake_wallet/src/start_updating_price.dart';
|
||||
// import 'package:cake_wallet/src/stores/sync/sync_store.dart';
|
||||
// import 'package:cake_wallet/src/stores/wallet/wallet_store.dart';
|
||||
// import 'package:cake_wallet/src/stores/settings/settings_store.dart';
|
||||
// import 'package:cake_wallet/src/stores/price/price_store.dart';
|
||||
// import 'package:cake_wallet/src/stores/authentication/authentication_store.dart';
|
||||
// import 'package:cake_wallet/src/stores/login/login_store.dart';
|
||||
//
|
||||
// Timer _reconnectionTimer;
|
||||
// ReactionDisposer _connectToNodeDisposer;
|
||||
// ReactionDisposer _onSyncStatusChangeDisposer;
|
||||
// ReactionDisposer _onCurrentWalletChangeDisposer;
|
||||
//
|
||||
// void setReactions(
|
||||
// {@required SettingsStore settingsStore,
|
||||
// @required PriceStore priceStore,
|
||||
// @required SyncStore syncStore,
|
||||
// @required WalletStore walletStore,
|
||||
// @required WalletService walletService,
|
||||
// // @required AuthenticationStore authenticationStore,
|
||||
// @required LoginStore loginStore}) {
|
||||
// connectToNode(settingsStore: settingsStore, walletStore: walletStore);
|
||||
// onSyncStatusChange(
|
||||
// syncStore: syncStore,
|
||||
// walletStore: walletStore,
|
||||
// settingsStore: settingsStore);
|
||||
// onCurrentWalletChange(
|
||||
// walletStore: walletStore,
|
||||
// settingsStore: settingsStore,
|
||||
// priceStore: priceStore);
|
||||
// autorun((_) async {
|
||||
// // if (authenticationStore.state == AuthenticationState.allowed) {
|
||||
// // await loginStore.loadCurrentWallet();
|
||||
// // authenticationStore.state = AuthenticationState.readyToLogin;
|
||||
// // }
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// void connectToNode({SettingsStore settingsStore, WalletStore walletStore}) {
|
||||
// _connectToNodeDisposer?.call();
|
||||
//
|
||||
// _connectToNodeDisposer = reaction((_) => settingsStore.node,
|
||||
// (Node node) async => await walletStore.connectToNode(node: node));
|
||||
// }
|
||||
//
|
||||
// void onCurrentWalletChange(
|
||||
// {WalletStore walletStore,
|
||||
// SettingsStore settingsStore,
|
||||
// PriceStore priceStore}) {
|
||||
// _onCurrentWalletChangeDisposer?.call();
|
||||
//
|
||||
// reaction((_) => walletStore.name, (String _) {
|
||||
// walletStore.connectToNode(node: settingsStore.node);
|
||||
// startUpdatingPrice(settingsStore: settingsStore, priceStore: priceStore);
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// void onSyncStatusChange(
|
||||
// {SyncStore syncStore,
|
||||
// WalletStore walletStore,
|
||||
// SettingsStore settingsStore}) {
|
||||
// // _onSyncStatusChangeDisposer?.call();
|
||||
//
|
||||
// // reaction((_) => syncStore.status, (SyncStatus status) async {
|
||||
// // if (status is ConnectedSyncStatus) {
|
||||
// // await walletStore.startSync();
|
||||
// // }
|
||||
//
|
||||
// // // Reconnect to the node if the app is not started sync after 30 seconds
|
||||
// // if (status is StartingSyncStatus) {
|
||||
// // startReconnectionObserver(syncStore: syncStore, walletStore: walletStore);
|
||||
// // }
|
||||
// // });
|
||||
// }
|
||||
//
|
||||
// void startReconnectionObserver({SyncStore syncStore, WalletStore walletStore}) {
|
||||
// if (_reconnectionTimer != null) {
|
||||
// _reconnectionTimer.cancel();
|
||||
// }
|
||||
//
|
||||
// _reconnectionTimer = Timer.periodic(Duration(minutes: 1), (_) async {
|
||||
// try {
|
||||
// final isConnected = await walletStore.isConnected();
|
||||
//
|
||||
// if (!isConnected) {
|
||||
// await walletStore.reconnect();
|
||||
// }
|
||||
// } catch (e) {
|
||||
// print(e);
|
||||
// }
|
||||
// });
|
||||
// }
|
@ -1,33 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:cake_wallet/exchange/trade.dart';
|
||||
// import 'package:cake_wallet/monero/transaction_description.dart';
|
||||
// import 'package:cake_wallet/src/domain/services/wallet_service.dart';
|
||||
// import 'package:cake_wallet/src/screens/dashboard/dashboard_page.dart';
|
||||
// import 'package:cake_wallet/src/stores/action_list/action_list_store.dart';
|
||||
// import 'package:cake_wallet/src/stores/action_list/trade_filter_store.dart';
|
||||
// import 'package:cake_wallet/src/stores/action_list/transaction_filter_store.dart';
|
||||
// import 'package:cake_wallet/src/stores/price/price_store.dart';
|
||||
// import 'package:cake_wallet/src/stores/settings/settings_store.dart';
|
||||
// import 'package:cake_wallet/src/stores/wallet/wallet_store.dart';
|
||||
|
||||
// FIXME: Remove me.
|
||||
|
||||
// Widget createDashboardPage(
|
||||
// {@required WalletService walletService,
|
||||
// @required PriceStore priceStore,
|
||||
// @required Box<TransactionDescription> transactionDescriptions,
|
||||
// @required SettingsStore settingsStore,
|
||||
// @required Box<Trade> trades,
|
||||
// @required WalletStore walletStore}) =>
|
||||
// Provider(
|
||||
// create: (_) => ActionListStore(
|
||||
// walletService: walletService,
|
||||
// settingsStore: settingsStore,
|
||||
// priceStore: priceStore,
|
||||
// tradesSource: trades,
|
||||
// transactionFilterStore: TransactionFilterStore(),
|
||||
// tradeFilterStore: TradeFilterStore(walletStore: walletStore),
|
||||
// transactionDescriptions: transactionDescriptions),
|
||||
// child: DashboardPage());
|
@ -0,0 +1,61 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
|
||||
class FAQItem extends StatefulWidget {
|
||||
FAQItem(this.title, this.text);
|
||||
|
||||
final String title;
|
||||
final String text;
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() => FAQItemState();
|
||||
}
|
||||
|
||||
class FAQItemState extends State<FAQItem> {
|
||||
bool isActive;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
isActive = false;
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final addIcon =
|
||||
Icon(Icons.add, color: Theme.of(context).primaryTextTheme.title.color);
|
||||
final removeIcon = Icon(Icons.remove, color: Palette.blueCraiola);
|
||||
final icon = isActive ? removeIcon : addIcon;
|
||||
final color = isActive
|
||||
? Palette.blueCraiola
|
||||
: Theme.of(context).primaryTextTheme.title.color;
|
||||
|
||||
return ListTileTheme(
|
||||
contentPadding: EdgeInsets.fromLTRB(0, 6, 24, 6),
|
||||
child: ExpansionTile(
|
||||
title: Text(widget.title,
|
||||
style: TextStyle(
|
||||
fontSize: 14, fontWeight: FontWeight.w500, color: color)),
|
||||
trailing: icon,
|
||||
onExpansionChanged: (value) => setState(() => isActive = value),
|
||||
children: <Widget>[
|
||||
Row(mainAxisAlignment: MainAxisAlignment.start, children: <Widget>[
|
||||
Expanded(
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(
|
||||
right: 24.0,
|
||||
),
|
||||
child: Text(
|
||||
widget.text,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.normal,
|
||||
color: Theme.of(context).primaryTextTheme.title.color),
|
||||
),
|
||||
))
|
||||
])
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
import 'dart:ui';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
||||
class WalletMenuItem {
|
||||
WalletMenuItem({
|
||||
@required this.title,
|
||||
@required this.firstGradientColor,
|
||||
@required this.secondGradientColor,
|
||||
@required this.image
|
||||
});
|
||||
|
||||
final String title;
|
||||
final Color firstGradientColor;
|
||||
final Color secondGradientColor;
|
||||
final Image image;
|
||||
}
|
@ -0,0 +1,112 @@
|
||||
import 'dart:ui';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
import 'package:cake_wallet/src/screens/wallet_list/wallet_menu.dart';
|
||||
import 'package:cake_wallet/src/screens/wallet_list/wallet_menu_item.dart';
|
||||
import 'package:cake_wallet/view_model/wallet_list/wallet_list_item.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:cake_wallet/src/widgets/alert_background.dart';
|
||||
import 'package:cake_wallet/src/widgets/alert_close_button.dart';
|
||||
|
||||
class WalletMenuAlert extends StatelessWidget {
|
||||
WalletMenuAlert({
|
||||
@required this.wallet,
|
||||
@required this.walletMenu,
|
||||
@required this.items
|
||||
});
|
||||
|
||||
final WalletListItem wallet;
|
||||
final WalletMenu walletMenu;
|
||||
final List<WalletMenuItem> items;
|
||||
final closeButton = Image.asset('assets/images/close.png',
|
||||
color: Palette.darkBlueCraiola,
|
||||
);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AlertBackground(
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: EdgeInsets.only(
|
||||
left: 24,
|
||||
right: 24,
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.all(Radius.circular(14)),
|
||||
child: Container(
|
||||
color: Theme.of(context).textTheme.body2.decorationColor,
|
||||
padding: EdgeInsets.only(left: 24),
|
||||
child: ListView.separated(
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemCount: items.length,
|
||||
separatorBuilder: (context, _) => Container(
|
||||
height: 1,
|
||||
color: Theme.of(context).accentTextTheme.subhead.backgroundColor,
|
||||
),
|
||||
itemBuilder: (_, index) {
|
||||
final item = items[index];
|
||||
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
walletMenu.action(
|
||||
walletMenu.menuItems.indexOf(item),
|
||||
wallet);
|
||||
},
|
||||
child: Container(
|
||||
height: 60,
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
height: 32,
|
||||
width: 32,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(4)),
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [
|
||||
item.firstGradientColor,
|
||||
item.secondGradientColor
|
||||
]
|
||||
)
|
||||
),
|
||||
child: Center(
|
||||
child: item.image,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Text(
|
||||
item.title,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).primaryTextTheme.title.color,
|
||||
fontSize: 18,
|
||||
fontFamily: 'Poppins',
|
||||
fontWeight: FontWeight.w500,
|
||||
decoration: TextDecoration.none
|
||||
),
|
||||
)
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
AlertCloseButton(image: closeButton)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -1,151 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
||||
class WalletTile extends SliverPersistentHeaderDelegate {
|
||||
WalletTile({
|
||||
@required this.min,
|
||||
@required this.max,
|
||||
@required this.image,
|
||||
@required this.walletName,
|
||||
@required this.walletAddress,
|
||||
@required this.isCurrent
|
||||
});
|
||||
|
||||
final double min;
|
||||
final double max;
|
||||
final Image image;
|
||||
final String walletName;
|
||||
final String walletAddress;
|
||||
final bool isCurrent;
|
||||
final double tileHeight = 60;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, double shrinkOffset, bool overlapsContent) {
|
||||
var opacity = 1 - shrinkOffset / (max - min);
|
||||
opacity = opacity >= 0 ? opacity : 0;
|
||||
|
||||
var panelWidth = 10 * opacity;
|
||||
panelWidth = panelWidth < 10 ? 0 : 10;
|
||||
|
||||
final currentColor = isCurrent
|
||||
? Theme.of(context).accentTextTheme.subtitle.decorationColor
|
||||
: Theme.of(context).backgroundColor;
|
||||
|
||||
return Stack(
|
||||
fit: StackFit.expand,
|
||||
overflow: Overflow.visible,
|
||||
children: <Widget>[
|
||||
Positioned(
|
||||
top: 0,
|
||||
right: max - 4,
|
||||
child: Container(
|
||||
height: tileHeight,
|
||||
width: 4,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.only(topRight: Radius.circular(4), bottomRight: Radius.circular(4)),
|
||||
color: currentColor
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 0,
|
||||
right: 10,
|
||||
child: Container(
|
||||
height: tileHeight,
|
||||
width: max - 14,
|
||||
padding: EdgeInsets.only(left: 20, right: 20),
|
||||
color: Theme.of(context).backgroundColor,
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Row(
|
||||
//mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
image,
|
||||
SizedBox(width: 10),
|
||||
Text(
|
||||
walletName,
|
||||
style: TextStyle(
|
||||
fontSize: 22,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Theme.of(context).primaryTextTheme.title.color
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
/*Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
image,
|
||||
SizedBox(width: 10),
|
||||
Text(
|
||||
walletName,
|
||||
style: TextStyle(
|
||||
fontSize: 22,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Theme.of(context).primaryTextTheme.title.color
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
isCurrent ? SizedBox(height: 5) : Offstage(),
|
||||
isCurrent
|
||||
? Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
SizedBox(width: 34),
|
||||
Text(
|
||||
walletAddress,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Theme.of(context).primaryTextTheme.caption.color
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
: Offstage()
|
||||
],
|
||||
),*/
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 0,
|
||||
right: 0,
|
||||
child: Opacity(
|
||||
opacity: opacity,
|
||||
child: Container(
|
||||
height: tileHeight,
|
||||
width: panelWidth,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.only(topLeft: Radius.circular(10), bottomLeft: Radius.circular(10)),
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [
|
||||
Theme.of(context).accentTextTheme.headline.color,
|
||||
Theme.of(context).accentTextTheme.headline.backgroundColor
|
||||
]
|
||||
)
|
||||
),
|
||||
),
|
||||
)
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
double get maxExtent => max;
|
||||
|
||||
@override
|
||||
double get minExtent => min;
|
||||
|
||||
@override
|
||||
bool shouldRebuild(SliverPersistentHeaderDelegate oldDelegate) => true;
|
||||
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
import 'package:mobx/mobx.dart';
|
||||
import 'package:cake_wallet/entities/contact.dart';
|
||||
|
||||
part 'contact_list_store.g.dart';
|
||||
|
||||
class ContactListStore = ContactListStoreBase with _$ContactListStore;
|
||||
|
||||
abstract class ContactListStoreBase with Store {
|
||||
ContactListStoreBase() : contacts = ObservableList<Contact>();
|
||||
|
||||
final ObservableList<Contact> contacts;
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
import 'package:cake_wallet/theme_changer.dart';
|
||||
import 'package:mobx/mobx.dart';
|
||||
|
||||
part 'theme_changer_store.g.dart';
|
||||
|
||||
class ThemeChangerStore = ThemeChangerStoreBase with _$ThemeChangerStore;
|
||||
|
||||
abstract class ThemeChangerStoreBase with Store {
|
||||
ThemeChangerStoreBase({this.themeChanger});
|
||||
|
||||
@observable
|
||||
ThemeChanger themeChanger;
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ThemeChanger with ChangeNotifier {
|
||||
|
||||
ThemeChanger(this._themeData);
|
||||
|
||||
ThemeData _themeData;
|
||||
|
||||
ThemeData getTheme() => _themeData;
|
||||
|
||||
void setTheme(ThemeData theme){
|
||||
_themeData = theme;
|
||||
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
@ -1,11 +1,18 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:mobx/mobx.dart';
|
||||
import 'package:cake_wallet/utils/mobx.dart';
|
||||
|
||||
// part 'node_list_view_model.g.dart';
|
||||
//
|
||||
// class NodeListViewModel = NodeListViewModelBase with _$NodeListViewModel;
|
||||
|
||||
class ItemCell<Item> with Keyable {
|
||||
ItemCell(this.value, {@required this.isSelected, @required dynamic key}) {
|
||||
ItemCell(this.value, {this.isSelectedBuilder, @required dynamic key}) {
|
||||
keyIndex = key;
|
||||
}
|
||||
|
||||
final Item value;
|
||||
final bool isSelected;
|
||||
|
||||
bool get isSelected => isSelectedBuilder(value);
|
||||
bool Function(Item item) isSelectedBuilder;
|
||||
}
|
||||
|
@ -0,0 +1,22 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
Future<T> showPopUp<T>({
|
||||
@required BuildContext context,
|
||||
WidgetBuilder builder,
|
||||
bool barrierDismissible = true,
|
||||
Color barrierColor,
|
||||
bool useSafeArea = false,
|
||||
bool useRootNavigator = true,
|
||||
RouteSettings routeSettings,
|
||||
Widget child,
|
||||
}) {
|
||||
return showDialog<T>(
|
||||
context: context,
|
||||
builder: builder,
|
||||
barrierDismissible: barrierDismissible,
|
||||
barrierColor: barrierColor,
|
||||
useSafeArea: useSafeArea,
|
||||
useRootNavigator: useRootNavigator,
|
||||
routeSettings: routeSettings,
|
||||
child: child);
|
||||
}
|
Loading…
Reference in new issue