Initial commit

This commit is contained in:
jahongireshonqulov
2025-10-18 09:40:06 +05:00
commit 1bf3e41abe
352 changed files with 16315 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
import 'package:equatable/equatable.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
part 'main_event.dart';
part 'main_state.dart';
class MainBloc extends Bloc<MainEvent, MainState> {
MainBloc() : super(const MainState(tab: MainTab.home)) {
on<ChangeTabEvent>(_changeTab);
}
void _changeTab(ChangeTabEvent event, Emitter<MainState> emit) {
// if (state.tab != event.tab) {
// changeTap(event.tab);
// }
emit(state.copyWith(tab: event.tab));
}
// void changeTap(MainTab tab) {
// switch (tab) {
// case MainTab.home:
// Navigator.of(
// shellRootNavigatorKey.currentContext!,
// ).pushNamedAndRemoveUntil(Routes.home, (route) => false);
// break;
// case MainTab.calculation:
// Navigator.of(
// shellRootNavigatorKey.currentContext!,
// ).pushNamedAndRemoveUntil(Routes.calculation, (route) => false);
// break;
// case MainTab.profile:
// Navigator.of(
// shellRootNavigatorKey.currentContext!,
// ).pushNamedAndRemoveUntil(Routes.profile, (route) => false);
// break;
// }
// }
}
enum MainTab { home, calculation, profile }