diff --git a/ios/GoogleService-Info.plist b/ios/GoogleService-Info.plist
deleted file mode 100644
index 4c4c218..0000000
--- a/ios/GoogleService-Info.plist
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
- CLIENT_ID
- 497244455669-4c8jmohrsj81e7rpjfamv3kvr07haa6r.apps.googleusercontent.com
- REVERSED_CLIENT_ID
- com.googleusercontent.apps.497244455669-4c8jmohrsj81e7rpjfamv3kvr07haa6r
- PLIST_VERSION
- 1
- BUNDLE_ID
- com.curainhealth.derma
-
-
\ No newline at end of file
diff --git a/lib/api/endpoints/skin_api.dart b/lib/api/endpoints/skin_api.dart
index fa1edcb..1c355e6 100644
--- a/lib/api/endpoints/skin_api.dart
+++ b/lib/api/endpoints/skin_api.dart
@@ -9,9 +9,13 @@ import 'package:dio/dio.dart';
import '../dto/article_dto.dart';
///皮肤检测
-Future skinDetectApi(String path) async {
+Future skinDetectApi(List bytes) async {
FormData formData = FormData.fromMap({
- "skin_image": await MultipartFile.fromFile(path),
+ "skin_image": MultipartFile.fromBytes(
+ bytes,
+ filename: "upload.jpg",
+ contentType: DioMediaType("image", "jpeg"),
+ ),
});
var res = await Request().post("/skin/check", formData);
return SkinCheckDto.fromJson(res);
@@ -40,15 +44,15 @@ Future skinRecordApi({
}
///获取文章列表
-Future> articleListApi() async{
- var res = await Request().get("/customer-health/get_articles");
- return (res['list'] as List).map((e) => ArticleDto.fromJson(e)).toList();
+Future> articleListApi() async {
+ var res = await Request().get("/customer-health/get_articles");
+ return (res['list'] as List).map((e) => ArticleDto.fromJson(e)).toList();
}
///文章详情
-Future articleDetailApi(String id) async{
- var res = await Request().get("/customer-health/get_article_detail", {
- "id": id,
- });
- return ArticleDetailDto.fromJson(res);
-}
\ No newline at end of file
+Future articleDetailApi(String id) async {
+ var res = await Request().get("/customer-health/get_article_detail", {
+ "id": id,
+ });
+ return ArticleDetailDto.fromJson(res);
+}
diff --git a/lib/page/home/home_page.dart b/lib/page/home/home_page.dart
index 41a9fea..f4b070e 100644
--- a/lib/page/home/home_page.dart
+++ b/lib/page/home/home_page.dart
@@ -1,7 +1,10 @@
+import 'dart:io';
+
import 'package:derma_flutter/router/config/route_paths.dart';
import 'package:file_picker/file_picker.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
+import 'package:flutter_image_compress/flutter_image_compress.dart';
import 'package:go_router/go_router.dart';
import 'package:image_picker/image_picker.dart';
@@ -42,11 +45,21 @@ class _HomePageState extends State with AutomaticKeepAliveClientMixin
///开始检测
void _startDetect(String path) async {
+ //压缩
+ final result = await FlutterImageCompress.compressWithFile(
+ path,
+ minWidth: 1080,
+ minHeight: 1920,
+ quality: 85,
+ rotate: 0,
+ );
+ print("压缩前:${File(path).lengthSync()}");
+ print("压缩后长度${result?.length}");
EasyLoading.show(
status: 'Skin analysis in progress, please wait...',
maskType: EasyLoadingMaskType.clear,
);
- var res = await skinDetectApi(path);
+ var res = await skinDetectApi(result!);
EasyLoading.dismiss();
context.push(RoutePaths.detail, extra: res);
}
diff --git a/pubspec.lock b/pubspec.lock
index 1e852d6..2da8b06 100644
--- a/pubspec.lock
+++ b/pubspec.lock
@@ -174,6 +174,54 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.7.0"
+ flutter_image_compress:
+ dependency: "direct main"
+ description:
+ name: flutter_image_compress
+ sha256: "51d23be39efc2185e72e290042a0da41aed70b14ef97db362a6b5368d0523b27"
+ url: "https://pub.flutter-io.cn"
+ source: hosted
+ version: "2.4.0"
+ flutter_image_compress_common:
+ dependency: transitive
+ description:
+ name: flutter_image_compress_common
+ sha256: c5c5d50c15e97dd7dc72ff96bd7077b9f791932f2076c5c5b6c43f2c88607bfb
+ url: "https://pub.flutter-io.cn"
+ source: hosted
+ version: "1.0.6"
+ flutter_image_compress_macos:
+ dependency: transitive
+ description:
+ name: flutter_image_compress_macos
+ sha256: "20019719b71b743aba0ef874ed29c50747461e5e8438980dfa5c2031898f7337"
+ url: "https://pub.flutter-io.cn"
+ source: hosted
+ version: "1.0.3"
+ flutter_image_compress_ohos:
+ dependency: transitive
+ description:
+ name: flutter_image_compress_ohos
+ sha256: e76b92bbc830ee08f5b05962fc78a532011fcd2041f620b5400a593e96da3f51
+ url: "https://pub.flutter-io.cn"
+ source: hosted
+ version: "0.0.3"
+ flutter_image_compress_platform_interface:
+ dependency: transitive
+ description:
+ name: flutter_image_compress_platform_interface
+ sha256: "579cb3947fd4309103afe6442a01ca01e1e6f93dc53bb4cbd090e8ce34a41889"
+ url: "https://pub.flutter-io.cn"
+ source: hosted
+ version: "1.0.5"
+ flutter_image_compress_web:
+ dependency: transitive
+ description:
+ name: flutter_image_compress_web
+ sha256: b9b141ac7c686a2ce7bb9a98176321e1182c9074650e47bb140741a44b6f5a96
+ url: "https://pub.flutter-io.cn"
+ source: hosted
+ version: "0.1.5"
flutter_lints:
dependency: "direct dev"
description:
diff --git a/pubspec.yaml b/pubspec.yaml
index cf3d286..c9796e2 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -27,6 +27,7 @@ dependencies:
image_picker: ^1.2.0
markdown_widget: ^2.3.2+8
sign_in_with_apple: ^7.0.1
+ flutter_image_compress: ^2.4.0
dev_dependencies: