58 lines
1.8 KiB
Dart
58 lines
1.8 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:manager_api/api.dart';
|
|
import 'package:mymuseum_visitapp/Components/CustomAppBar.dart';
|
|
import 'package:mymuseum_visitapp/Components/ScannerBouton.dart';
|
|
import 'package:mymuseum_visitapp/Helpers/translationHelper.dart';
|
|
import 'package:mymuseum_visitapp/Models/visitContext.dart';
|
|
import 'package:mymuseum_visitapp/app_context.dart';
|
|
import 'package:mymuseum_visitapp/constants.dart';
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'components/body.dart';
|
|
|
|
class VisitPage extends StatefulWidget {
|
|
const VisitPage({Key? key, required this.configurationId}) : super(key: key);
|
|
|
|
final String configurationId;
|
|
|
|
@override
|
|
State<VisitPage> createState() => _VisitPageState();
|
|
}
|
|
|
|
class _VisitPageState extends State<VisitPage> {
|
|
ConfigurationDTO? configuration;
|
|
|
|
@override
|
|
/*Widget build(BuildContext context) {
|
|
return new WillPopScope(
|
|
onWillPop: () async => false,
|
|
child: new Scaffold(
|
|
appBar: new AppBar(
|
|
title: new Text("data"),
|
|
leading: new IconButton(
|
|
icon: new Icon(Icons.ac_unit),
|
|
onPressed: () => Navigator.of(context).pop(),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}*/
|
|
Widget build(BuildContext context) {
|
|
final appContext = Provider.of<AppContext>(context);
|
|
VisitAppContext visitAppContext = appContext.getContext();
|
|
configuration = visitAppContext.configuration;
|
|
|
|
return WillPopScope(
|
|
child: Scaffold(
|
|
appBar: CustomAppBar(
|
|
title: TranslationHelper.get(configuration!.title, appContext),
|
|
isHomeButton: true,
|
|
),
|
|
backgroundColor: kBackgroundGrey,
|
|
body: Body(configurationId: configuration!.id), // TODO handle error..
|
|
floatingActionButton: ScannerBouton(appContext: appContext),
|
|
),
|
|
onWillPop: () async => false,
|
|
);
|
|
}
|
|
} |