fix platform

This commit is contained in:
csf 2022-05-23 16:24:56 +08:00
parent a23fa7fc66
commit 6a949b5f6a
3 changed files with 43 additions and 19 deletions

View File

@ -1,10 +1,36 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.
# This file should be version controlled.
version:
revision: 8874f21e79d7ec66d0457c7ab338348e31b17f1d
revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
channel: stable
project_type: app
# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
base_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
- platform: linux
create_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
base_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
- platform: macos
create_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
base_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
- platform: windows
create_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
base_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
# User provided section
# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'

View File

@ -14,21 +14,19 @@ import 'pages/settings_page.dart';
Future<Null> main() async {
WidgetsFlutterBinding.ensureInitialized();
var a = FFI.ffiModel.init();
var b = Firebase.initializeApp();
await a;
await b;
refreshCurrentUser();
if (Platform.isAndroid) {
await FFI.ffiModel.init();
// await Firebase.initializeApp();
if (isAndroid) {
toAndroidChannelInit();
}
refreshCurrentUser();
runApp(App());
}
class App extends StatelessWidget {
@override
Widget build(BuildContext context) {
final analytics = FirebaseAnalytics.instance;
// final analytics = FirebaseAnalytics.instance;
return MultiProvider(
providers: [
ChangeNotifierProvider.value(value: FFI.ffiModel),
@ -50,7 +48,7 @@ class App extends StatelessWidget {
? WebHomePage()
: HomePage(),
navigatorObservers: [
FirebaseAnalyticsObserver(analytics: analytics),
// FirebaseAnalyticsObserver(analytics: analytics),
FlutterSmartDialog.observer
],
builder: FlutterSmartDialog.init(

View File

@ -56,7 +56,7 @@ packages:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.15.0"
version: "1.16.0"
cross_file:
dependency: transitive
description:
@ -126,7 +126,7 @@ packages:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
version: "1.3.0"
ffi:
dependency: "direct main"
description:
@ -318,7 +318,7 @@ packages:
name: js
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.3"
version: "0.6.4"
matcher:
dependency: transitive
description:
@ -332,7 +332,7 @@ packages:
name: material_color_utilities
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
version: "0.1.4"
meta:
dependency: transitive
description:
@ -360,7 +360,7 @@ packages:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
version: "1.8.1"
path_provider:
dependency: "direct main"
description:
@ -540,7 +540,7 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.1"
version: "1.8.2"
stack_trace:
dependency: transitive
description:
@ -575,7 +575,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.8"
version: "0.4.9"
toggle_switch:
dependency: "direct main"
description:
@ -673,7 +673,7 @@ packages:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
version: "2.1.2"
wakelock:
dependency: "direct main"
description:
@ -745,5 +745,5 @@ packages:
source: hosted
version: "0.1.0"
sdks:
dart: ">=2.16.1 <3.0.0"
dart: ">=2.17.0-0 <3.0.0"
flutter: ">=2.10.0"