Newer
Older
import 'package:flutter/material.dart';
import 'package:mobileeventlog/datamodel.dart';
import 'package:mobileeventlog/sensorconnector.dart';
class Overview extends StatelessWidget {
const Overview({Key? key}) : super(key: key);
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 Text('Data-Logistics-Support'),
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),
const Text('Version: '),
Text('Git-Commit-Hash: ' + getGitHash()),
],
),
actions: <Widget>[
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');
},
),
const SizedBox(height: 10),
Expanded(
child: ElevatedButton(
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');
},
),
//TODO: Display sensor path in information view.