2020-05-13 18:26:15 +00:00
|
|
|
import 'dart:ui';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:cake_wallet/palette.dart';
|
|
|
|
import 'package:cake_wallet/src/stores/wallet/wallet_store.dart';
|
|
|
|
import 'package:cake_wallet/src/stores/exchange/exchange_store.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/base_page.dart';
|
2020-05-18 17:23:33 +00:00
|
|
|
import 'package:cake_wallet/src/screens/exchange/widgets/present_provider_picker.dart';
|
2020-05-14 17:29:10 +00:00
|
|
|
import 'package:cake_wallet/src/stores/exchange_template/exchange_template_store.dart';
|
2020-05-18 17:23:33 +00:00
|
|
|
import 'package:cake_wallet/src/screens/exchange/widgets/base_exchange_widget.dart';
|
|
|
|
import 'package:cake_wallet/generated/i18n.dart';
|
2020-05-13 18:26:15 +00:00
|
|
|
|
|
|
|
class ExchangeTemplatePage extends BasePage {
|
|
|
|
@override
|
2020-05-18 17:23:33 +00:00
|
|
|
String get title => S.current.exchange_new_template;
|
2020-05-13 18:26:15 +00:00
|
|
|
|
|
|
|
@override
|
2020-05-29 15:10:11 +00:00
|
|
|
Color get backgroundLightColor => Palette.darkLavender;
|
|
|
|
|
|
|
|
@override
|
|
|
|
Color get backgroundDarkColor => PaletteDark.moderateBlue;
|
2020-05-13 18:26:15 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget trailing(BuildContext context) {
|
|
|
|
final exchangeStore = Provider.of<ExchangeStore>(context);
|
|
|
|
|
2020-05-18 17:23:33 +00:00
|
|
|
return PresentProviderPicker(exchangeStore: exchangeStore);
|
2020-05-13 18:26:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget body(BuildContext context) => ExchangeTemplateForm();
|
|
|
|
}
|
|
|
|
|
|
|
|
class ExchangeTemplateForm extends StatefulWidget{
|
|
|
|
@override
|
|
|
|
ExchangeTemplateFormState createState() => ExchangeTemplateFormState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class ExchangeTemplateFormState extends State<ExchangeTemplateForm> {
|
2020-05-14 17:29:10 +00:00
|
|
|
|
2020-05-13 18:26:15 +00:00
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2020-05-14 17:29:10 +00:00
|
|
|
final exchangeStore = Provider.of<ExchangeStore>(context);
|
|
|
|
final walletStore = Provider.of<WalletStore>(context);
|
|
|
|
final exchangeTemplateStore = Provider.of<ExchangeTemplateStore>(context);
|
|
|
|
|
2020-05-18 17:23:33 +00:00
|
|
|
return BaseExchangeWidget(
|
|
|
|
exchangeStore: exchangeStore,
|
|
|
|
walletStore: walletStore,
|
|
|
|
exchangeTemplateStore: exchangeTemplateStore,
|
|
|
|
isTemplate: true
|
2020-05-14 17:29:10 +00:00
|
|
|
);
|
|
|
|
}
|
2020-05-13 18:26:15 +00:00
|
|
|
}
|