更新firebase版本

This commit is contained in:
fengshengxiong 2024-05-31 17:37:06 +08:00
parent 016ff82fce
commit 6875ded842
3 changed files with 42 additions and 28 deletions

View File

@ -202,7 +202,7 @@
3B06AD1E1E4923F5004D2608 /* Thin Binary */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
39CCEDF39CF579238AE308F0 /* [CP] Embed Pods Frameworks */, 39CCEDF39CF579238AE308F0 /* [CP] Embed Pods Frameworks */,
405E88F0300BCE9602B4DA07 /* [CP] Copy Pods Resources */, 405E88F0300BCE9602B4DA07 /* [CP] Copy Pods Resources */,
456CF4E894A8BC296C35D84E /* FlutterFire: "flutterfire upload-crashlytics-symbols" */, 11551C2B5E159DE061202726 /* FlutterFire: "flutterfire upload-crashlytics-symbols" */,
); );
buildRules = ( buildRules = (
); );
@ -275,6 +275,24 @@
/* End PBXResourcesBuildPhase section */ /* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */
11551C2B5E159DE061202726 /* FlutterFire: "flutterfire upload-crashlytics-symbols" */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "FlutterFire: \"flutterfire upload-crashlytics-symbols\"";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\n#!/bin/bash\nPATH=${PATH}:$FLUTTER_ROOT/bin:$HOME/.pub-cache/bin\nflutterfire upload-crashlytics-symbols --upload-symbols-script-path=$PODS_ROOT/FirebaseCrashlytics/upload-symbols --platform=ios --apple-project-path=${SRCROOT} --env-platform-name=${PLATFORM_NAME} --env-configuration=${CONFIGURATION} --env-project-dir=${PROJECT_DIR} --env-built-products-dir=${BUILT_PRODUCTS_DIR} --env-dwarf-dsym-folder-path=${DWARF_DSYM_FOLDER_PATH} --env-dwarf-dsym-file-name=${DWARF_DSYM_FILE_NAME} --env-infoplist-path=${INFOPLIST_PATH} --default-config=default\n";
};
34C811B39ECD78862B33AD2D /* [CP] Check Pods Manifest.lock */ = { 34C811B39ECD78862B33AD2D /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
@ -347,24 +365,6 @@
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
456CF4E894A8BC296C35D84E /* FlutterFire: "flutterfire upload-crashlytics-symbols" */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "FlutterFire: \"flutterfire upload-crashlytics-symbols\"";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\n#!/bin/bash\nPATH=${PATH}:$FLUTTER_ROOT/bin:$HOME/.pub-cache/bin\nflutterfire upload-crashlytics-symbols --upload-symbols-script-path=$PODS_ROOT/FirebaseCrashlytics/upload-symbols --platform=ios --apple-project-path=${SRCROOT} --env-platform-name=${PLATFORM_NAME} --env-configuration=${CONFIGURATION} --env-project-dir=${PROJECT_DIR} --env-built-products-dir=${BUILT_PRODUCTS_DIR} --env-dwarf-dsym-folder-path=${DWARF_DSYM_FOLDER_PATH} --env-dwarf-dsym-file-name=${DWARF_DSYM_FILE_NAME} --env-infoplist-path=${INFOPLIST_PATH} --default-config=default\n";
};
9740EEB61CF901F6004384FC /* Run Script */ = { 9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1; alwaysOutOfDate = 1;

View File

@ -1,3 +1,6 @@
import 'dart:async';
import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:easy_refresh/easy_refresh.dart'; import 'package:easy_refresh/easy_refresh.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:hello_wallpaper/common/components/view_state_widget.dart'; import 'package:hello_wallpaper/common/components/view_state_widget.dart';
@ -8,6 +11,7 @@ import 'package:hello_wallpaper/routes/app_pages.dart';
class DiscoverController extends GetxController { class DiscoverController extends GetxController {
static DiscoverController get to => Get.find<DiscoverController>(); static DiscoverController get to => Get.find<DiscoverController>();
late StreamSubscription<List<ConnectivityResult>> _connectivitySubscription;
late final EasyRefreshController refreshController; late final EasyRefreshController refreshController;
late ViewState viewState; late ViewState viewState;
var allWallpaper = <WallpaperData>[]; var allWallpaper = <WallpaperData>[];
@ -25,24 +29,31 @@ class DiscoverController extends GetxController {
@override @override
void onInit() { void onInit() {
super.onInit(); super.onInit();
_connectivitySubscription = Connectivity().onConnectivityChanged.listen((List<ConnectivityResult> result) {
if (result.contains(ConnectivityResult.none)) {
getData();
}
});
refreshController = EasyRefreshController(controlFinishLoad: true); refreshController = EasyRefreshController(controlFinishLoad: true);
getData(); getData();
} }
@override
void onClose() {
_connectivitySubscription.cancel();
super.onClose();
}
void getData() { void getData() {
todayNewestData = HomeController.to.getRandomCls(); todayNewestData = HomeController.to.getRandomCls();
if (todayNewestData != null && if (todayNewestData != null && todayNewestData!.data != null && todayNewestData!.data!.length >= 3) {
todayNewestData!.data != null &&
todayNewestData!.data!.length >= 3) {
clsName = ObjUtil.getStr(todayNewestData!.name); clsName = ObjUtil.getStr(todayNewestData!.name);
var flatList = todayNewestData!.data!.map((e) => e).toList(); var flatList = todayNewestData!.data!.map((e) => e).toList();
// 3 // 3
todayNewestList = (flatList..shuffle()).take(3).toList(); todayNewestList = (flatList..shuffle()).take(3).toList();
} }
viewState = HomeController.to.viewState; viewState = HomeController.to.viewState;
allWallpaper = HomeController.to.wallpaperModelList allWallpaper = HomeController.to.wallpaperModelList.expand((element) => element.data ?? <WallpaperData>[]).toList();
.expand((element) => element.data ?? <WallpaperData>[])
.toList();
// List顺序 // List顺序
allWallpaper.shuffle(); allWallpaper.shuffle();
_getDataToShow(); _getDataToShow();

View File

@ -95,10 +95,13 @@ dependencies:
# AppLovin # AppLovin
applovin_max: ^3.10.0 applovin_max: ^3.10.0
# 网络状态监听
connectivity_plus: ^6.0.3
# Firebase # Firebase
firebase_core: ^2.31.1 firebase_core: ^2.32.0
firebase_analytics: ^10.10.6 firebase_analytics: ^10.10.7
firebase_crashlytics: ^3.5.6 firebase_crashlytics: ^3.5.7
flutter_launcher_icons: flutter_launcher_icons:
android: "launcher_icon" android: "launcher_icon"