luc sitzung
This commit is contained in:
@@ -7,9 +7,9 @@ import 'addCam/add_cam_main.dart';
|
||||
|
||||
// * The homepage where you can choose to add something or view the database entries
|
||||
|
||||
|
||||
class HomePage extends StatelessWidget {
|
||||
const HomePage({super.key});
|
||||
|
||||
|
||||
void _sendFile() async {
|
||||
FilePickerResult? result = await FilePicker.platform.pickFiles();
|
||||
@@ -17,42 +17,46 @@ class HomePage extends StatelessWidget {
|
||||
if (result != null) {
|
||||
File file = File(result.files.single.path!);
|
||||
String content = await file.readAsString();
|
||||
|
||||
Methods(content).httpRequest();
|
||||
|
||||
|
||||
}
|
||||
Methods().httpRequest(content);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: Text(AppLocalizations.of(context)!.homePageTitle),
|
||||
actions: [
|
||||
PopupMenuButton(
|
||||
onSelected: (value) {
|
||||
Navigator.pushNamed(context, value.toString());
|
||||
},
|
||||
itemBuilder: (context) => [
|
||||
PopupMenuItem(
|
||||
value: '/settings',
|
||||
child: Text(AppLocalizations.of(context)!.settings),
|
||||
),
|
||||
PopupMenuItem(
|
||||
value: '/introScreen',
|
||||
child: Text(AppLocalizations.of(context)!.showloginscreen))
|
||||
])
|
||||
],
|
||||
appBar: AppBar(
|
||||
title: Text(AppLocalizations.of(context)!.homePageTitle),
|
||||
actions: [
|
||||
PopupMenuButton(
|
||||
onSelected: (value) {
|
||||
Navigator.pushNamed(context, value.toString());
|
||||
},
|
||||
itemBuilder: (context) => [
|
||||
PopupMenuItem(
|
||||
value: '/settings',
|
||||
child: Text(AppLocalizations.of(context)!.settings),
|
||||
),
|
||||
PopupMenuItem(
|
||||
value: '/introScreen',
|
||||
child:
|
||||
Text(AppLocalizations.of(context)!.showloginscreen))
|
||||
])
|
||||
],
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
Image.asset('assets/images/reconix_small.png'),
|
||||
Center(
|
||||
child: Column(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const SizedBox(height: 30,),
|
||||
ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
minimumSize: const Size(250, 40),
|
||||
padding: const EdgeInsets.fromLTRB(10, 5, 10, 5),
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
@@ -60,11 +64,22 @@ class HomePage extends StatelessWidget {
|
||||
builder: (context) => const AddCamMain()));
|
||||
},
|
||||
child: Text(AppLocalizations.of(context)!.addplace)),
|
||||
ElevatedButton(onPressed: () => Navigator.pushNamed(context, '/viewCams'),
|
||||
child: Text(AppLocalizations.of(context)!.viewplaces)),
|
||||
ElevatedButton(onPressed: () {
|
||||
_sendFile();
|
||||
}, child: Text(AppLocalizations.of(context)!.sendfile))
|
||||
const SizedBox(height: 10,),
|
||||
ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
minimumSize: const Size(250, 40)
|
||||
),
|
||||
onPressed: () => Navigator.pushNamed(context, '/viewCams'),
|
||||
child: Text(AppLocalizations.of(context)!.viewplaces)),
|
||||
const SizedBox(height: 10,),
|
||||
ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
minimumSize: const Size(250, 40)
|
||||
),
|
||||
onPressed: () {
|
||||
_sendFile();
|
||||
},
|
||||
child: Text(AppLocalizations.of(context)!.sendfile))
|
||||
],
|
||||
)),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user