真的收工

This commit is contained in:
bluesea 2024-05-16 12:01:01 +08:00
parent 3bec8e2762
commit 51af7c4f09
7 changed files with 132 additions and 15 deletions

View File

@ -1,3 +1,4 @@
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:wallpaper/routes/app_routes.dart'; import 'package:wallpaper/routes/app_routes.dart';
import "package:wallpaper/utils/assettool.dart"; import "package:wallpaper/utils/assettool.dart";
@ -9,7 +10,6 @@ class HomePageController extends GetxController {
super.onReady(); super.onReady();
setupTypeListData(); setupTypeListData();
} }
void setupTypeListData() async{ void setupTypeListData() async{

View File

@ -2,7 +2,9 @@
// import 'dart:js'; // import 'dart:js';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:transparent_image/transparent_image.dart'; import 'package:transparent_image/transparent_image.dart';
import 'package:wallpaper/pages/homepage/homepage_controller.dart'; import 'package:wallpaper/pages/homepage/homepage_controller.dart';
@ -42,7 +44,10 @@ class HomePageView extends GetView <HomePageController> {
padding: const EdgeInsets.symmetric(horizontal: 5), padding: const EdgeInsets.symmetric(horizontal: 5),
// padding: const EdgeInsets.fromLTRB(5, 50, 5, 0), // padding: const EdgeInsets.fromLTRB(5, 50, 5, 0),
children: List.generate(controller.typeList.length, (index) { children: List.generate(controller.typeList.length, (index) {
return getBodyItem(controller.typeList[index].data![0].previewThumb!,controller.typeList[index].name!,index); return Scaffold(
backgroundColor: Colors.grey,
body: getBodyItem(controller.typeList[index].data![0].previewThumb!,controller.typeList[index].name!,index),
);
}), }),
)); ));
} }
@ -50,12 +55,15 @@ class HomePageView extends GetView <HomePageController> {
Stack getBodyItem(String imgUrl,String title,int index){ Stack getBodyItem(String imgUrl,String title,int index){
return Stack(// return Stack(//
children: [ children: [
FadeInImage.memoryNetwork( CachedNetworkImage(
width: double.infinity, imageUrl: imgUrl,
height: double.infinity, width: double.infinity,
placeholder: kTransparentImage, height: double.infinity,
image: imgUrl, fit: BoxFit.cover,
fit: BoxFit.cover, placeholder: (context, url) => const SizedBox(height: 30,width: 30,child: Center(
child: CircularProgressIndicator(color: Colors.white,),
),),
errorWidget: (context, url, error) => const Icon(Icons.error_outline_outlined,color: Colors.white,),
), ),

View File

@ -1,3 +1,4 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:wallpaper/pages/imgcategorypage/imgcategorypage_controller.dart'; import 'package:wallpaper/pages/imgcategorypage/imgcategorypage_controller.dart';
@ -42,7 +43,11 @@ class ImgCategoryPageView extends GetView<ImgCategoryPageController> {
childAspectRatio: 0.7, childAspectRatio: 0.7,
padding: const EdgeInsets.symmetric(horizontal: 5), padding: const EdgeInsets.symmetric(horizontal: 5),
children: List.generate(controller.dataModel.data!.length, (index) { children: List.generate(controller.dataModel.data!.length, (index) {
return getBodyItem(controller.dataModel.data![index].previewThumb!, index); return
Scaffold(
backgroundColor: Colors.grey,
body: getBodyItem(controller.dataModel.data![index].previewThumb!, index),
);
})); }));
// return Obx(() => GridView.count( // return Obx(() => GridView.count(
// crossAxisCount: 2, // crossAxisCount: 2,
@ -59,12 +64,15 @@ class ImgCategoryPageView extends GetView<ImgCategoryPageController> {
Stack getBodyItem(String imgUrl,int index) { Stack getBodyItem(String imgUrl,int index) {
return Stack(// return Stack(//
children: [ children: [
FadeInImage.memoryNetwork( CachedNetworkImage(
width: double.infinity, imageUrl: imgUrl,
height: double.infinity, width: double.infinity,
placeholder: kTransparentImage, height: double.infinity,
image: imgUrl, fit: BoxFit.cover,
fit: BoxFit.cover, placeholder: (context, url) => const SizedBox(height: 30,width: 30,child: Center(
child: CircularProgressIndicator(color: Colors.white,),
),),
errorWidget: (context, url, error) => const Icon(Icons.error_outline_outlined,color: Colors.white,),
), ),
Material( Material(

View File

@ -51,6 +51,7 @@ class ImgScanPageView extends GetView<ImgScanPageController> {
width: 20.0, width: 20.0,
height: 20.0, height: 20.0,
child: CircularProgressIndicator( child: CircularProgressIndicator(
color: Colors.white,
value: event == null value: event == null
? 0 ? 0
: event.cumulativeBytesLoaded / event.expectedTotalBytes!, : event.cumulativeBytesLoaded / event.expectedTotalBytes!,

View File

@ -7,8 +7,10 @@ import Foundation
import flutter_inappwebview_macos import flutter_inappwebview_macos
import path_provider_foundation import path_provider_foundation
import sqflite
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
InAppWebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "InAppWebViewFlutterPlugin")) InAppWebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "InAppWebViewFlutterPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
} }

View File

@ -113,6 +113,30 @@ packages:
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "8.9.2" version: "8.9.2"
cached_network_image:
dependency: "direct main"
description:
name: cached_network_image
sha256: "28ea9690a8207179c319965c13cd8df184d5ee721ae2ce60f398ced1219cea1f"
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.3.1"
cached_network_image_platform_interface:
dependency: transitive
description:
name: cached_network_image_platform_interface
sha256: "9e90e78ae72caa874a323d78fa6301b3fb8fa7ea76a8f96dc5b5bf79f283bf2f"
url: "https://pub.flutter-io.cn"
source: hosted
version: "4.0.0"
cached_network_image_web:
dependency: transitive
description:
name: cached_network_image_web
sha256: "205d6a9f1862de34b93184f22b9d2d94586b2f05c581d546695e3d8f6a805cd7"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.0"
characters: characters:
dependency: transitive dependency: transitive
description: description:
@ -222,6 +246,14 @@ packages:
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.0" version: "0.0.0"
flutter_cache_manager:
dependency: transitive
description:
name: flutter_cache_manager
sha256: "395d6b7831f21f3b989ebedbb785545932adb9afe2622c1ffacf7f4b53a7e544"
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.3.2"
flutter_easyloading: flutter_easyloading:
dependency: "direct main" dependency: "direct main"
description: description:
@ -432,6 +464,14 @@ packages:
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.0.1" version: "2.0.1"
http:
dependency: transitive
description:
name: http
sha256: "761a297c042deedc1ffbb156d6e2af13886bb305c2a343a4d972504cd67dd938"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.1"
http_multi_server: http_multi_server:
dependency: transitive dependency: transitive
description: description:
@ -560,6 +600,14 @@ packages:
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.0.0" version: "1.0.0"
octo_image:
dependency: transitive
description:
name: octo_image
sha256: "45b40f99622f11901238e18d48f5f12ea36426d8eced9f4cbf58479c7aa2430d"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.0"
package_config: package_config:
dependency: transitive dependency: transitive
description: description:
@ -720,6 +768,14 @@ packages:
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.2.3" version: "1.2.3"
rxdart:
dependency: transitive
description:
name: rxdart
sha256: "0c7c0cedd93788d996e33041ffecda924cc54389199cde4e6a34b440f50044cb"
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.27.7"
shelf: shelf:
dependency: transitive dependency: transitive
description: description:
@ -765,6 +821,30 @@ packages:
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.10.0" version: "1.10.0"
sprintf:
dependency: transitive
description:
name: sprintf
sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23"
url: "https://pub.flutter-io.cn"
source: hosted
version: "7.0.0"
sqflite:
dependency: transitive
description:
name: sqflite
sha256: a43e5a27235518c03ca238e7b4732cf35eabe863a369ceba6cbefa537a66f16d
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.3.3+1"
sqflite_common:
dependency: transitive
description:
name: sqflite_common
sha256: "3da423ce7baf868be70e2c0976c28a1bb2f73644268b7ffa7d2e08eab71f16a4"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.5.4"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
@ -797,6 +877,14 @@ packages:
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.2.0" version: "1.2.0"
synchronized:
dependency: transitive
description:
name: synchronized
sha256: "539ef412b170d65ecdafd780f924e5be3f60032a1128df156adad6c5b373d558"
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.1.0+1"
term_glyph: term_glyph:
dependency: transitive dependency: transitive
description: description:
@ -837,6 +925,14 @@ packages:
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.3.2" version: "1.3.2"
uuid:
dependency: transitive
description:
name: uuid
sha256: "814e9e88f21a176ae1359149021870e87f7cddaf633ab678a5d2b0bff7fd1ba8"
url: "https://pub.flutter-io.cn"
source: hosted
version: "4.4.0"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:

View File

@ -63,6 +63,8 @@ dependencies:
#将图片导出到相册 #将图片导出到相册
image_gallery_saver: ^2.0.3 image_gallery_saver: ^2.0.3
permission_handler: ^10.0.0 permission_handler: ^10.0.0
#网络图片加载(支持缓存)
cached_network_image: ^3.3.1
# The following adds the Cupertino Icons font to your application. # The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons. # Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.6 cupertino_icons: ^1.0.6