You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.2 KiB
46 lines
1.2 KiB
3 years ago
|
// import 'dart:async';
|
||
|
|
||
|
// import 'package:meta/meta.dart';
|
||
|
// import 'package:bloc/bloc.dart';
|
||
|
// import 'package:equatable/equatable.dart';
|
||
|
|
||
|
// abstract class SettingsEvent extends Equatable {
|
||
|
// const SettingsEvent();
|
||
|
|
||
|
// @override
|
||
|
// List<Object> get props => [];
|
||
|
// }
|
||
|
|
||
|
// class TemperatureUnitsToggled extends SettingsEvent {}
|
||
|
|
||
|
// enum TemperatureUnits { fahrenheit, celsius }
|
||
|
|
||
|
// class SettingsState extends Equatable {
|
||
|
// final TemperatureUnits temperatureUnits;
|
||
|
|
||
|
// @override
|
||
|
// List<Object> get props => [];
|
||
|
|
||
|
// SettingsState({@required this.temperatureUnits})
|
||
|
// : assert(temperatureUnits != null),
|
||
|
// super();
|
||
|
// }
|
||
|
|
||
|
// class SettingsBloc extends Bloc<SettingsEvent, SettingsState> {
|
||
|
// @override
|
||
|
// SettingsState get initialState =>
|
||
|
// SettingsState(temperatureUnits: TemperatureUnits.celsius);
|
||
|
|
||
|
// @override
|
||
|
// Stream<SettingsState> mapEventToState(SettingsEvent event) async* {
|
||
|
// if (event is TemperatureUnitsToggled) {
|
||
|
// // yield SettingsState(
|
||
|
// // temperatureUnits:
|
||
|
// // currentState.temperatureUnits == TemperatureUnits.celsius
|
||
|
// // ? TemperatureUnits.fahrenheit
|
||
|
// // : TemperatureUnits.celsius,
|
||
|
// // );
|
||
|
// }
|
||
|
// }
|
||
|
// }
|