Initial commit: Flutter 无书应用项目
This commit is contained in:
16
lib/utils/flutter_compatibility_fix.dart
Normal file
16
lib/utils/flutter_compatibility_fix.dart
Normal file
@@ -0,0 +1,16 @@
|
||||
// Flutter 版本兼容性修复
|
||||
// 修复 Flutter 3.27.5 中 CupertinoDynamicColor 缺少 toARGB32 方法的问题
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
||||
/// Flutter 3.27.5 兼容性修复
|
||||
/// 为 CupertinoDynamicColor 添加缺失的 toARGB32 方法实现
|
||||
extension CupertinoDynamicColorExtension on CupertinoDynamicColor {
|
||||
/// 添加缺失的 toARGB32 方法实现
|
||||
/// 这是 Flutter 3.27.5 版本中的一个临时解决方案
|
||||
int toARGB32() {
|
||||
// 使用一个固定的颜色值作为临时解决方案
|
||||
// 在实际应用中,这里应该根据主题动态解析
|
||||
return 0xFF0000FF; // 临时返回蓝色 ARGB32 值
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user