import 'package:flutter/material.dart'; import 'package:responsive_builder/responsive_builder.dart'; import '../constants.dart'; import '../events/eventbus.dart'; import '../events/events.dart'; import '../generated/l10n.dart'; import '../widgets/desktop/desktop_tutorials.dart'; import '../widgets/general/bottom_nav.dart'; import '../widgets/general/breadcrumbs.dart'; import '../widgets/general/navigationbar.dart'; import '../widgets/mobile/MobileBottomNav.dart'; import '../widgets/mobile/mobile_navigation_drawer.dart'; import '../widgets/mobile/mobile_tutorials.dart'; class Tutorials extends StatefulWidget { const Tutorials({Key key}) : super(key: key); @override State createState() { return TutorialsState(); } } class TutorialsState extends State { final _scaffoldKey = GlobalKey(); @override Widget build(BuildContext context) { return ResponsiveBuilder( builder: (context, sizingInformation) => Scaffold( key: _scaffoldKey, appBar: NavigationBar( title: S.of(context).tutorials, back: true, breadCrumbs: [BreadCrumb(S.of(context).tutorials, null)], breadCrumbHeight: sizingInformation.deviceScreenType == DeviceScreenType.mobile ? null : Constants.BREADCRUMB_HEIGHT, ), drawer: null, body: ScreenTypeLayout( mobile: MobileTutorials(), tablet: DesktopTutorials(), desktop: DesktopTutorials(), ), bottomNavigationBar: ScreenTypeLayout( mobile: MobileBottomNav(currentIndex: 0,), tablet: BottomNav(), desktop: BottomNav(), ), ), ); } @override void initState() { super.initState(); eventBus.on().listen((event) { if (mounted) { _scaffoldKey.currentState.openDrawer(); } }); } }