Files
flutter_wisetronic/lib/pages/new_ticket.dart
2026-07-12 04:33:48 +08:00

67 lines
2.0 KiB
Dart

import 'package:flutter/material.dart';
import 'package:responsive_builder/responsive_builder.dart';
import '../constants.dart';
import '../generated/l10n.dart';
import '../store/actions.dart';
import '../store/store.dart';
import '../widgets/desktop/desktop_new_ticket.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_new_ticket.dart';
class NewTicket extends StatefulWidget {
final int? businessId;
const NewTicket({Key? key, int? businessId}) :
businessId = businessId ?? Constants.BUSINESS_ID;
@override
State<StatefulWidget> createState() {
return NewTicketState();
}
}
class NewTicketState extends State<NewTicket> {
final _scaffoldKey = GlobalKey<ScaffoldState>();
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
store.dispatch(UpdateContext(context));
return ResponsiveBuilder(
builder: (context, sizingInformation) =>
Scaffold(
key: _scaffoldKey,
appBar: MiniNavigationBar(
title: S.of(context).new_ticket,
back: true,
breadCrumbs: [
BreadCrumb(S.of(context).new_ticket, null),
],
breadCrumbHeight: sizingInformation.deviceScreenType == DeviceScreenType.mobile ? null : Constants.BREADCRUMB_HEIGHT,
),
drawer: null,
body: ScreenTypeLayout.builder(
mobile: (context) => MobileNewTicket(businessId: widget.businessId!,),
tablet: (context) => DesktopNewTicket(businessId: widget.businessId!,),
desktop: (context) => DesktopNewTicket(businessId: widget.businessId!,),
),
bottomNavigationBar: ScreenTypeLayout.builder(
mobile: (context) => MobileBottomNav(currentIndex: 0,),
tablet: (context) => BottomNav(),
desktop: (context) => BottomNav(),
),
),
);
}
}