cake_wallet/lib/src/screens/dashboard/dashboard_page.dart

74 lines
2 KiB
Dart
Raw Normal View History

2020-05-01 19:24:31 +00:00
import 'package:cake_wallet/src/screens/dashboard/widgets/menu_widget.dart';
2020-01-04 19:31:52 +00:00
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:cake_wallet/palette.dart';
import 'package:cake_wallet/src/screens/base_page.dart';
2020-04-14 18:15:47 +00:00
import 'package:cake_wallet/src/screens/dashboard/widgets/wallet_card.dart';
import 'package:cake_wallet/src/screens/dashboard/widgets/trade_history_panel.dart';
2020-01-04 19:31:52 +00:00
class DashboardPage extends BasePage {
final _bodyKey = GlobalKey();
2020-04-14 18:15:47 +00:00
@override
Color get backgroundColor => PaletteDark.mainBackgroundColor;
@override
Widget trailing(BuildContext context) {
final menuButton = Image.asset('assets/images/header.png');
return SizedBox(
height: 37,
width: 37,
child: ButtonTheme(
minWidth: double.minPositive,
child: FlatButton(
highlightColor: Colors.transparent,
splashColor: Colors.transparent,
padding: EdgeInsets.all(0),
2020-05-01 19:24:31 +00:00
onPressed: () async {
await showDialog<void>(
builder: (_) => MenuWidget(),
context: context
);
},
child: menuButton),
),
);
}
2020-01-04 19:31:52 +00:00
@override
Widget body(BuildContext context) => DashboardPageBody(key: _bodyKey);
}
class DashboardPageBody extends StatefulWidget {
DashboardPageBody({Key key}) : super(key: key);
@override
DashboardPageBodyState createState() => DashboardPageBodyState();
}
class DashboardPageBodyState extends State<DashboardPageBody> {
@override
Widget build(BuildContext context) {
2020-04-14 18:15:47 +00:00
return SafeArea(
child: Container(
color: PaletteDark.mainBackgroundColor,
2020-04-14 18:15:47 +00:00
child: Column(
children: <Widget>[
Padding(
padding: EdgeInsets.only(left: 20, top: 10),
2020-04-14 18:15:47 +00:00
child: WalletCard(),
),
2020-04-17 20:27:23 +00:00
SizedBox(
height: 28,
),
Expanded(child: TradeHistoryPanel())
2020-04-14 18:15:47 +00:00
],
),
),
);
2020-01-04 19:31:52 +00:00
}
}