mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-08 23:18:16 -07:00
Web - Add docker image and baseUrl config support (#32)
This commit is contained in:
parent
80a0fdbee4
commit
bfcbf5402d
12 changed files with 144 additions and 138 deletions
|
|
@ -1,3 +1,5 @@
|
|||
import 'dart:convert';
|
||||
import 'dart:developer';
|
||||
import 'dart:io';
|
||||
import 'dart:ui';
|
||||
|
||||
|
|
@ -32,6 +34,7 @@ import 'package:fladder/screens/login/lock_screen.dart';
|
|||
import 'package:fladder/theme.dart';
|
||||
import 'package:fladder/util/adaptive_layout.dart';
|
||||
import 'package:fladder/util/application_info.dart';
|
||||
import 'package:fladder/util/fladder_config.dart';
|
||||
import 'package:fladder/util/string_extensions.dart';
|
||||
import 'package:fladder/util/themes_data.dart';
|
||||
|
||||
|
|
@ -57,14 +60,24 @@ class CustomCacheManager {
|
|||
);
|
||||
}
|
||||
|
||||
Future<Map<String, dynamic>> loadConfig() async {
|
||||
final configString = await rootBundle.loadString('config/config.json');
|
||||
return jsonDecode(configString);
|
||||
}
|
||||
|
||||
void main() async {
|
||||
if (kIsWeb) {
|
||||
html.document.onContextMenu.listen((event) => event.preventDefault());
|
||||
}
|
||||
_setupLogging();
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
MediaKit.ensureInitialized();
|
||||
|
||||
if (kIsWeb) {
|
||||
html.document.onContextMenu.listen((event) => event.preventDefault());
|
||||
final result = await loadConfig();
|
||||
log(result.toString());
|
||||
FladderConfig.fromJson(result);
|
||||
log(FladderConfig.baseUrl.toString());
|
||||
}
|
||||
|
||||
final sharedPreferences = await SharedPreferences.getInstance();
|
||||
|
||||
PackageInfo packageInfo = await PackageInfo.fromPlatform();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue