1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-25 14:29:22 +00:00
comunicmobile/lib/ui/routes/main_route/smartphone_route.dart

51 lines
1.5 KiB
Dart
Raw Normal View History

2020-05-05 11:21:37 +00:00
import 'package:comunic/ui/routes/main_route/main_route.dart';
2020-05-10 16:29:43 +00:00
import 'package:comunic/ui/routes/main_route/page_info.dart';
import 'package:comunic/ui/screens/notifications_screen.dart';
2021-12-30 11:02:18 +00:00
import 'package:comunic/ui/widgets/banner_widget.dart';
2020-05-06 16:54:32 +00:00
import 'package:comunic/ui/widgets/mobile_mode/mobile_appbar_widget.dart';
2019-04-22 17:16:26 +00:00
import 'package:flutter/material.dart';
/// Main route of the application
///
/// @author Pierre HUBERT
2020-05-05 11:21:37 +00:00
class SmartphoneMainRoute extends StatefulWidget implements MainRoute {
const SmartphoneMainRoute({Key? key}) : super(key: key);
2020-05-09 12:07:14 +00:00
2019-04-23 09:08:38 +00:00
@override
2020-04-17 13:26:37 +00:00
State<StatefulWidget> createState() => _MainRouteState();
2019-04-23 09:08:38 +00:00
}
2020-04-15 16:06:20 +00:00
/// Private implementation of HomeController
2020-05-09 12:18:09 +00:00
class _MainRouteState extends MainController {
2020-05-10 16:29:43 +00:00
@override
PageInfo get defaultPage =>
PageInfo(type: PageType.NOTIFICATIONS_PAGE, child: NotificationsScreen());
2020-04-15 14:03:04 +00:00
2019-04-22 17:16:26 +00:00
@override
Widget build(BuildContext context) {
2019-07-01 09:51:23 +00:00
return Container(
color: Colors.blueAccent,
child: SafeArea(
// Avoid OS areas
child: WillPopScope(
2020-05-11 16:32:58 +00:00
onWillPop: willPop,
2019-07-01 09:51:23 +00:00
child: Scaffold(
2020-05-10 16:29:43 +00:00
appBar: currentPage.hideNavBar
? null
2020-05-10 16:29:43 +00:00
: ComunicMobileAppBar(currentPage: currentPage),
2021-12-30 11:02:18 +00:00
body: SafeArea(
key: currentPage.key,
child: Column(
children: [
BannerWidget(),
Expanded(child: currentPage.child)
],
)),
2019-07-01 09:51:23 +00:00
),
2019-04-23 09:08:38 +00:00
),
),
);
2019-04-22 17:16:26 +00:00
}
2019-04-23 09:08:38 +00:00
}