-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCubitAppLogics.dart
39 lines (37 loc) · 1.15 KB
/
CubitAppLogics.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:new_project/cubit/appcubit_cubit.dart';
import 'package:new_project/pages/nav_pages/Home_Page.dart';
import 'package:new_project/pages/nav_pages/details_page.dart';
import 'package:new_project/pages/nav_pages/main_page.dart';
import 'package:new_project/pages/welcome_page.dart';
class CubitAppLOgics extends StatefulWidget {
@override
_CubitAppLOgicsState createState() => _CubitAppLOgicsState();
}
class _CubitAppLOgicsState extends State<CubitAppLOgics> {
@override
Widget build(BuildContext context) {
return Scaffold(
body:
BlocBuilder<AppcubitCubit, AppcubitState>(builder: (context, state) {
if (state is WelcomeState) {
return WelcomePage();
}
if (state is LoadedState) {
return MainPage();
}
if (state is DetailsState) {
return DetailsPage();
}
if (state is LoadingState) {
return const Center(
child: CircularProgressIndicator(),
);
} else {
return Container();
}
}),
);
}
}