Files
flutter_wisetronic/lib/pages/tutorials.dart
2021-08-31 13:28:33 -04:00

66 lines
1.9 KiB
Dart

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<StatefulWidget> createState() {
return TutorialsState();
}
}
class TutorialsState extends State<Tutorials> {
final _scaffoldKey = GlobalKey<ScaffoldState>();
@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<OpenDrawer>().listen((event) {
if (mounted) {
_scaffoldKey.currentState.openDrawer();
}
});
}
}