selfprivacy.org.app/lib/logic/cubit/providers/providers_cubit.dart

20 lines
614 B
Dart
Raw Normal View History

2020-12-10 20:33:19 +00:00
import 'package:equatable/equatable.dart';
2024-01-31 05:14:23 +00:00
import 'package:flutter_bloc/flutter_bloc.dart';
2020-12-10 20:33:19 +00:00
import 'package:selfprivacy/logic/models/provider.dart';
import 'package:selfprivacy/logic/models/state_types.dart';
export 'package:provider/provider.dart';
2024-01-31 05:14:23 +00:00
export 'package:selfprivacy/logic/models/state_types.dart';
2020-12-10 20:33:19 +00:00
part 'providers_state.dart';
class ProvidersCubit extends Cubit<ProvidersState> {
2020-12-30 14:13:25 +00:00
ProvidersCubit() : super(InitialProviderState());
2020-12-10 20:33:19 +00:00
2022-06-05 19:36:32 +00:00
void connect(final ProviderModel provider) {
2022-06-09 21:13:06 +00:00
final ProvidersState newState =
state.updateElement(provider, StateType.stable);
2020-12-10 20:33:19 +00:00
emit(newState);
}
}