stack_wallet/lib/providers/exchange/exchange_form_state_provider.dart

19 lines
644 B
Dart
Raw Normal View History

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