Giga Push (it is 1:30 am and I am tired)
Backend Structure implemented All Ratings will be pulled and validated Pop Up notfies user about all his ratings If confirmed, data will be send to the supabase server (if any data was found) No comments were made, who else needs to read this?
This commit is contained in:
+23
-3
@@ -9,8 +9,25 @@ import 'package:mensaapp/providers/spaceProvider.dart';
|
||||
import 'package:mensaapp/providers/spezielleErnaehrungProvider.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'dart:async';
|
||||
import 'package:supabase_flutter/supabase_flutter.dart';
|
||||
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
await Supabase.initialize(
|
||||
url: "http://192.168.2.229:8000",
|
||||
anonKey: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJhbm9uIiwKICAgICJpc3MiOiAic3VwYWJhc2UtZGVtbyIsCiAgICAiaWF0IjogMTY0MTc2OTIwMCwKICAgICJleHAiOiAxNzk5NTM1NjAwCn0.dc_X5iR_VP_qT0zsiyj_I_OZ2T9FtRU2BBNWN8Bu4GE",
|
||||
);
|
||||
|
||||
var supabase = Supabase.instance.client;
|
||||
|
||||
/*
|
||||
var test = await supabase.from('flutter').insert(
|
||||
{"rating": {"huhu" : "Fuuuuck uuuuuu if this works"}}
|
||||
);
|
||||
*/
|
||||
|
||||
void main() {
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
@@ -71,7 +88,7 @@ class MyApp extends StatelessWidget {
|
||||
|
||||
var lastTimeClick = DateTime.now();
|
||||
|
||||
var secondsTimeOut = 80;
|
||||
var secondsTimeOut = 80; //80
|
||||
var popupOpen = false;
|
||||
|
||||
void _showTimeOverDialog(BuildContext context) {
|
||||
@@ -122,7 +139,7 @@ class MyHome extends StatelessWidget {
|
||||
(timer) {
|
||||
var clickDiff = DateTime.now().difference(lastTimeClick).inSeconds;
|
||||
if (clickDiff >= secondsTimeOut && Provider.of<SpaceProvider>(context, listen: false).selectedSpace == 1) {
|
||||
Navigator.of(context).pop();
|
||||
Navigator.of(context).popUntil((route) => route.isFirst);
|
||||
Provider.of<AnmerkungProvider>(context, listen: false)
|
||||
.resetAllFields();
|
||||
Provider.of<EssenProvider>(context, listen: false)
|
||||
@@ -135,6 +152,8 @@ class MyHome extends StatelessWidget {
|
||||
.resetAllFields();
|
||||
Provider.of<PageProvider>(context, listen: false)
|
||||
.resetSelectedEssen();
|
||||
Provider.of<PageProvider>(context, listen: false)
|
||||
.changePage(0);
|
||||
Provider.of<SpaceProvider>(context, listen: false)
|
||||
.setSelectedSpace(0);
|
||||
Provider.of<LanguageProvider>(context, listen: false)
|
||||
@@ -142,6 +161,7 @@ class MyHome extends StatelessWidget {
|
||||
} else if (clickDiff >= secondsTimeOut - 30 && Provider.of<SpaceProvider>(context, listen: false).selectedSpace == 1) {
|
||||
if (!popupOpen) {
|
||||
_showTimeOverDialog(context);
|
||||
_showTimeOverDialog(context);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user