2022-10-04 17:06:14 +00:00
|
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
|
|
import 'package:stackwallet/models/exchange/exchange_form_state.dart';
|
2023-02-05 20:32:39 +00:00
|
|
|
import 'package:stackwallet/pages/exchange_view/sub_widgets/exchange_rate_sheet.dart';
|
2022-10-04 17:06:14 +00:00
|
|
|
|
2023-02-05 20:32:39 +00:00
|
|
|
final exchangeFormStateProvider =
|
2023-02-05 21:11:58 +00:00
|
|
|
ChangeNotifierProvider.family<ExchangeFormState, ExchangeRateType>(
|
|
|
|
(ref, type) {
|
2023-02-05 20:32:39 +00:00
|
|
|
switch (type) {
|
|
|
|
case ExchangeRateType.estimated:
|
2023-02-05 21:11:58 +00:00
|
|
|
return _estimatedInstance;
|
2023-02-05 20:32:39 +00:00
|
|
|
case ExchangeRateType.fixed:
|
2023-02-05 21:11:58 +00:00
|
|
|
return _fixedInstance;
|
2023-02-05 20:32:39 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
final _fixedInstance = ExchangeFormState(ExchangeRateType.fixed);
|
|
|
|
|
|
|
|
final _estimatedInstance = ExchangeFormState(ExchangeRateType.estimated);
|