passo_mobile_app/lib/screens/unit2/homepage.dart/components/drawer-screen.dart

47 lines
1.5 KiB
Dart
Raw Normal View History

import 'package:flutter/material.dart';
2023-01-23 03:02:59 +00:00
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_zoom_drawer/config.dart';
import 'package:flutter_zoom_drawer/flutter_zoom_drawer.dart';
import 'package:unit2/theme-data.dart/colors.dart';
import '../../../../bloc/user/user_bloc.dart';
2023-01-23 03:02:59 +00:00
import '../../../../widgets/splash_screen.dart';
import 'menu-screen.dart';
import '../module-screen.dart';
class DrawerScreen extends StatefulWidget {
const DrawerScreen({Key? key}) : super(key: key);
@override
State<DrawerScreen> createState() => _DrawerScreenState();
}
class _DrawerScreenState extends State<DrawerScreen> {
final zoomDrawerController = ZoomDrawerController();
@override
Widget build(BuildContext context) {
2023-01-23 03:02:59 +00:00
return BlocBuilder<UserBloc, UserState>(
builder: (context, state) {
2023-01-23 05:46:09 +00:00
if (state is UserLoggedIn) {
return ZoomDrawer(
controller: zoomDrawerController,
menuScreen: MenuScreen(
userData: state.userData,
),
mainScreen: SizedBox(
height: MediaQuery.of(context).size.height,
child: const MainScreen()),
style: DrawerStyle.defaultStyle,
borderRadius: 24.0,
showShadow: false,
angle: -0.0,
slideWidth: MediaQuery.of(context).size.width * .90,
openCurve: Curves.fastOutSlowIn,
closeCurve: Curves.easeOut,
menuBackgroundColor: Colors.grey,
);
2023-01-23 03:02:59 +00:00
}
2023-01-23 05:46:09 +00:00
return const UniTSplashScreen();
2023-01-23 03:02:59 +00:00
},
);
}
}