mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
fix: countly double init due to rebuild app
This commit is contained in:
@@ -359,7 +359,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||
CURRENT_PROJECT_VERSION = 239;
|
||||
CURRENT_PROJECT_VERSION = 241;
|
||||
DEVELOPMENT_TEAM = BA88US33G6;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
@@ -367,7 +367,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.239;
|
||||
MARKETING_VERSION = 1.0.241;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
@@ -490,7 +490,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||
CURRENT_PROJECT_VERSION = 239;
|
||||
CURRENT_PROJECT_VERSION = 241;
|
||||
DEVELOPMENT_TEAM = BA88US33G6;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
@@ -498,7 +498,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.239;
|
||||
MARKETING_VERSION = 1.0.241;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
@@ -515,7 +515,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||
CURRENT_PROJECT_VERSION = 239;
|
||||
CURRENT_PROJECT_VERSION = 241;
|
||||
DEVELOPMENT_TEAM = BA88US33G6;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
@@ -523,7 +523,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.239;
|
||||
MARKETING_VERSION = 1.0.241;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
|
||||
@@ -12,14 +12,14 @@ class Analysis {
|
||||
static const _url = 'https://countly.xuty.cc';
|
||||
static const _key = '80372a2a66424b32d0ac8991bfa1ef058bd36b1f';
|
||||
|
||||
static bool _enabled = false;
|
||||
static bool enabled = false;
|
||||
|
||||
static Future<void> init() async {
|
||||
if (!BuildMode.isRelease) {
|
||||
return;
|
||||
}
|
||||
if (isAndroid || isIOS) {
|
||||
_enabled = true;
|
||||
enabled = true;
|
||||
final config = CountlyConfig(_url, _key)
|
||||
.setLoggingEnabled(false)
|
||||
.enableCrashReporting();
|
||||
@@ -33,13 +33,13 @@ class Analysis {
|
||||
}
|
||||
|
||||
static void recordView(String view) {
|
||||
if (_enabled) {
|
||||
if (enabled) {
|
||||
Countly.recordView(view);
|
||||
}
|
||||
}
|
||||
|
||||
static void recordException(Object exception, [bool fatal = false]) {
|
||||
if (_enabled) {
|
||||
if (enabled) {
|
||||
Countly.logException(exception.toString(), !fatal, null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,8 @@
|
||||
|
||||
class BuildData {
|
||||
static const String name = "ServerBox";
|
||||
static const int build = 239;
|
||||
static const String engine =
|
||||
"Flutter 3.7.7 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision 2ad6cd72c0 (13 days ago) • 2023-03-08 09:41:59 -0800\nEngine • revision 1837b5be5f\nTools • Dart 2.19.4 • DevTools 2.20.1\n";
|
||||
static const String buildAt = "2023-03-21 14:03:13.656226";
|
||||
static const int modifications = 17;
|
||||
static const int build = 241;
|
||||
static const String engine = "Flutter 3.7.7 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision 2ad6cd72c0 (13 days ago) • 2023-03-08 09:41:59 -0800\nEngine • revision 1837b5be5f\nTools • Dart 2.19.4 • DevTools 2.20.1\n";
|
||||
static const String buildAt = "2023-03-21 15:00:34.919375";
|
||||
static const int modifications = 6;
|
||||
}
|
||||
|
||||
@@ -82,7 +82,8 @@ Future<void> main() async {
|
||||
runInZone(() async {
|
||||
await initApp();
|
||||
runApp(
|
||||
MultiProvider(
|
||||
RebuildWidget(
|
||||
child: MultiProvider(
|
||||
providers: [
|
||||
ChangeNotifierProvider(create: (_) => locator<AppProvider>()),
|
||||
ChangeNotifierProvider(create: (_) => locator<PkgProvider>()),
|
||||
@@ -91,10 +92,10 @@ Future<void> main() async {
|
||||
ChangeNotifierProvider(create: (_) => locator<ServerProvider>()),
|
||||
ChangeNotifierProvider(create: (_) => locator<SnippetProvider>()),
|
||||
ChangeNotifierProvider(create: (_) => locator<VirtualKeyboard>()),
|
||||
ChangeNotifierProvider(create: (_) => locator<PrivateKeyProvider>()),
|
||||
ChangeNotifierProvider(
|
||||
create: (_) => locator<PrivateKeyProvider>()),
|
||||
ChangeNotifierProvider(create: (_) => locator<SftpProvider>()),
|
||||
],
|
||||
child: RebuildWidget(
|
||||
child: MyApp(),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -308,6 +308,8 @@ class _MyHomePageState extends State<MyHomePage>
|
||||
await GetIt.I.allReady();
|
||||
await locator<ServerProvider>().loadLocalData();
|
||||
await doUpdate(context);
|
||||
if (!Analysis.enabled) {
|
||||
await Analysis.init();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user