stack_wallet/lib/providers/exchange/exchange_form_state_provider.dart
2023-02-05 15:11:58 -06:00

18 lines
644 B
Dart

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 =
ChangeNotifierProvider.family<ExchangeFormState, ExchangeRateType>(
(ref, type) {
switch (type) {
case ExchangeRateType.estimated:
return _estimatedInstance;
case ExchangeRateType.fixed:
return _fixedInstance;
}
});
final _fixedInstance = ExchangeFormState(ExchangeRateType.fixed);
final _estimatedInstance = ExchangeFormState(ExchangeRateType.estimated);