2022-05-18 19:38:11 +02:00
|
|
|
import 'package:canteenlib/canteenlib.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
|
|
|
import 'package:introduction_screen/introduction_screen.dart';
|
|
|
|
import 'package:opencanteen/lang/lang.dart';
|
2022-12-12 16:48:19 +01:00
|
|
|
import 'package:opencanteen/okna/ios/jidelnicek.dart';
|
2022-05-18 19:38:11 +02:00
|
|
|
|
2022-12-12 16:48:19 +01:00
|
|
|
class IOSWelcome extends StatefulWidget {
|
|
|
|
const IOSWelcome({Key? key, required this.canteen}) : super(key: key);
|
2022-05-18 19:38:11 +02:00
|
|
|
|
|
|
|
final Canteen canteen;
|
|
|
|
|
|
|
|
@override
|
2022-12-12 16:48:19 +01:00
|
|
|
State<IOSWelcome> createState() => _IOSWelcomeState();
|
2022-05-18 19:38:11 +02:00
|
|
|
}
|
|
|
|
|
2022-12-12 16:48:19 +01:00
|
|
|
class _IOSWelcomeState extends State<IOSWelcome> {
|
2022-05-18 19:38:11 +02:00
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
var listPagesViewModel = [
|
|
|
|
PageViewModel(
|
|
|
|
title: Languages.of(context)!.welcome,
|
|
|
|
body: Languages.of(context)!.appDesc,
|
|
|
|
image: const Center(
|
|
|
|
child: Icon(Icons.waving_hand_outlined, size: 175),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
PageViewModel(
|
|
|
|
title: Languages.of(context)!.aboutOrder,
|
|
|
|
body: Languages.of(context)!.howOrder,
|
|
|
|
image: Center(
|
|
|
|
child: Image.asset('assets/objednavam.png',
|
|
|
|
width: MediaQuery.of(context).size.width * 0.85),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
PageViewModel(
|
|
|
|
title: Languages.of(context)!.aboutToExch,
|
|
|
|
body: Languages.of(context)!.howToExch,
|
|
|
|
image: Center(
|
|
|
|
child: Image.asset('assets/doburzy.png',
|
|
|
|
width: MediaQuery.of(context).size.width * 0.85),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
PageViewModel(
|
|
|
|
title: Languages.of(context)!.aboutFromExch,
|
|
|
|
body: Languages.of(context)!.howFromExch,
|
|
|
|
image: Center(
|
|
|
|
child: Image.asset('assets/burza.png',
|
|
|
|
width: MediaQuery.of(context).size.width * 0.85),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
PageViewModel(
|
|
|
|
title: Languages.of(context)!.warning,
|
|
|
|
body: Languages.of(context)!.notOfficial,
|
|
|
|
image: const Center(
|
|
|
|
child: Icon(Icons.warning_amber_outlined, size: 175),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
];
|
|
|
|
return Scaffold(
|
|
|
|
body: IntroductionScreen(
|
|
|
|
pages: listPagesViewModel,
|
|
|
|
next: Text(Languages.of(context)!.next),
|
|
|
|
done: Text(Languages.of(context)!.ok,
|
|
|
|
style: const TextStyle(fontWeight: FontWeight.w600)),
|
|
|
|
onDone: () async {
|
|
|
|
const storage = FlutterSecureStorage();
|
|
|
|
await storage.write(key: "oc_souhlas", value: "ano");
|
2022-09-06 20:02:17 +02:00
|
|
|
if (!mounted) return;
|
2022-09-26 17:02:45 +02:00
|
|
|
Navigator.of(context).pushAndRemoveUntil(
|
|
|
|
MaterialPageRoute(
|
2022-12-12 16:48:19 +01:00
|
|
|
builder: (c) => IOSJidelnicek(canteen: widget.canteen)),
|
2022-09-26 17:02:45 +02:00
|
|
|
(route) => false);
|
2022-05-18 19:38:11 +02:00
|
|
|
},
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|