cpd_2022_zi/lib/pages/scanner_page.dart

35 lines
1018 B
Dart
Raw Normal View History

2023-02-17 13:47:52 +01:00
import 'package:flutter/material.dart';
2023-02-27 02:27:42 +01:00
import 'package:provider/provider.dart';
2023-03-02 19:41:13 +01:00
import 'package:smoke_cess_app/services/export_service.dart';
import 'package:smoke_cess_app/widgets/buttons/text_icon_button.dart';
2023-02-27 17:00:28 +01:00
import 'package:smoke_cess_app/widgets/scanner.dart';
2023-02-27 02:27:42 +01:00
import '../providers/settings_provider.dart';
2023-02-20 19:32:23 +01:00
2023-02-27 17:00:28 +01:00
class ScannerPage extends StatelessWidget {
2023-02-19 17:54:30 +01:00
const ScannerPage({super.key});
2023-02-17 13:47:52 +01:00
2023-02-27 17:00:28 +01:00
void export() async {
2023-03-02 19:41:13 +01:00
ExportService exportService = ExportService();
exportService.exportData();
2023-02-27 17:00:28 +01:00
}
2023-02-20 19:32:23 +01:00
2023-02-17 13:47:52 +01:00
@override
Widget build(BuildContext context) {
SettingsProvider settingsProvider = context.watch<SettingsProvider>();
2023-02-17 13:47:52 +01:00
return Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
2023-02-27 17:00:28 +01:00
const MyScanner(),
2023-02-17 13:47:52 +01:00
const SizedBox(height: 30),
if (!settingsProvider.scanning)
TextIconButton(
text: 'Export',
onPressed: ExportService().exportData,
iconData: Icons.upload),
2023-02-17 13:47:52 +01:00
],
));
}
}