diameter/lib/screens/reports/reports.dart

94 lines
3.3 KiB
Dart
Raw Permalink Normal View History

import 'package:diameter/localization_keys.dart';
2022-03-21 00:08:05 +00:00
import 'package:diameter/navigation.dart';
import 'package:diameter/screens/reports/export.dart';
import 'package:flutter/material.dart';
import 'package:flutter_translate/flutter_translate.dart';
2022-03-21 00:08:05 +00:00
class ReportsOverviewScreen extends StatefulWidget {
static const String routeName = '/reports';
const ReportsOverviewScreen({Key? key}) : super(key: key);
@override
_ReportsOverviewScreenState createState() => _ReportsOverviewScreenState();
}
class _ReportsOverviewScreenState extends State<ReportsOverviewScreen> {
final ScrollController _scrollController = ScrollController();
@override
void dispose() {
_scrollController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(translate(LocalizationKeys.reports_title)),
2022-03-21 00:08:05 +00:00
),
drawer:
const Navigation(currentLocation: ReportsOverviewScreen.routeName),
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
child: GridView.count(
crossAxisCount: 2,
children: [
GestureDetector(
onTap: () => Navigator.pushNamed(context, Routes.dailyChart),
child: Padding(
padding: const EdgeInsets.all(10.0),
child: Card(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.all(10.0),
child: Icon(Icons.today, size: 50, color: Theme.of(context).textTheme.subtitle2?.color),
),
Text(
translate(LocalizationKeys.reports_sections_dailyReport).toUpperCase(),
2022-03-21 00:08:05 +00:00
style: Theme.of(context).textTheme.subtitle2,
textAlign: TextAlign.center
),
],
),
),
),
),
GestureDetector(
onTap: () => showDialog(
context: context,
builder: (context) => const ExportDialog(),
),
child: Padding(
padding: const EdgeInsets.all(10.0),
child: Card(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.all(10.0),
child: Icon(Icons.today, size: 50, color: Theme.of(context).textTheme.subtitle2?.color),
),
Text(
translate(LocalizationKeys.reports_sections_pdfReport).toUpperCase(),
2022-03-21 00:08:05 +00:00
style: Theme.of(context).textTheme.subtitle2,
textAlign: TextAlign.center
),
],
),
),
),
),
],
),
),
],
),
);
}
}