mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-05-24 23:32:13 +00:00
Some checks are pending
Flutter analyze & test / flutter_analyze_and_test (push) Waiting to run
37 lines
1 KiB
Dart
37 lines
1 KiB
Dart
import 'dart:async';
|
|
|
|
import 'package:camera/camera.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:path_provider/path_provider.dart';
|
|
import 'package:twonly/src/utils/log.dart';
|
|
|
|
class AppEnvironment {
|
|
static late final String cacheDir;
|
|
static late final String supportDir;
|
|
|
|
// will be loaded in the main_camera_controller.dart
|
|
static List<CameraDescription> cameras = [];
|
|
|
|
static Future<void> init() async {
|
|
cacheDir = (await getApplicationCacheDirectory()).path;
|
|
supportDir = (await getApplicationSupportDirectory()).path;
|
|
Log.init();
|
|
}
|
|
|
|
static void initTesting() {
|
|
cacheDir = '/tmp/twonly_cache';
|
|
supportDir = '/tmp/twonly_support';
|
|
}
|
|
}
|
|
|
|
class AppState {
|
|
static bool isAppInBackground = true;
|
|
static bool isInBackgroundTask = false;
|
|
static bool allowErrorTrackingViaSentry = false;
|
|
static bool gotMessageFromServer = false;
|
|
static int latestAppVersionId = 110;
|
|
}
|
|
|
|
class AppGlobalKeys {
|
|
static final scaffoldMessengerKey = GlobalKey<ScaffoldMessengerState>();
|
|
}
|