41 lines
1.1 KiB
Dart
41 lines
1.1 KiB
Dart
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_wisetronic/widgets/desktop/desktop_navigationbar.dart';
|
|
import 'package:flutter_wisetronic/widgets/mobile/mobile_navigationbar.dart';
|
|
import 'package:responsive_builder/responsive_builder.dart';
|
|
|
|
class NavigationBar extends StatefulWidget implements PreferredSizeWidget {
|
|
final Key key;
|
|
final PreferredSizeWidget bottom;
|
|
final String title;
|
|
final bool back;
|
|
|
|
NavigationBar({Key key, PreferredSizeWidget bottom, String title, bool back})
|
|
: key = key,
|
|
preferredSize = Size.fromHeight(kToolbarHeight + (bottom?.preferredSize?.height ?? 0.0)),
|
|
bottom = bottom,
|
|
title = title ?? '',
|
|
back = back ?? false;
|
|
|
|
@override
|
|
final Size preferredSize;
|
|
|
|
@override
|
|
State<StatefulWidget> createState() {
|
|
return NavigationBarState();
|
|
}
|
|
|
|
}
|
|
|
|
class NavigationBarState extends State<NavigationBar> {
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return ScreenTypeLayout(
|
|
mobile: MobileNavigationBar(title: widget.title, back: widget.back,),
|
|
tablet: DesktopNavigationBar(),
|
|
desktop: DesktopNavigationBar(),
|
|
);
|
|
}
|
|
|
|
} |