diff --git a/CHANGELOG.md b/CHANGELOG.md index 6492d94..642517f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.6.6 + +* Update for Flutter 3.27.0 + ## 0.6.5 * implemented #12: would like some hover icons for copy+edit on web and desktop diff --git a/example/lib/custom_styles/custom_styles.dart b/example/lib/custom_styles/custom_styles.dart index 46e5494..8352ef1 100644 --- a/example/lib/custom_styles/custom_styles.dart +++ b/example/lib/custom_styles/custom_styles.dart @@ -160,7 +160,7 @@ class _ChatPageState extends State textStyle: halloweenTextStyle.copyWith(color: Colors.black), hintText: 'good evening...', hintStyle: - halloweenTextStyle.copyWith(color: Colors.orange.withOpacity(.5)), + halloweenTextStyle.copyWith(color: Colors.orange.withAlpha(128)), ), userMessageStyle: UserMessageStyle( textStyle: halloweenTextStyle.copyWith(color: Colors.black), @@ -177,7 +177,7 @@ class _ChatPageState extends State borderRadius: BorderRadius.circular(20), boxShadow: [ BoxShadow( - color: Colors.grey.withOpacity(0.5), + color: Colors.grey.withAlpha(128), blurRadius: 10, spreadRadius: 2, ), @@ -215,7 +215,7 @@ class _ChatPageState extends State ), boxShadow: [ BoxShadow( - color: Colors.black.withOpacity(0.3), + color: Colors.black.withAlpha(76), blurRadius: 8, offset: Offset(2, 2), ), diff --git a/example/lib/dark_style.dart b/example/lib/dark_style.dart index 2898bf6..1653381 100644 --- a/example/lib/dark_style.dart +++ b/example/lib/dark_style.dart @@ -134,12 +134,10 @@ SuggestionStyle _darkSuggestionStyle() { const Color _greyBackground = Color(0xFF535353); -Color _invertColor(Color? color) => Color.fromARGB( - color!.alpha, - 255 - color.red, - 255 - color.green, - 255 - color.blue, - ); +Color? _invertColor(Color? color) => color != null + ? Color.from( + alpha: color.a, red: 1 - color.r, green: 1 - color.g, blue: 1 - color.b) + : null; Decoration _invertDecoration(Decoration? decoration) => switch (decoration!) { final BoxDecoration d => d.copyWith(color: _invertColor(d.color)), diff --git a/example/lib/demo/demo.dart b/example/lib/demo/demo.dart index 7f2a99b..ee4133c 100644 --- a/example/lib/demo/demo.dart +++ b/example/lib/demo/demo.dart @@ -248,7 +248,7 @@ class _ChatPageState extends State textStyle: halloweenTextStyle.copyWith(color: Colors.black), hintText: 'good evening...', hintStyle: - halloweenTextStyle.copyWith(color: Colors.orange.withOpacity(.5)), + halloweenTextStyle.copyWith(color: Colors.orange.withAlpha(128)), ), userMessageStyle: UserMessageStyle( textStyle: halloweenTextStyle.copyWith(color: Colors.black), @@ -265,7 +265,7 @@ class _ChatPageState extends State borderRadius: BorderRadius.circular(20), boxShadow: [ BoxShadow( - color: Colors.grey.withOpacity(0.5), + color: Colors.grey.withAlpha(128), blurRadius: 10, spreadRadius: 2, ), @@ -303,7 +303,7 @@ class _ChatPageState extends State ), boxShadow: [ BoxShadow( - color: Colors.black.withOpacity(0.3), + color: Colors.black.withAlpha(76), blurRadius: 8, offset: Offset(2, 2), ), diff --git a/example/lib/styles/styles.dart b/example/lib/styles/styles.dart index 3cdf639..6881d9a 100644 --- a/example/lib/styles/styles.dart +++ b/example/lib/styles/styles.dart @@ -132,7 +132,7 @@ class _ChatPageState extends State textStyle: halloweenTextStyle.copyWith(color: Colors.black), hintText: 'good evening...', hintStyle: halloweenTextStyle.copyWith( - color: Colors.orange.withOpacity(.5)), + color: Colors.orange.withAlpha(128)), ), userMessageStyle: UserMessageStyle( textStyle: halloweenTextStyle.copyWith(color: Colors.black), @@ -149,7 +149,7 @@ class _ChatPageState extends State borderRadius: BorderRadius.circular(20), boxShadow: [ BoxShadow( - color: Colors.grey.withOpacity(0.5), + color: Colors.grey.withAlpha(128), blurRadius: 10, spreadRadius: 2, ), @@ -187,7 +187,7 @@ class _ChatPageState extends State ), boxShadow: [ BoxShadow( - color: Colors.black.withOpacity(0.3), + color: Colors.black.withAlpha(76), blurRadius: 8, offset: Offset(2, 2), ), diff --git a/example/pubspec.yaml b/example/pubspec.yaml index eedb85c..0b76d94 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -1,10 +1,11 @@ name: flutter_ai_toolkit_example description: "Sample apps showing off various features of the Flutter AI Toolkit." publish_to: 'none' -version: 0.6.5 +version: 0.6.6 environment: sdk: ^3.4.4 + flutter: '>=3.27.0-0' dependencies: flutter: diff --git a/lib/src/styles/toolkit_text_styles.dart b/lib/src/styles/toolkit_text_styles.dart index 56c3466..de62de4 100644 --- a/lib/src/styles/toolkit_text_styles.dart +++ b/lib/src/styles/toolkit_text_styles.dart @@ -68,7 +68,7 @@ abstract final class ToolkitTextStyles { /// /// Used for the text of tooltips. static final TextStyle tooltip = GoogleFonts.roboto( - color: ToolkitColors.tooltipText.withOpacity(0.9), + color: ToolkitColors.tooltipText.withAlpha(230), fontSize: 14, fontWeight: FontWeight.w400, ); diff --git a/lib/src/utility.dart b/lib/src/utility.dart index 6418332..6be0947 100644 --- a/lib/src/utility.dart +++ b/lib/src/utility.dart @@ -66,9 +66,7 @@ Future copyToClipboard(BuildContext context, String text) async { /// * [color]: The [Color] to be inverted. This parameter must not be null. /// /// Returns: A new [Color] object with the inverted RGB values. -Color invertColor(Color? color) => Color.fromARGB( - color!.alpha, - 255 - color.red, - 255 - color.green, - 255 - color.blue, - ); +Color? invertColor(Color? color) => color != null + ? Color.from( + alpha: color.a, red: 1 - color.r, green: 1 - color.g, blue: 1 - color.b) + : null; diff --git a/pubspec.yaml b/pubspec.yaml index 8dffef0..9f12c5a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,11 +1,11 @@ name: flutter_ai_toolkit description: "A set of AI chat-related widgets for your Flutter app targeting mobile, desktop and web." -version: 0.6.5 +version: 0.6.6 homepage: https://github.com/flutter/ai environment: sdk: '>=3.4.0 <4.0.0' - flutter: ">=1.17.0" + flutter: '>=3.27.0-0' dependencies: cross_file: ^0.3.4+2