Forráskód Böngészése

相机相册的主题颜色,按钮颜色等适配

liukai 5 napja
szülő
commit
5092420e54

+ 1 - 1
packages/cs_domain/lib/constants/api_constants.dart

@@ -2,7 +2,7 @@
 
 class ApiConstants {
   //当前服务器环境
-  static const isServerRelease = true;
+  static const isServerRelease = false;
 
   //域名
   static const baseUrl = isServerRelease ? 'https://property.24ifm.com' : 'http://dev-yyhome.guadoutech.com';

+ 7 - 6
packages/cs_plugin_platform/lib/engine/media/album_engine.dart

@@ -17,7 +17,6 @@ class AlbumEngine {
     int filterMinHeight = 100,
     int filterMaxHeight = 100000,
   }) async {
-    const Color themeColor = Color(0xff00bc56);
 
     FilterOptionGroup filterOptions = FilterOptionGroup()
       ..setOption(
@@ -42,12 +41,14 @@ class AlbumEngine {
         gridCount: 4,
         pageSize: 40,
         pickerTheme: ThemeData(
-          primaryColor: themeColor,
-          primaryColorDark: Colors.white,
-          primaryColorLight: themeColor,
+          primaryColor: AppColorsTheme.colorPrimary,
           brightness: Brightness.dark,
-          primarySwatch: _createMaterialColor(themeColor),
-          textSelectionTheme: const TextSelectionThemeData(cursorColor: themeColor),
+          colorScheme: const ColorScheme.dark(
+            primary:  AppColorsTheme.colorPrimary,
+            secondary: AppColorsTheme.colorPrimary,  //内部按钮是这个颜色
+          ),
+          primarySwatch: _createMaterialColor(AppColorsTheme.colorPrimary),
+          textSelectionTheme: const TextSelectionThemeData(cursorColor: AppColorsTheme.colorPrimary),
           appBarTheme: AppBarTheme(
             systemOverlayStyle: SystemUiOverlayStyle.dark.copyWith(
               statusBarColor: Colors.transparent,

+ 8 - 1
packages/cs_plugin_platform/lib/engine/media/camera_engine.dart

@@ -1,3 +1,4 @@
+import 'package:cs_resources/theme/app_colors_theme.dart';
 import 'package:flutter/material.dart';
 import 'package:wechat_camera_picker/wechat_camera_picker.dart';
 import 'package:flutter/services.dart';
@@ -14,6 +15,9 @@ class CameraEngine {
         enableRecording: false,
         theme: ThemeData(
           brightness: Brightness.dark,
+          colorScheme: const ColorScheme.dark(
+            secondary: AppColorsTheme.colorPrimary,  //内部按钮是这个颜色
+          ),
           appBarTheme: AppBarTheme(
             systemOverlayStyle: SystemUiOverlayStyle.dark.copyWith(
               statusBarColor: Colors.transparent,
@@ -42,8 +46,11 @@ class CameraEngine {
         maximumRecordingDuration: Duration(seconds: maxRecordInSeconds),
         theme: ThemeData(
           brightness: Brightness.dark,
+          colorScheme: const ColorScheme.dark(
+            secondary: AppColorsTheme.colorPrimary,
+          ),
           appBarTheme: AppBarTheme(
-            systemOverlayStyle: SystemUiOverlayStyle.dark.copyWith(
+            systemOverlayStyle: SystemUiOverlayStyle.light.copyWith(
               statusBarColor: Colors.transparent,
               statusBarBrightness: Brightness.dark,
               statusBarIconBrightness: Brightness.light,