Newer
Older
import 'package:flutter/material.dart';
import 'package:mobileeventlog/datamodel.dart';
import 'package:mobileeventlog/sensorconnector.dart';
import 'package:url_launcher/url_launcher.dart';
class Overview extends StatelessWidget {
const Overview({Key? key}) : super(key: key);
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
Widget _buildLegalInformationPopupDialog(BuildContext context){
return AlertDialog(
content: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
const Text('Alfred Wegener Institute, Helmholtz Centre for Polar and Marine '
'Research', style: TextStyle(
fontWeight: FontWeight.bold)
),
const Text(
'\nAm Handelshafen 12\n27570 Bremerhaven Germany\n'
'+49 (0)471 4831-0, info@awi.de'
),
InkWell(
child: const Text('www.awi.de',
style: TextStyle(
color: Colors.blueAccent,
decoration: TextDecoration.underline,
),
),
onTap: () => launchUrl(Uri.parse('https://www.awi.de'))
),
const Text('\nThe Alfred Wegener Institute is a foundation under public law '
'(Stiftung des öffentlichen Rechts). The AWI is a member of the '
'Helmholtz Association of German Research Centres.\n'),
InkWell(
child: const Text('Legal Notices',
style: TextStyle(
color: Colors.blueAccent,
decoration: TextDecoration.underline,
),
),
onTap: () => launchUrl(Uri.parse('https://registry.o2a-data.de/?site=legal'))
),
InkWell(
child: const Text('\nPrivacy',
style: TextStyle(
color: Colors.blueAccent,
decoration: TextDecoration.underline,
),
),
onTap: () => launchUrl(Uri.parse('https://registry.o2a-data.de/?site=privacy'))
),
],
),
),
actions: <Widget>[
TextButton(
onPressed: () {
Navigator.of(context).pop();
},
child: const Text('Close'),
),
],
);
}
Widget _buildPopupInfoDialog(BuildContext context) {
SensorConnector sensorConnector = SensorConnector();
return AlertDialog(
content: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
const Icon( Icons.copyright_outlined),
const Text('Alfred Wegener Institute'),
const SizedBox(height: 15),
const Text('Maximilian Betz'),
const SizedBox(height: 0),
const Text('o2a-support@awi.de'),
const SizedBox(height: 15),
const Text('API Endpoint:'),
Text(sensorConnector.baseUrl),
const SizedBox(height: 15),

Maximilian Betz
committed
Text('Version: ' + getVersion()),
Text('Build-Number: ' + getBuildNumber()),
],
),
actions: <Widget>[
TextButton(
onPressed: () {
Navigator.of(context).pop();
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) => _buildLegalInformationPopupDialog(context),
);
child: const Text('Legal Notices'),
),
TextButton(
onPressed: () {
Navigator.of(context).pop();
},
child: const Text('Close'),
),
],
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Mobile Event Log'),
actions: [
IconButton(
icon: const Icon(
Icons.info,
size: 34.0),
onPressed: (){
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) => _buildPopupInfoDialog(context),
);
}
),
],
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.stretch,
const SizedBox(height: 10),
Expanded(
child: ElevatedButton(
child: const Text('Add Event', style: TextStyle(fontSize: 36)),
onPressed: () {
Navigator.pushNamed(context, '/second');
},
),
child: const Text('Measurement \n Kottaspegel', style: TextStyle(fontSize: 36)),
onPressed: () {
Navigator.pushNamed(context, '/sixth');
},
),
),
const SizedBox(height: 10),
child: const Text('View & Sync', style: TextStyle(fontSize: 36)),
onPressed: () {
Navigator.pushNamed(context, '/third');
},
),
const SizedBox(height: 10),
Expanded(
child: ElevatedButton(
child: const Text('Configuration', style: TextStyle(fontSize: 36)),
onPressed: () {
Navigator.pushNamed(context, '/forth');
},
),