forked from firka/student-legacy
fixed build errors and account switching token issue
This commit is contained in:
parent
300b951014
commit
24f8804f60
@ -8,7 +8,7 @@ import 'package:refilc/models/settings.dart';
|
|||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
// ignore: depend_on_referenced_packages
|
// ignore: depend_on_referenced_packages
|
||||||
import 'package:sqflite_common_ffi/sqflite_ffi.dart';
|
import 'package:sqflite_common_ffi/sqflite_ffi.dart';
|
||||||
import 'package:sqflite_common_ffi_web/sqflite_ffi_web.dart';
|
// import 'package:sqflite_common_ffi_web/sqflite_ffi_web.dart';
|
||||||
|
|
||||||
const settingsDB = DatabaseStruct("settings", {
|
const settingsDB = DatabaseStruct("settings", {
|
||||||
"language": String, "start_page": int, "rounding": int, "theme": int,
|
"language": String, "start_page": int, "rounding": int, "theme": int,
|
||||||
@ -110,7 +110,8 @@ Future<Database> initDB(DatabaseProvider database) async {
|
|||||||
Database db;
|
Database db;
|
||||||
|
|
||||||
if (kIsWeb) {
|
if (kIsWeb) {
|
||||||
db = await databaseFactoryFfiWeb.openDatabase("app.db");
|
// db = await databaseFactoryFfiWeb.openDatabase("app.db");
|
||||||
|
throw "web is not supported";
|
||||||
} else if (Platform.isLinux || Platform.isWindows) {
|
} else if (Platform.isLinux || Platform.isWindows) {
|
||||||
sqfliteFfiInit();
|
sqfliteFfiInit();
|
||||||
db = await databaseFactoryFfi.openDatabase("app.db");
|
db = await databaseFactoryFfi.openDatabase("app.db");
|
||||||
|
@ -73,7 +73,7 @@ dependencies:
|
|||||||
package_info_plus: ^8.0.0
|
package_info_plus: ^8.0.0
|
||||||
screenshot: ^3.0.0
|
screenshot: ^3.0.0
|
||||||
flutter_staggered_grid_view: ^0.7.0
|
flutter_staggered_grid_view: ^0.7.0
|
||||||
sqflite_common_ffi_web: ^0.4.0
|
# sqflite_common_ffi_web: ^0.4.0
|
||||||
image_crop_plus: ^1.0.0
|
image_crop_plus: ^1.0.0
|
||||||
googleapis: ^13.2.0
|
googleapis: ^13.2.0
|
||||||
google_sign_in: ^6.2.1
|
google_sign_in: ^6.2.1
|
||||||
|
@ -153,7 +153,7 @@ class SettingsScreenState extends State<SettingsScreen>
|
|||||||
|
|
||||||
// check if refresh token is still valid
|
// check if refresh token is still valid
|
||||||
String? err = await refresh();
|
String? err = await refresh();
|
||||||
if (err != null) {
|
if (err != null && err != "success") {
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (_) => AlertDialog(
|
builder: (_) => AlertDialog(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user