added an about page
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
import 'pages/about_page.dart';
|
||||||
import 'pages/flood_station_page.dart';
|
import 'pages/flood_station_page.dart';
|
||||||
import 'pages/main_navigation_scaffold.dart';
|
import 'pages/main_navigation_scaffold.dart';
|
||||||
import 'services/flood_station_provider.dart';
|
import 'services/flood_station_provider.dart';
|
||||||
@@ -31,6 +32,7 @@ class MyApp extends StatelessWidget {
|
|||||||
routes: {
|
routes: {
|
||||||
MainNavigationScaffold.routeName: (context) => MainNavigationScaffold(),
|
MainNavigationScaffold.routeName: (context) => MainNavigationScaffold(),
|
||||||
FloodStationPage.routeName: (context) => FloodStationPage(),
|
FloodStationPage.routeName: (context) => FloodStationPage(),
|
||||||
|
AboutPage.routeName: (context) => AboutPage(),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
29
lib/pages/about_page.dart
Normal file
29
lib/pages/about_page.dart
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class AboutPage extends StatelessWidget {
|
||||||
|
const AboutPage({super.key});
|
||||||
|
|
||||||
|
static const String aboutText = '''
|
||||||
|
This App was build for demonstration purposes.
|
||||||
|
It requests data from the Environment Agency Real Time flood-monitoring API and displays a list and map of all flood measurement stations,
|
||||||
|
as well as a graph showing the last 24 hours of measurements.
|
||||||
|
The source code can be found at https://git.skup.in/.
|
||||||
|
''';
|
||||||
|
|
||||||
|
static const String routeName = '/about';
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: Text('About'),
|
||||||
|
),
|
||||||
|
body: Center(
|
||||||
|
child: Text(
|
||||||
|
aboutText,
|
||||||
|
style: Theme.of(context).textTheme.bodyLarge,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import 'about_page.dart';
|
||||||
import 'landing_page.dart';
|
import 'landing_page.dart';
|
||||||
import 'map_page.dart';
|
import 'map_page.dart';
|
||||||
|
|
||||||
@@ -23,6 +24,16 @@ class _MainNavigationScaffoldState extends State<MainNavigationScaffold> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: Text('Floodwatch'),
|
||||||
|
actions: [
|
||||||
|
IconButton(
|
||||||
|
onPressed: () =>
|
||||||
|
Navigator.of(context).pushNamed(AboutPage.routeName),
|
||||||
|
icon: Icon(Icons.info_outline),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
bottomNavigationBar: NavigationBar(
|
bottomNavigationBar: NavigationBar(
|
||||||
selectedIndex: _selectedPageIndex,
|
selectedIndex: _selectedPageIndex,
|
||||||
onDestinationSelected: (value) => setState(() {
|
onDestinationSelected: (value) => setState(() {
|
||||||
|
|||||||
Reference in New Issue
Block a user