mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-11-18 09:54:01 +01:00
Flutter upgrade
This commit is contained in:
@@ -2,8 +2,8 @@ import 'package:flutter/material.dart';
|
||||
|
||||
class ActionButton extends StatelessWidget {
|
||||
ActionButton(
|
||||
{@required this.image,
|
||||
@required this.title,
|
||||
{required this.image,
|
||||
required this.title,
|
||||
this.route,
|
||||
this.onClick,
|
||||
this.alignment = Alignment.center,
|
||||
@@ -11,22 +11,17 @@ class ActionButton extends StatelessWidget {
|
||||
|
||||
final Image image;
|
||||
final String title;
|
||||
final String route;
|
||||
final String? route;
|
||||
final Alignment alignment;
|
||||
final void Function() onClick;
|
||||
final Color textColor;
|
||||
final VoidCallback? onClick;
|
||||
final Color? textColor;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var _textColor = textColor ?? Theme.of(context)
|
||||
.accentTextTheme
|
||||
.display3
|
||||
.backgroundColor;
|
||||
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
if (route?.isNotEmpty ?? false) {
|
||||
Navigator.of(context, rootNavigator: true).pushNamed(route);
|
||||
Navigator.of(context, rootNavigator: true).pushNamed(route!);
|
||||
} else {
|
||||
onClick?.call();
|
||||
}
|
||||
@@ -50,7 +45,7 @@ class ActionButton extends StatelessWidget {
|
||||
title,
|
||||
style: TextStyle(
|
||||
fontSize: 10,
|
||||
color: _textColor),
|
||||
color: textColor ?? Theme.of(context).accentTextTheme!.headline2!.backgroundColor!),
|
||||
)
|
||||
],
|
||||
),
|
||||
|
||||
@@ -17,9 +17,10 @@ import 'package:keyboard_actions/keyboard_actions.dart';
|
||||
import 'package:mobx/mobx.dart';
|
||||
|
||||
class AddressPage extends BasePage {
|
||||
AddressPage({@required this.addressListViewModel,
|
||||
this.walletViewModel})
|
||||
: _cryptoAmountFocus = FocusNode();
|
||||
AddressPage({
|
||||
required this.addressListViewModel,
|
||||
required this.walletViewModel})
|
||||
: _cryptoAmountFocus = FocusNode();
|
||||
|
||||
final WalletAddressListViewModel addressListViewModel;
|
||||
final DashboardViewModel walletViewModel;
|
||||
@@ -42,7 +43,7 @@ class AddressPage extends BasePage {
|
||||
@override
|
||||
Widget leading(BuildContext context) {
|
||||
final _backButton = Icon(Icons.arrow_back_ios,
|
||||
color: Theme.of(context).accentTextTheme.display3.backgroundColor,
|
||||
color: Theme.of(context).accentTextTheme!.headline2!.backgroundColor!,
|
||||
size: 16,);
|
||||
|
||||
return SizedBox(
|
||||
@@ -50,10 +51,11 @@ class AddressPage extends BasePage {
|
||||
width: 37,
|
||||
child: ButtonTheme(
|
||||
minWidth: double.minPositive,
|
||||
child: FlatButton(
|
||||
highlightColor: Colors.transparent,
|
||||
splashColor: Colors.transparent,
|
||||
padding: EdgeInsets.all(0),
|
||||
child: TextButton(
|
||||
// FIX-ME: Style
|
||||
//highlightColor: Colors.transparent,
|
||||
//splashColor: Colors.transparent,
|
||||
//padding: EdgeInsets.all(0),
|
||||
onPressed: () => onClose(context),
|
||||
child: _backButton),
|
||||
),
|
||||
@@ -68,7 +70,7 @@ class AddressPage extends BasePage {
|
||||
fontSize: 18.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontFamily: 'Lato',
|
||||
color: Theme.of(context).accentTextTheme.display3.backgroundColor),
|
||||
color: Theme.of(context).accentTextTheme!.headline2!.backgroundColor!),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -115,7 +117,7 @@ class AddressPage extends BasePage {
|
||||
config: KeyboardActionsConfig(
|
||||
keyboardActionsPlatform: KeyboardActionsPlatform.IOS,
|
||||
keyboardBarColor:
|
||||
Theme.of(context).accentTextTheme.body2.backgroundColor,
|
||||
Theme.of(context).accentTextTheme!.bodyText1!.backgroundColor!,
|
||||
nextFocus: false,
|
||||
actions: [
|
||||
KeyboardActionsItem(
|
||||
@@ -148,7 +150,7 @@ class AddressPage extends BasePage {
|
||||
BorderRadius.all(Radius.circular(25)),
|
||||
border: Border.all(
|
||||
color:
|
||||
Theme.of(context).textTheme.subhead.color,
|
||||
Theme.of(context).textTheme!.subtitle1!.color!,
|
||||
width: 1),
|
||||
color: Theme.of(context).buttonColor),
|
||||
child: Row(
|
||||
@@ -166,17 +168,17 @@ class AddressPage extends BasePage {
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context)
|
||||
.accentTextTheme
|
||||
.display3
|
||||
.backgroundColor),
|
||||
.accentTextTheme!
|
||||
.headline2!
|
||||
.backgroundColor!),
|
||||
)),
|
||||
Icon(
|
||||
Icons.arrow_forward_ios,
|
||||
size: 14,
|
||||
color: Theme.of(context)
|
||||
.accentTextTheme
|
||||
.display3
|
||||
.backgroundColor,
|
||||
.accentTextTheme!
|
||||
.headline2!
|
||||
.backgroundColor!,
|
||||
)
|
||||
],
|
||||
),
|
||||
@@ -188,9 +190,9 @@ class AddressPage extends BasePage {
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
color: Theme.of(context)
|
||||
.accentTextTheme
|
||||
.display2
|
||||
.backgroundColor));
|
||||
.accentTextTheme!
|
||||
.headline3!
|
||||
.backgroundColor!));
|
||||
})
|
||||
],
|
||||
),
|
||||
|
||||
@@ -12,7 +12,7 @@ import 'package:cake_wallet/generated/i18n.dart';
|
||||
|
||||
|
||||
class BalancePage extends StatelessWidget{
|
||||
BalancePage({@required this.dashboardViewModel, @required this.settingsStore});
|
||||
BalancePage({required this.dashboardViewModel, required this.settingsStore});
|
||||
|
||||
final DashboardViewModel dashboardViewModel;
|
||||
final SettingsStore settingsStore;
|
||||
@@ -40,9 +40,9 @@ class BalancePage extends StatelessWidget{
|
||||
fontFamily: 'Lato',
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Theme.of(context)
|
||||
.accentTextTheme
|
||||
.display3
|
||||
.backgroundColor,
|
||||
.accentTextTheme!
|
||||
.headline2!
|
||||
.backgroundColor!,
|
||||
height: 1),
|
||||
maxLines: 1,
|
||||
textAlign: TextAlign.center);
|
||||
@@ -82,19 +82,19 @@ class BalancePage extends StatelessWidget{
|
||||
}
|
||||
|
||||
Widget buildBalanceRow(BuildContext context,
|
||||
{String availableBalanceLabel,
|
||||
String availableBalance,
|
||||
String availableFiatBalance,
|
||||
String additionalBalanceLabel,
|
||||
String additionalBalance,
|
||||
String additionalFiatBalance,
|
||||
String currency}) {
|
||||
{required String availableBalanceLabel,
|
||||
required String availableBalance,
|
||||
required String availableFiatBalance,
|
||||
required String additionalBalanceLabel,
|
||||
required String additionalBalance,
|
||||
required String additionalFiatBalance,
|
||||
required String currency}) {
|
||||
return Container(
|
||||
margin: const EdgeInsets.only(left: 16, right: 16),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(30.0),
|
||||
border: Border.all(color: settingsStore.currentTheme.type == ThemeType.bright ? Color.fromRGBO(255, 255, 255, 0.2): Colors.transparent, width: 1, ),
|
||||
color:Theme.of(context).textTheme.title.backgroundColor
|
||||
color:Theme.of(context).textTheme!.headline6!.backgroundColor!
|
||||
),
|
||||
child: Container(
|
||||
margin: const EdgeInsets.only(top: 16, left: 24, right: 24, bottom: 24),
|
||||
@@ -109,9 +109,9 @@ class BalancePage extends StatelessWidget{
|
||||
fontFamily: 'Lato',
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Theme.of(context)
|
||||
.accentTextTheme
|
||||
.display2
|
||||
.backgroundColor,
|
||||
.accentTextTheme!
|
||||
.headline3!
|
||||
.backgroundColor!,
|
||||
height: 1)),
|
||||
SizedBox(height: 5),
|
||||
Row(
|
||||
@@ -124,9 +124,9 @@ class BalancePage extends StatelessWidget{
|
||||
fontFamily: 'Lato',
|
||||
fontWeight: FontWeight.w900,
|
||||
color: Theme.of(context)
|
||||
.accentTextTheme
|
||||
.display3
|
||||
.backgroundColor,
|
||||
.accentTextTheme!
|
||||
.headline2!
|
||||
.backgroundColor!,
|
||||
height: 1),
|
||||
maxLines: 1,
|
||||
textAlign: TextAlign.center),
|
||||
@@ -136,9 +136,9 @@ class BalancePage extends StatelessWidget{
|
||||
fontFamily: 'Lato',
|
||||
fontWeight: FontWeight.w800,
|
||||
color: Theme.of(context)
|
||||
.accentTextTheme
|
||||
.display3
|
||||
.backgroundColor,
|
||||
.accentTextTheme!
|
||||
.headline2!
|
||||
.backgroundColor!,
|
||||
height: 1)),
|
||||
]),
|
||||
SizedBox(height: 4,),
|
||||
@@ -149,9 +149,9 @@ class BalancePage extends StatelessWidget{
|
||||
fontFamily: 'Lato',
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context)
|
||||
.accentTextTheme
|
||||
.display3
|
||||
.backgroundColor,
|
||||
.accentTextTheme!
|
||||
.headline2!
|
||||
.backgroundColor!,
|
||||
height: 1)),
|
||||
SizedBox(height: 26),
|
||||
Text('${additionalBalanceLabel}',
|
||||
@@ -161,9 +161,9 @@ class BalancePage extends StatelessWidget{
|
||||
fontFamily: 'Lato',
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Theme.of(context)
|
||||
.accentTextTheme
|
||||
.display2
|
||||
.backgroundColor,
|
||||
.accentTextTheme!
|
||||
.headline3!
|
||||
.backgroundColor!,
|
||||
height: 1)),
|
||||
SizedBox(height: 8),
|
||||
AutoSizeText(
|
||||
@@ -173,9 +173,9 @@ class BalancePage extends StatelessWidget{
|
||||
fontFamily: 'Lato',
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Theme.of(context)
|
||||
.accentTextTheme
|
||||
.display3
|
||||
.backgroundColor,
|
||||
.accentTextTheme!
|
||||
.headline2!
|
||||
.backgroundColor!,
|
||||
height: 1),
|
||||
maxLines: 1,
|
||||
textAlign: TextAlign.center),
|
||||
@@ -187,9 +187,9 @@ class BalancePage extends StatelessWidget{
|
||||
fontFamily: 'Lato',
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Theme.of(context)
|
||||
.accentTextTheme
|
||||
.display3
|
||||
.backgroundColor,
|
||||
.accentTextTheme!
|
||||
.headline2!
|
||||
.backgroundColor!,
|
||||
height: 1),
|
||||
)
|
||||
])),
|
||||
|
||||
@@ -4,7 +4,7 @@ import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/utils/date_formatter.dart';
|
||||
|
||||
class DateSectionRaw extends StatelessWidget {
|
||||
DateSectionRaw({this.date});
|
||||
DateSectionRaw({required this.date});
|
||||
|
||||
final DateTime date;
|
||||
|
||||
@@ -36,6 +36,6 @@ class DateSectionRaw extends StatelessWidget {
|
||||
child: Text(title,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Theme.of(context).textTheme.overline.backgroundColor)));
|
||||
color: Theme.of(context).textTheme!.overline!.backgroundColor!)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class FilterTile extends StatelessWidget {
|
||||
FilterTile({@required this.child});
|
||||
FilterTile({required this.child});
|
||||
|
||||
final Widget child;
|
||||
|
||||
|
||||
@@ -8,10 +8,10 @@ import 'package:cake_wallet/src/widgets/alert_background.dart';
|
||||
import 'package:cake_wallet/src/widgets/alert_close_button.dart';
|
||||
import 'package:cake_wallet/src/widgets/checkbox_widget.dart';
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:date_range_picker/date_range_picker.dart' as date_rage_picker;
|
||||
//import 'package:date_range_picker/date_range_picker.dart' as date_rage_picker;
|
||||
|
||||
class FilterWidget extends StatelessWidget {
|
||||
FilterWidget({@required this.dashboardViewModel});
|
||||
FilterWidget({required this.dashboardViewModel});
|
||||
|
||||
final DashboardViewModel dashboardViewModel;
|
||||
final backVector = Image.asset('assets/images/back_vector.png',
|
||||
@@ -46,14 +46,14 @@ class FilterWidget extends StatelessWidget {
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.all(Radius.circular(14)),
|
||||
child: Container(
|
||||
color: Theme.of(context).textTheme.body2.decorationColor,
|
||||
color: Theme.of(context).textTheme!.bodyText1!.decorationColor!,
|
||||
child: ListView.separated(
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemCount: dashboardViewModel.filterItems.length,
|
||||
separatorBuilder: (context, _) => Container(
|
||||
height: 1,
|
||||
color: Theme.of(context).accentTextTheme.subhead.backgroundColor,
|
||||
color: Theme.of(context).accentTextTheme!.subtitle1!.backgroundColor!,
|
||||
),
|
||||
itemBuilder: (_, index1) {
|
||||
final title = dashboardViewModel.filterItems.keys.elementAt(index1);
|
||||
@@ -71,7 +71,7 @@ class FilterWidget extends StatelessWidget {
|
||||
child: Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).accentTextTheme.subhead.color,
|
||||
color: Theme.of(context).accentTextTheme!.subtitle1!.color!,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
fontFamily: 'Lato',
|
||||
@@ -86,10 +86,10 @@ class FilterWidget extends StatelessWidget {
|
||||
separatorBuilder: (context, _) => Container(
|
||||
height: 1,
|
||||
padding: EdgeInsets.only(left: 24),
|
||||
color: Theme.of(context).textTheme.body2.decorationColor,
|
||||
color: Theme.of(context).textTheme!.bodyText1!.decorationColor!,
|
||||
child: Container(
|
||||
height: 1,
|
||||
color: Theme.of(context).accentTextTheme.subhead.backgroundColor,
|
||||
color: Theme.of(context).accentTextTheme!.subtitle1!.backgroundColor!,
|
||||
),
|
||||
),
|
||||
itemBuilder: (_, index2) {
|
||||
@@ -103,29 +103,29 @@ class FilterWidget extends StatelessWidget {
|
||||
)
|
||||
: GestureDetector(
|
||||
onTap: () async {
|
||||
final List<DateTime> picked =
|
||||
await date_rage_picker.showDatePicker(
|
||||
context: context,
|
||||
initialFirstDate: DateTime.now()
|
||||
.subtract(Duration(days: 1)),
|
||||
initialLastDate: (DateTime.now()),
|
||||
firstDate: DateTime(2015),
|
||||
lastDate: DateTime.now()
|
||||
.add(Duration(days: 1)));
|
||||
//final List<DateTime> picked =
|
||||
//await date_rage_picker.showDatePicker(
|
||||
// context: context,
|
||||
// initialFirstDate: DateTime.now()
|
||||
// .subtract(Duration(days: 1)),
|
||||
// initialLastDate: (DateTime.now()),
|
||||
// firstDate: DateTime(2015),
|
||||
// lastDate: DateTime.now()
|
||||
// .add(Duration(days: 1)));
|
||||
|
||||
if (picked != null && picked.length == 2) {
|
||||
dashboardViewModel.transactionFilterStore
|
||||
.changeStartDate(picked.first);
|
||||
dashboardViewModel.transactionFilterStore
|
||||
.changeEndDate(picked.last);
|
||||
}
|
||||
//if (picked != null && picked.length == 2) {
|
||||
// dashboardViewModel.transactionFilterStore
|
||||
// .changeStartDate(picked.first);
|
||||
// dashboardViewModel.transactionFilterStore
|
||||
// .changeEndDate(picked.last);
|
||||
//}
|
||||
},
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(left: 32),
|
||||
child: Text(
|
||||
item.caption,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).primaryTextTheme.title.color,
|
||||
color: Theme.of(context).primaryTextTheme!.headline6!.color!,
|
||||
fontSize: 18,
|
||||
fontFamily: 'Lato',
|
||||
fontWeight: FontWeight.w500,
|
||||
|
||||
@@ -5,14 +5,14 @@ import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
|
||||
|
||||
class HeaderRow extends StatelessWidget {
|
||||
HeaderRow({this.dashboardViewModel});
|
||||
HeaderRow({required this.dashboardViewModel});
|
||||
|
||||
final DashboardViewModel dashboardViewModel;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final filterIcon = Image.asset('assets/images/filter_icon.png',
|
||||
color: Theme.of(context).textTheme.caption.decorationColor);
|
||||
color: Theme.of(context).textTheme!.caption!.decorationColor!);
|
||||
|
||||
return Container(
|
||||
height: 52,
|
||||
@@ -27,7 +27,7 @@ class HeaderRow extends StatelessWidget {
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).accentTextTheme.display3.backgroundColor
|
||||
color: Theme.of(context).accentTextTheme!.headline2!.backgroundColor!
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
@@ -43,7 +43,7 @@ class HeaderRow extends StatelessWidget {
|
||||
width: 36,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Theme.of(context).textTheme.overline.color
|
||||
color: Theme.of(context).textTheme!.overline!.color!
|
||||
),
|
||||
child: filterIcon,
|
||||
),
|
||||
|
||||
@@ -9,7 +9,7 @@ import 'package:cake_wallet/generated/i18n.dart';
|
||||
|
||||
class MarketPlacePage extends StatelessWidget {
|
||||
|
||||
MarketPlacePage({@required this.dashboardViewModel});
|
||||
MarketPlacePage({required this.dashboardViewModel});
|
||||
|
||||
final DashboardViewModel dashboardViewModel;
|
||||
final _scrollController = ScrollController();
|
||||
@@ -35,7 +35,7 @@ class MarketPlacePage extends StatelessWidget {
|
||||
style: TextStyle(
|
||||
fontSize: 24,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).accentTextTheme.display3.backgroundColor,
|
||||
color: Theme.of(context).accentTextTheme!.headline2!.backgroundColor!,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
|
||||
@@ -19,10 +19,19 @@ class MenuWidget extends StatefulWidget {
|
||||
}
|
||||
|
||||
class MenuWidgetState extends State<MenuWidget> {
|
||||
Image moneroIcon;
|
||||
Image bitcoinIcon;
|
||||
Image litecoinIcon;
|
||||
Image havenIcon;
|
||||
MenuWidgetState()
|
||||
: this.menuWidth = 0,
|
||||
this.screenWidth = 0,
|
||||
this.screenHeight = 0,
|
||||
this.headerHeight = 120,
|
||||
this.tileHeight = 60,
|
||||
this.fromTopEdge = 50,
|
||||
this.fromBottomEdge = 25,
|
||||
this.moneroIcon = Image.asset('assets/images/monero_menu.png'),
|
||||
this.bitcoinIcon = Image.asset('assets/images/bitcoin_menu.png'),
|
||||
this.litecoinIcon = Image.asset('assets/images/litecoin_menu.png'),
|
||||
this.havenIcon = Image.asset('assets/images/haven_menu.png');
|
||||
|
||||
final largeScreen = 731;
|
||||
|
||||
double menuWidth;
|
||||
@@ -34,6 +43,11 @@ class MenuWidgetState extends State<MenuWidget> {
|
||||
double fromTopEdge;
|
||||
double fromBottomEdge;
|
||||
|
||||
Image moneroIcon;
|
||||
Image bitcoinIcon;
|
||||
Image litecoinIcon;
|
||||
Image havenIcon;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
menuWidth = 0;
|
||||
@@ -75,9 +89,9 @@ class MenuWidgetState extends State<MenuWidget> {
|
||||
final itemCount = walletMenu.items.length;
|
||||
|
||||
moneroIcon = Image.asset('assets/images/monero_menu.png',
|
||||
color: Theme.of(context).accentTextTheme.overline.decorationColor);
|
||||
color: Theme.of(context).accentTextTheme!.overline!.decorationColor!);
|
||||
bitcoinIcon = Image.asset('assets/images/bitcoin_menu.png',
|
||||
color: Theme.of(context).accentTextTheme.overline.decorationColor);
|
||||
color: Theme.of(context).accentTextTheme!.overline!.decorationColor!);
|
||||
litecoinIcon = Image.asset('assets/images/litecoin_menu.png');
|
||||
havenIcon = Image.asset('assets/images/haven_menu.png');
|
||||
|
||||
@@ -101,7 +115,7 @@ class MenuWidgetState extends State<MenuWidget> {
|
||||
topLeft: Radius.circular(24),
|
||||
bottomLeft: Radius.circular(24)),
|
||||
child: Container(
|
||||
color: Theme.of(context).textTheme.body2.decorationColor,
|
||||
color: Theme.of(context).textTheme!.bodyText1!.decorationColor!,
|
||||
child: ListView.separated(
|
||||
padding: EdgeInsets.only(top: 0),
|
||||
itemBuilder: (_, index) {
|
||||
@@ -112,13 +126,13 @@ class MenuWidgetState extends State<MenuWidget> {
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
Theme.of(context)
|
||||
.accentTextTheme
|
||||
.display1
|
||||
.color,
|
||||
.accentTextTheme!
|
||||
.headline4!
|
||||
.color!,
|
||||
Theme.of(context)
|
||||
.accentTextTheme
|
||||
.display1
|
||||
.decorationColor,
|
||||
.accentTextTheme!
|
||||
.headline4!
|
||||
.decorationColor!,
|
||||
],
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight),
|
||||
@@ -159,9 +173,9 @@ class MenuWidgetState extends State<MenuWidget> {
|
||||
.subname,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context)
|
||||
.accentTextTheme
|
||||
.overline
|
||||
.decorationColor,
|
||||
.accentTextTheme!
|
||||
.overline!
|
||||
.decorationColor!,
|
||||
fontWeight:
|
||||
FontWeight.w500,
|
||||
fontSize: 12),
|
||||
@@ -188,9 +202,9 @@ class MenuWidgetState extends State<MenuWidget> {
|
||||
},
|
||||
child: Container(
|
||||
color: Theme.of(context)
|
||||
.textTheme
|
||||
.body2
|
||||
.decorationColor,
|
||||
.textTheme!
|
||||
.bodyText1!
|
||||
.decorationColor!,
|
||||
height: isLastTile ? headerHeight : tileHeight,
|
||||
padding: isLastTile
|
||||
? EdgeInsets.only(
|
||||
@@ -212,9 +226,9 @@ class MenuWidgetState extends State<MenuWidget> {
|
||||
title,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context)
|
||||
.textTheme
|
||||
.display2
|
||||
.color,
|
||||
.textTheme!
|
||||
.headline3!
|
||||
.color!,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold),
|
||||
))
|
||||
@@ -225,9 +239,9 @@ class MenuWidgetState extends State<MenuWidget> {
|
||||
separatorBuilder: (_, index) => Container(
|
||||
height: 1,
|
||||
color: Theme.of(context)
|
||||
.primaryTextTheme
|
||||
.caption
|
||||
.decorationColor,
|
||||
.primaryTextTheme!
|
||||
.caption!
|
||||
.decorationColor!,
|
||||
),
|
||||
itemCount: itemCount + 1),
|
||||
)))
|
||||
@@ -235,7 +249,7 @@ class MenuWidgetState extends State<MenuWidget> {
|
||||
);
|
||||
}
|
||||
|
||||
Image _iconFor({@required WalletType type}) {
|
||||
Image _iconFor({required WalletType type}) {
|
||||
switch (type) {
|
||||
case WalletType.monero:
|
||||
return moneroIcon;
|
||||
@@ -246,7 +260,7 @@ class MenuWidgetState extends State<MenuWidget> {
|
||||
case WalletType.haven:
|
||||
return havenIcon;
|
||||
default:
|
||||
return null;
|
||||
throw Exception('No icon for ${type.toString()}');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,23 +4,23 @@ import 'package:flutter/material.dart';
|
||||
|
||||
class OrderRow extends StatelessWidget {
|
||||
OrderRow({
|
||||
@required this.onTap,
|
||||
@required this.provider,
|
||||
this.from,
|
||||
this.to,
|
||||
this.createdAtFormattedDate,
|
||||
required this.provider,
|
||||
required this.from,
|
||||
required this.to,
|
||||
required this.createdAtFormattedDate,
|
||||
this.onTap,
|
||||
this.formattedAmount});
|
||||
final VoidCallback onTap;
|
||||
final VoidCallback? onTap;
|
||||
final BuyProviderDescription provider;
|
||||
final String from;
|
||||
final String to;
|
||||
final String createdAtFormattedDate;
|
||||
final String formattedAmount;
|
||||
final String? formattedAmount;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final iconColor =
|
||||
Theme.of(context).primaryTextTheme.display4.backgroundColor;
|
||||
Theme.of(context).primaryTextTheme!.headline1!.backgroundColor!;
|
||||
|
||||
final providerIcon = getBuyProviderIcon(provider, iconColor: iconColor);
|
||||
|
||||
@@ -48,16 +48,14 @@ class OrderRow extends StatelessWidget {
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).accentTextTheme.
|
||||
display3.backgroundColor
|
||||
color: Theme.of(context).accentTextTheme!.headline2!.backgroundColor!
|
||||
)),
|
||||
formattedAmount != null
|
||||
? Text(formattedAmount + ' ' + to,
|
||||
? Text(formattedAmount! + ' ' + to,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).accentTextTheme.
|
||||
display3.backgroundColor
|
||||
color: Theme.of(context).accentTextTheme!.headline2!.backgroundColor!
|
||||
))
|
||||
: Container()
|
||||
]),
|
||||
@@ -68,8 +66,8 @@ class OrderRow extends StatelessWidget {
|
||||
Text(createdAtFormattedDate,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Theme.of(context).textTheme
|
||||
.overline.backgroundColor))
|
||||
color: Theme.of(context).textTheme!
|
||||
.overline!.backgroundColor!))
|
||||
])
|
||||
],
|
||||
)
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'package:cw_core/sync_status.dart';
|
||||
import 'package:cake_wallet/src/screens/dashboard/widgets/sync_indicator_icon.dart';
|
||||
|
||||
class SyncIndicator extends StatelessWidget {
|
||||
SyncIndicator({@required this.dashboardViewModel,this.onTap});
|
||||
SyncIndicator({required this.dashboardViewModel, required this.onTap});
|
||||
|
||||
final DashboardViewModel dashboardViewModel;
|
||||
final Function() onTap;
|
||||
@@ -32,7 +32,7 @@ class SyncIndicator extends StatelessWidget {
|
||||
child: Container(
|
||||
height: 30,
|
||||
width: syncIndicatorWidth,
|
||||
color: Theme.of(context).textTheme.title.decorationColor,
|
||||
color: Theme.of(context).textTheme!.headline6!.decorationColor!,
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: <Widget>[
|
||||
@@ -44,7 +44,7 @@ class SyncIndicator extends StatelessWidget {
|
||||
child: Container(
|
||||
width: indicatorWidth,
|
||||
height: 30,
|
||||
color: Theme.of(context).textTheme.title.backgroundColor,
|
||||
color: Theme.of(context).textTheme!.headline6!.backgroundColor!,
|
||||
)
|
||||
)
|
||||
: Offstage(),
|
||||
@@ -66,7 +66,7 @@ class SyncIndicator extends StatelessWidget {
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).textTheme.title.color
|
||||
color: Theme.of(context).textTheme!.headline6!.color!
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
@@ -26,14 +26,14 @@ class SyncIndicatorIcon extends StatelessWidget {
|
||||
if (boolMode) {
|
||||
indicatorColor = isSynced
|
||||
? PaletteDark.brightGreen
|
||||
: Theme.of(context).textTheme.caption.color;
|
||||
: Theme.of(context).textTheme!.caption!.color!;
|
||||
} else {
|
||||
switch (value.toLowerCase()) {
|
||||
case waiting:
|
||||
indicatorColor = Colors.red;
|
||||
break;
|
||||
case actionRequired:
|
||||
indicatorColor = Theme.of(context).textTheme.display3.decorationColor;
|
||||
indicatorColor = Theme.of(context).textTheme!.headline2!.decorationColor!;
|
||||
break;
|
||||
case created:
|
||||
indicatorColor = PaletteDark.brightGreen;
|
||||
|
||||
@@ -4,19 +4,19 @@ import 'package:cake_wallet/exchange/exchange_provider_description.dart';
|
||||
|
||||
class TradeRow extends StatelessWidget {
|
||||
TradeRow({
|
||||
this.provider,
|
||||
this.from,
|
||||
this.to,
|
||||
this.createdAtFormattedDate,
|
||||
this.formattedAmount,
|
||||
@required this.onTap});
|
||||
required this.provider,
|
||||
required this.from,
|
||||
required this.to,
|
||||
required this.createdAtFormattedDate,
|
||||
this.onTap,
|
||||
this.formattedAmount,});
|
||||
|
||||
final VoidCallback onTap;
|
||||
final VoidCallback? onTap;
|
||||
final ExchangeProviderDescription provider;
|
||||
final CryptoCurrency from;
|
||||
final CryptoCurrency to;
|
||||
final String createdAtFormattedDate;
|
||||
final String formattedAmount;
|
||||
final String? createdAtFormattedDate;
|
||||
final String? formattedAmount;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -31,7 +31,7 @@ class TradeRow extends StatelessWidget {
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
_getPoweredImage(provider),
|
||||
_getPoweredImage(provider)!,
|
||||
SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Column(
|
||||
@@ -44,16 +44,14 @@ class TradeRow extends StatelessWidget {
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).accentTextTheme.
|
||||
display3.backgroundColor
|
||||
color: Theme.of(context).accentTextTheme!.headline2!.backgroundColor!
|
||||
)),
|
||||
formattedAmount != null
|
||||
? Text(formattedAmount + ' ' + amountCrypto,
|
||||
? Text(formattedAmount! + ' ' + amountCrypto,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).accentTextTheme.
|
||||
display3.backgroundColor
|
||||
color: Theme.of(context).accentTextTheme!.headline2!.backgroundColor!
|
||||
))
|
||||
: Container()
|
||||
]),
|
||||
@@ -61,11 +59,12 @@ class TradeRow extends StatelessWidget {
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: <Widget>[
|
||||
Text(createdAtFormattedDate,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Theme.of(context).textTheme
|
||||
.overline.backgroundColor))
|
||||
if (createdAtFormattedDate != null)
|
||||
Text(createdAtFormattedDate!,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Theme.of(context).textTheme!
|
||||
.overline!.backgroundColor!))
|
||||
])
|
||||
],
|
||||
)
|
||||
@@ -75,8 +74,9 @@ class TradeRow extends StatelessWidget {
|
||||
));
|
||||
}
|
||||
|
||||
Image _getPoweredImage(ExchangeProviderDescription provider) {
|
||||
Image image;
|
||||
Image? _getPoweredImage(ExchangeProviderDescription provider) {
|
||||
Image? image;
|
||||
|
||||
switch (provider) {
|
||||
case ExchangeProviderDescription.xmrto:
|
||||
image = Image.asset('assets/images/xmrto.png', height: 36, width: 36);
|
||||
@@ -96,6 +96,7 @@ class TradeRow extends StatelessWidget {
|
||||
default:
|
||||
image = null;
|
||||
}
|
||||
|
||||
return image;
|
||||
}
|
||||
}
|
||||
@@ -4,12 +4,12 @@ import 'package:cake_wallet/generated/i18n.dart';
|
||||
|
||||
class TransactionRow extends StatelessWidget {
|
||||
TransactionRow(
|
||||
{this.direction,
|
||||
this.formattedDate,
|
||||
this.formattedAmount,
|
||||
this.formattedFiatAmount,
|
||||
this.isPending,
|
||||
@required this.onTap});
|
||||
{required this.direction,
|
||||
required this.formattedDate,
|
||||
required this.formattedAmount,
|
||||
required this.formattedFiatAmount,
|
||||
required this.isPending,
|
||||
required this.onTap});
|
||||
|
||||
final VoidCallback onTap;
|
||||
final TransactionDirection direction;
|
||||
@@ -34,7 +34,7 @@ class TransactionRow extends StatelessWidget {
|
||||
width: 36,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Theme.of(context).textTheme.overline.decorationColor
|
||||
color: Theme.of(context).textTheme!.overline!.decorationColor!
|
||||
),
|
||||
child: Image.asset(
|
||||
direction == TransactionDirection.incoming
|
||||
@@ -57,14 +57,14 @@ class TransactionRow extends StatelessWidget {
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).accentTextTheme.
|
||||
display3.backgroundColor)),
|
||||
color: Theme.of(context).accentTextTheme!
|
||||
.headline2!.backgroundColor!)),
|
||||
Text(formattedAmount,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).accentTextTheme.
|
||||
display3.backgroundColor))
|
||||
color: Theme.of(context).accentTextTheme!
|
||||
.headline2!.backgroundColor!))
|
||||
]),
|
||||
SizedBox(height: 5),
|
||||
Row(
|
||||
@@ -74,16 +74,16 @@ class TransactionRow extends StatelessWidget {
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Theme.of(context)
|
||||
.textTheme
|
||||
.overline
|
||||
.backgroundColor)),
|
||||
.textTheme!
|
||||
.overline!
|
||||
.backgroundColor!)),
|
||||
Text(formattedFiatAmount,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Theme.of(context)
|
||||
.textTheme
|
||||
.overline
|
||||
.backgroundColor))
|
||||
.textTheme!
|
||||
.overline!
|
||||
.backgroundColor!))
|
||||
])
|
||||
],
|
||||
)
|
||||
|
||||
@@ -15,7 +15,7 @@ import 'package:cake_wallet/routes.dart';
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
|
||||
class TransactionsPage extends StatelessWidget {
|
||||
TransactionsPage({@required this.dashboardViewModel});
|
||||
TransactionsPage({required this.dashboardViewModel});
|
||||
|
||||
final DashboardViewModel dashboardViewModel;
|
||||
|
||||
@@ -72,7 +72,9 @@ class TransactionsPage extends StatelessWidget {
|
||||
from: trade.from,
|
||||
to: trade.to,
|
||||
createdAtFormattedDate:
|
||||
DateFormat('HH:mm').format(trade.createdAt),
|
||||
trade.createdAt != null
|
||||
? DateFormat('HH:mm').format(trade.createdAt!)
|
||||
: null,
|
||||
formattedAmount: item.tradeFormattedAmount
|
||||
));
|
||||
}
|
||||
@@ -85,8 +87,8 @@ class TransactionsPage extends StatelessWidget {
|
||||
Routes.orderDetails,
|
||||
arguments: order),
|
||||
provider: order.provider,
|
||||
from: order.from,
|
||||
to: order.to,
|
||||
from: order.from!,
|
||||
to: order.to!,
|
||||
createdAtFormattedDate:
|
||||
DateFormat('HH:mm').format(order.createdAt),
|
||||
formattedAmount: item.orderFormattedAmount,
|
||||
@@ -103,8 +105,8 @@ class TransactionsPage extends StatelessWidget {
|
||||
S.of(context).placeholder_transactions,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Theme.of(context).primaryTextTheme
|
||||
.overline.decorationColor
|
||||
color: Theme.of(context).primaryTextTheme!
|
||||
.overline!.decorationColor!
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user