From 3f2f4355d04984fc7d71f20aba4b7d06a4e273e6 Mon Sep 17 00:00:00 2001 From: Eduardo Folly Date: Sun, 2 Feb 2025 20:41:48 -0300 Subject: [PATCH] Version 3.6.0. --- CHANGELOG.md | 8 ++ dev/fa_gen.dart | 2 +- .../Flutter/GeneratedPluginRegistrant.swift | 2 - example/pubspec.yaml | 7 +- .../flutter/generated_plugin_registrant.cc | 3 - .../windows/flutter/generated_plugins.cmake | 1 - lib/fields/bool_field.dart | 2 +- lib/folly_fields.dart | 59 -------- lib/util/folly_utils.dart | 27 ++-- lib/util/icon_helper.dart | 17 ++- lib/widgets/animated_search.dart | 7 +- pubspec.lock | 128 +++++------------- pubspec.yaml | 12 +- test/mocks/mock_connectivity.dart | 35 ----- .../folly_utils_color_by_luminance_test.dart | 9 +- test/util/folly_utils_test.dart | 6 +- .../model_utils/from_json_safe_list_test.dart | 2 - .../model_utils/from_json_safe_set_test.dart | 2 - 18 files changed, 100 insertions(+), 229 deletions(-) delete mode 100644 test/mocks/mock_connectivity.dart diff --git a/CHANGELOG.md b/CHANGELOG.md index 8290a7f2..8d13be71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## [3.6.0] - 2025-02-02 + +* Updating to Flutter 3.27.0 and Dart 3.6.0. +* Removing connectivity_plus plugin. +* Updating FontAwesome to 10.8.0. +* Updating FollyUtils.textColorByLuminance to use Colors.computeLuminance. +* Fixing deprecated methods. + ## [3.5.0] - 2024-11-02 * Adding package_info_plus to provide version string in AbstractConfig. diff --git a/dev/fa_gen.dart b/dev/fa_gen.dart index ad52fe0d..35a099b3 100644 --- a/dev/fa_gen.dart +++ b/dev/fa_gen.dart @@ -6,7 +6,7 @@ import 'package:http/http.dart'; /// /// void main() async { - const String version = '10.7.0'; + const String version = '10.8.0'; Response response = await get( Uri.parse( diff --git a/example/macos/Flutter/GeneratedPluginRegistrant.swift b/example/macos/Flutter/GeneratedPluginRegistrant.swift index f2de84de..92f17812 100644 --- a/example/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/example/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,13 +5,11 @@ import FlutterMacOS import Foundation -import connectivity_plus import package_info_plus import path_provider_foundation import url_launcher_macos func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { - ConnectivityPlusPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlusPlugin")) FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 1fd9691b..2f580a2d 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -10,9 +10,6 @@ environment: flutter: ">=3.22.0" dependencies: - # https://pub.dev/packages/connectivity_plus - connectivity_plus: 6.1.0 - flutter: sdk: flutter @@ -28,13 +25,13 @@ dependencies: path: ../ # https://pub.dev/packages/font_awesome_flutter - font_awesome_flutter: 10.7.0 + font_awesome_flutter: 10.8.0 # https://pub.dev/packages/google_fonts google_fonts: 6.2.1 # https://pub.dev/packages/http - http: 1.2.2 + http: 1.3.0 # https://pub.dev/packages/url_launcher url_launcher: 6.3.1 diff --git a/example/windows/flutter/generated_plugin_registrant.cc b/example/windows/flutter/generated_plugin_registrant.cc index 5777988d..4f788487 100644 --- a/example/windows/flutter/generated_plugin_registrant.cc +++ b/example/windows/flutter/generated_plugin_registrant.cc @@ -6,12 +6,9 @@ #include "generated_plugin_registrant.h" -#include #include void RegisterPlugins(flutter::PluginRegistry* registry) { - ConnectivityPlusWindowsPluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin")); UrlLauncherWindowsRegisterWithRegistrar( registry->GetRegistrarForPlugin("UrlLauncherWindows")); } diff --git a/example/windows/flutter/generated_plugins.cmake b/example/windows/flutter/generated_plugins.cmake index 31032063..88b22e5c 100644 --- a/example/windows/flutter/generated_plugins.cmake +++ b/example/windows/flutter/generated_plugins.cmake @@ -3,7 +3,6 @@ # list(APPEND FLUTTER_PLUGIN_LIST - connectivity_plus url_launcher_windows ) diff --git a/lib/fields/bool_field.dart b/lib/fields/bool_field.dart index 6482a2b6..8193960e 100644 --- a/lib/fields/bool_field.dart +++ b/lib/fields/bool_field.dart @@ -85,7 +85,7 @@ class BoolField extends ResponsiveFormField { TextStyle textStyle = Theme.of(field.context).textTheme.titleMedium!.copyWith( - color: textColor?.withOpacity(enabled ? 1 : 0.4), + color: textColor?.withValues(alpha: enabled ? 1 : 0.4), overflow: textOverflow, ); diff --git a/lib/folly_fields.dart b/lib/folly_fields.dart index 524c8094..b8fbbaa9 100644 --- a/lib/folly_fields.dart +++ b/lib/folly_fields.dart @@ -1,6 +1,5 @@ import 'dart:io'; -import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/widgets.dart'; import 'package:folly_fields/responsive/responsive.dart'; @@ -23,7 +22,6 @@ class FollyFields implements _InternalConfig { List responsiveSizes = const [540, 720, 960, 1140], FollyDateParse? dateParseUpdate, FollyDateParse? dateParseDelete, - Connectivity? connectivity, PackageInfo? packageInfo, }) => FollyFields()._holder = holder @@ -34,7 +32,6 @@ class FollyFields implements _InternalConfig { dateParseUpdate: dateParseUpdate, dateParseDelete: dateParseDelete, responsiveSizes: responsiveSizes, - connectivity: connectivity, packageInfo: packageInfo, ); @@ -58,18 +55,6 @@ class FollyFields implements _InternalConfig { @override String get version => _holder.version; - /// - /// - /// - @override - bool get isOffline => _holder.isOffline; - - /// - /// - /// - @override - bool get isOnline => _holder.isOnline; - /// /// /// @@ -202,16 +187,6 @@ abstract class _InternalConfig { /// String get version; - /// - /// - /// - bool get isOnline; - - /// - /// - /// - bool get isOffline; - /// /// /// @@ -284,7 +259,6 @@ abstract class _InternalConfig { abstract class AbstractConfig implements _InternalConfig { bool _started = false; String _version = '0.0.0'; - bool _online = false; RunningPlatform _platform = RunningPlatform.unknown; String _modelIdKey = 'id'; String _modelUpdatedAtKey = 'updatedAt'; @@ -299,18 +273,6 @@ abstract class AbstractConfig implements _InternalConfig { @override String get version => _version; - /// - /// - /// - @override - bool get isOnline => _online; - - /// - /// - /// - @override - bool get isOffline => !_online; - /// /// /// @@ -400,7 +362,6 @@ abstract class AbstractConfig implements _InternalConfig { required List responsiveSizes, FollyDateParse? dateParseUpdate, FollyDateParse? dateParseDelete, - Connectivity? connectivity, PackageInfo? packageInfo, }) async { if (_started) { @@ -441,26 +402,6 @@ abstract class AbstractConfig implements _InternalConfig { packageInfo ??= await PackageInfo.fromPlatform(); _version = packageInfo.version; - - connectivity ??= Connectivity(); - - List result = await connectivity.checkConnectivity(); - - _online = result.fold( - false, - (bool p, ConnectivityResult e) => p || e != ConnectivityResult.none, - ); - - connectivity.onConnectivityChanged - .listen((List result) { - _online = result.fold( - false, - (bool p, ConnectivityResult e) => p || e != ConnectivityResult.none, - ); - if (kDebugMode) { - print('Connectivity Changed: $_online'); - } - }); } } } diff --git a/lib/util/folly_utils.dart b/lib/util/folly_utils.dart index 975b3fcb..21a34569 100644 --- a/lib/util/folly_utils.dart +++ b/lib/util/folly_utils.dart @@ -77,23 +77,15 @@ class FollyUtils { Color color, { Color darkColor = Colors.black, Color lightColor = Colors.white, - double redFactor = 0.299, - double greenFactor = 0.587, - double blueFactor = 0.114, - double threshold = 186, + double threshold = 0.183, }) => - color.red * redFactor + - color.green * greenFactor + - color.blue * blueFactor > - threshold - ? darkColor - : lightColor; + color.computeLuminance() > threshold ? darkColor : lightColor; /// /// /// static String colorHex(Color color) => - color.value.toRadixString(16).toUpperCase().padLeft(8, '0'); + colorToInt(color).toRadixString(16).toUpperCase().padLeft(8, '0'); /// /// @@ -144,7 +136,7 @@ class FollyUtils { } return MaterialColor( - color.value, + colorToInt(color), { 50: color, 100: color, @@ -159,4 +151,15 @@ class FollyUtils { }, ); } + + static int _floatToInt8(double x) { + return (x * 255.0).round() & 0xff; + } + + static int colorToInt(Color color) { + return _floatToInt8(color.a) << 24 | + _floatToInt8(color.r) << 16 | + _floatToInt8(color.g) << 8 | + _floatToInt8(color.b) << 0; + } } diff --git a/lib/util/icon_helper.dart b/lib/util/icon_helper.dart index a1c59fba..cb7bfc4e 100644 --- a/lib/util/icon_helper.dart +++ b/lib/util/icon_helper.dart @@ -2,7 +2,7 @@ import 'package:flutter/widgets.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; /// -/// Gerado para: font_awesome_flutter: 10.6.0 +/// Gerado para: font_awesome_flutter: 10.8.0 /// class IconHelper { /// @@ -293,6 +293,7 @@ class IconHelper { 'blog': FontAwesomeIcons.blog, 'blogger': FontAwesomeIcons.blogger, 'bloggerB': FontAwesomeIcons.bloggerB, + 'bluesky': FontAwesomeIcons.bluesky, 'bluetooth': FontAwesomeIcons.bluetooth, 'bluetoothB': FontAwesomeIcons.bluetoothB, 'bold': FontAwesomeIcons.bold, @@ -740,6 +741,7 @@ class IconHelper { 'dAndD': FontAwesomeIcons.dAndD, 'dAndDBeyond': FontAwesomeIcons.dAndDBeyond, 'dailymotion': FontAwesomeIcons.dailymotion, + 'dartLang': FontAwesomeIcons.dartLang, 'dashcube': FontAwesomeIcons.dashcube, 'database': FontAwesomeIcons.database, 'debian': FontAwesomeIcons.debian, @@ -1132,6 +1134,7 @@ class IconHelper { 'floppyDisk': FontAwesomeIcons.floppyDisk, 'save': FontAwesomeIcons.floppyDisk, 'florinSign': FontAwesomeIcons.florinSign, + 'flutter': FontAwesomeIcons.flutter, 'fly': FontAwesomeIcons.fly, 'solidFolder': FontAwesomeIcons.solidFolder, 'solidFolderBlank': FontAwesomeIcons.solidFolder, @@ -1503,6 +1506,7 @@ class IconHelper { 'js': FontAwesomeIcons.js, 'jsfiddle': FontAwesomeIcons.jsfiddle, 'jugDetergent': FontAwesomeIcons.jugDetergent, + 'jxl': FontAwesomeIcons.jxl, 'k': FontAwesomeIcons.k, 'kaaba': FontAwesomeIcons.kaaba, 'kaggle': FontAwesomeIcons.kaggle, @@ -1513,6 +1517,7 @@ class IconHelper { 'keycdn': FontAwesomeIcons.keycdn, 'khanda': FontAwesomeIcons.khanda, 'kickstarter': FontAwesomeIcons.kickstarter, + 'squareKickstarter': FontAwesomeIcons.kickstarter, 'kickstarterK': FontAwesomeIcons.kickstarterK, 'kipSign': FontAwesomeIcons.kipSign, 'kitMedical': FontAwesomeIcons.kitMedical, @@ -2305,11 +2310,14 @@ class IconHelper { 'twitterSquare': FontAwesomeIcons.squareTwitter, 'squareUpRight': FontAwesomeIcons.squareUpRight, 'externalLinkSquareAlt': FontAwesomeIcons.squareUpRight, + 'squareUpwork': FontAwesomeIcons.squareUpwork, 'squareViadeo': FontAwesomeIcons.squareViadeo, 'viadeoSquare': FontAwesomeIcons.squareViadeo, 'squareVimeo': FontAwesomeIcons.squareVimeo, 'vimeoSquare': FontAwesomeIcons.squareVimeo, 'squareVirus': FontAwesomeIcons.squareVirus, + 'squareWebAwesome': FontAwesomeIcons.squareWebAwesome, + 'squareWebAwesomeStroke': FontAwesomeIcons.squareWebAwesomeStroke, 'squareWhatsapp': FontAwesomeIcons.squareWhatsapp, 'whatsappSquare': FontAwesomeIcons.squareWhatsapp, 'squareXTwitter': FontAwesomeIcons.squareXTwitter, @@ -2386,8 +2394,11 @@ class IconHelper { 'table': FontAwesomeIcons.table, 'tableCells': FontAwesomeIcons.tableCells, 'th': FontAwesomeIcons.tableCells, + 'tableCellsColumnLock': FontAwesomeIcons.tableCellsColumnLock, 'tableCellsLarge': FontAwesomeIcons.tableCellsLarge, 'thLarge': FontAwesomeIcons.tableCellsLarge, + 'tableCellsRowLock': FontAwesomeIcons.tableCellsRowLock, + 'tableCellsRowUnlock': FontAwesomeIcons.tableCellsRowUnlock, 'tableColumns': FontAwesomeIcons.tableColumns, 'columns': FontAwesomeIcons.tableColumns, 'tableList': FontAwesomeIcons.tableList, @@ -2467,6 +2478,8 @@ class IconHelper { 'thumbsUp': FontAwesomeIcons.thumbsUp, 'thumbtack': FontAwesomeIcons.thumbtack, 'thumbTack': FontAwesomeIcons.thumbtack, + 'thumbtackSlash': FontAwesomeIcons.thumbtackSlash, + 'thumbTackSlash': FontAwesomeIcons.thumbtackSlash, 'ticket': FontAwesomeIcons.ticket, 'ticketSimple': FontAwesomeIcons.ticketSimple, 'ticketAlt': FontAwesomeIcons.ticketSimple, @@ -2685,6 +2698,8 @@ class IconHelper { 'swimmingPool': FontAwesomeIcons.waterLadder, 'waveSquare': FontAwesomeIcons.waveSquare, 'waze': FontAwesomeIcons.waze, + 'solidWebAwesome': FontAwesomeIcons.solidWebAwesome, + 'brandsWebAwesome': FontAwesomeIcons.brandsWebAwesome, 'webflow': FontAwesomeIcons.webflow, 'weebly': FontAwesomeIcons.weebly, 'weibo': FontAwesomeIcons.weibo, diff --git a/lib/widgets/animated_search.dart b/lib/widgets/animated_search.dart index 877abc97..8b97a2d6 100644 --- a/lib/widgets/animated_search.dart +++ b/lib/widgets/animated_search.dart @@ -40,7 +40,7 @@ class AnimatedSearchState extends State { width: expanded ? widget.maxSize : 40, decoration: BoxDecoration( borderRadius: BorderRadius.circular(8), - color: Theme.of(context).colorScheme.onSurface.withOpacity(0.1), + color: Theme.of(context).colorScheme.onSurface.withValues(alpha: 0.1), ), child: Row( mainAxisAlignment: MainAxisAlignment.end, @@ -71,7 +71,10 @@ class AnimatedSearchState extends State { padding: const EdgeInsets.fromLTRB(0, 12, 8, 12), child: Icon( FontAwesomeIcons.magnifyingGlass, - color: Theme.of(context).colorScheme.onSurface.withOpacity(0.6), + color: Theme.of(context) + .colorScheme + .onSurface + .withValues(alpha: 0.6), ), ), ), diff --git a/pubspec.lock b/pubspec.lock index 6e25ec60..857e7cac 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,14 +1,6 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: - args: - dependency: transitive - description: - name: args - sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a" - url: "https://pub.dev" - source: hosted - version: "2.5.0" async: dependency: transitive description: @@ -45,26 +37,10 @@ packages: dependency: transitive description: name: collection - sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf url: "https://pub.dev" source: hosted - version: "1.18.0" - connectivity_plus: - dependency: "direct main" - description: - name: connectivity_plus - sha256: "2056db5241f96cdc0126bd94459fc4cdc13876753768fc7a31c425e50a7177d0" - url: "https://pub.dev" - source: hosted - version: "6.0.5" - connectivity_plus_platform_interface: - dependency: transitive - description: - name: connectivity_plus_platform_interface - sha256: "42657c1715d48b167930d5f34d00222ac100475f73d10162ddf43e714932f204" - url: "https://pub.dev" - source: hosted - version: "2.0.1" + version: "1.19.0" cpf_cnpj_validator: dependency: "direct main" description: @@ -73,14 +49,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.0" - dbus: - dependency: transitive - description: - name: dbus - sha256: "365c771ac3b0e58845f39ec6deebc76e3276aa9922b0cc60840712094d9047ac" - url: "https://pub.dev" - source: hosted - version: "0.7.10" email_validator: dependency: "direct main" description: @@ -153,26 +121,26 @@ packages: dependency: "direct main" description: name: font_awesome_flutter - sha256: "275ff26905134bcb59417cf60ad979136f1f8257f2f449914b2c3e05bbb4cd6f" + sha256: d3a89184101baec7f4600d58840a764d2ef760fe1c5a20ef9e6b0e9b24a07a3a url: "https://pub.dev" source: hosted - version: "10.7.0" + version: "10.8.0" http: dependency: "direct dev" description: name: http - sha256: b9c29a161230ee03d3ccf545097fccd9b87a5264228c5d348202e0f0c28f9010 + sha256: fe7ab022b76f3034adc518fb6ea04a82387620e19977665ea18d30a1cf43442f url: "https://pub.dev" source: hosted - version: "1.2.2" + version: "1.3.0" http_parser: dependency: transitive description: name: http_parser - sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" url: "https://pub.dev" source: hosted - version: "4.0.2" + version: "4.1.2" intl: dependency: "direct main" description: @@ -185,18 +153,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" + sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06" url: "https://pub.dev" source: hosted - version: "10.0.5" + version: "10.0.7" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" + sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379" url: "https://pub.dev" source: hosted - version: "3.0.5" + version: "3.0.8" leak_tracker_testing: dependency: transitive description: @@ -209,10 +177,10 @@ packages: dependency: transitive description: name: lints - sha256: "3315600f3fb3b135be672bf4a178c55f274bebe368325ae18462c89ac1e3b413" + sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7 url: "https://pub.dev" source: hosted - version: "5.0.0" + version: "5.1.1" matcher: dependency: transitive description: @@ -237,30 +205,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.15.0" - nm: - dependency: transitive - description: - name: nm - sha256: "2c9aae4127bdc8993206464fcc063611e0e36e72018696cd9631023a31b24254" - url: "https://pub.dev" - source: hosted - version: "0.5.0" package_info_plus: dependency: "direct main" description: name: package_info_plus - sha256: df3eb3e0aed5c1107bb0fdb80a8e82e778114958b1c5ac5644fb1ac9cae8a998 + sha256: b15fad91c4d3d1f2b48c053dd41cb82da007c27407dc9ab5f9aa59881d0e39d4 url: "https://pub.dev" source: hosted - version: "8.1.0" + version: "8.1.4" package_info_plus_platform_interface: dependency: transitive description: name: package_info_plus_platform_interface - sha256: ac1f4a4847f1ade8e6a87d1f39f5d7c67490738642e2542f559ec38c37489a66 + sha256: a5ef9986efc7bf772f2696183a3992615baa76c1ffb1189318dd8803778fb05b url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.2" path: dependency: transitive description: @@ -269,14 +229,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.9.0" - petitparser: - dependency: transitive - description: - name: petitparser - sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27 - url: "https://pub.dev" - source: hosted - version: "6.0.2" plugin_platform_interface: dependency: transitive description: @@ -289,7 +241,7 @@ packages: dependency: transitive description: flutter source: sdk - version: "0.0.99" + version: "0.0.0" source_span: dependency: transitive description: @@ -310,10 +262,10 @@ packages: dependency: transitive description: name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.12.0" stream_channel: dependency: transitive description: @@ -326,10 +278,10 @@ packages: dependency: transitive description: name: string_scanner - sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3" url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.0" term_glyph: dependency: transitive description: @@ -342,18 +294,18 @@ packages: dependency: transitive description: name: test_api - sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" + sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" url: "https://pub.dev" source: hosted - version: "0.7.2" + version: "0.7.3" typed_data: dependency: transitive description: name: typed_data - sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 url: "https://pub.dev" source: hosted - version: "1.3.2" + version: "1.4.0" vector_math: dependency: transitive description: @@ -366,42 +318,34 @@ packages: dependency: transitive description: name: vm_service - sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" + sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b url: "https://pub.dev" source: hosted - version: "14.2.5" + version: "14.3.0" web: dependency: transitive description: name: web - sha256: d43c1d6b787bf0afad444700ae7f4db8827f701bc61c255ac8d328c6f4d52062 + sha256: cd3543bd5798f6ad290ea73d210f423502e71900302dde696f8bff84bf89a1cb url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.1.0" win32: dependency: transitive description: name: win32 - sha256: "84ba388638ed7a8cb3445a320c8273136ab2631cd5f2c57888335504ddab1bc2" - url: "https://pub.dev" - source: hosted - version: "5.8.0" - xml: - dependency: transitive - description: - name: xml - sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226 + sha256: daf97c9d80197ed7b619040e86c8ab9a9dad285e7671ee7390f9180cc828a51e url: "https://pub.dev" source: hosted - version: "6.5.0" + version: "5.10.1" yaml: dependency: "direct dev" description: name: yaml - sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce url: "https://pub.dev" source: hosted - version: "3.1.2" + version: "3.1.3" sdks: - dart: ">=3.5.0 <4.0.0" + dart: ">=3.6.0 <4.0.0" flutter: ">=3.22.0" diff --git a/pubspec.yaml b/pubspec.yaml index aa255939..3a6e999f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,16 +1,18 @@ name: folly_fields description: Basic form fields and utilities. -version: 3.5.0 +version: 3.6.0 repository: https://github.com/edufolly/folly_fields/ homepage: https://edufolly.github.io/folly_fields/ environment: - sdk: ">=3.4.0 <4.0.0" - flutter: ">=3.22.0" + sdk: ">=3.6.0 <4.0.0" + flutter: ">=3.27.0" dependencies: # https://pub.dev/packages/connectivity_plus - connectivity_plus: ^6.0.1 + # Apple - ITMS-91061 + # https://github.com/fluttercommunity/plus_plugins/issues/3397 + # connectivity_plus: ^6.0.1 # https://pub.dev/packages/cpf_cnpj_validator cpf_cnpj_validator: ^2.0.0 @@ -33,7 +35,7 @@ dependencies: sdk: flutter # https://pub.dev/packages/font_awesome_flutter - font_awesome_flutter: ^10.7.0 + font_awesome_flutter: ^10.8.0 # https://pub.dev/packages/intl intl: ^0.19.0 diff --git a/test/mocks/mock_connectivity.dart b/test/mocks/mock_connectivity.dart deleted file mode 100644 index 184589af..00000000 --- a/test/mocks/mock_connectivity.dart +++ /dev/null @@ -1,35 +0,0 @@ -// ignore_for_file: avoid-top-level-members-in-tests - -import 'package:connectivity_plus/connectivity_plus.dart'; - -/// -/// -/// -class MockConnectivity implements Connectivity { - List defaultResult; - - /// - /// - /// - MockConnectivity({ - this.defaultResult = const [ - ConnectivityResult.mobile, - ConnectivityResult.wifi, - ], - }); - - /// - /// - /// - @override - Future> checkConnectivity() async => defaultResult; - - /// - /// - /// - @override - Stream> get onConnectivityChanged => - Stream>.fromIterable( - >{defaultResult}, - ); -} diff --git a/test/util/folly_utils_color_by_luminance_test.dart b/test/util/folly_utils_color_by_luminance_test.dart index a67ed076..c7e53e73 100644 --- a/test/util/folly_utils_color_by_luminance_test.dart +++ b/test/util/folly_utils_color_by_luminance_test.dart @@ -8,10 +8,11 @@ import 'package:folly_fields/util/folly_utils.dart'; void main() { Map domain = { 0xFF000000: 0xFFFFFFFF, - 0xFF808080: 0xFFFFFFFF, + 0xFF333333: 0xFFFFFFFF, + 0xFF808080: 0xFF000000, 0xFF0A141E: 0xFFFFFFFF, - 0xFFC86432: 0xFFFFFFFF, - 0xFFAAAAAA: 0xFFFFFFFF, + 0xFFC86432: 0xFF000000, + 0xFFAAAAAA: 0xFF000000, 0xFFBBBBBB: 0xFF000000, 0xFFFFFFFF: 0xFF000000, }; @@ -21,7 +22,7 @@ void main() { () { for (final MapEntry(:int key, :int value) in domain.entries) { test( - 'Testing ${key.toRadixString(16)}', + 'Testing ${key.toRadixString(16)} - ${Color(key).computeLuminance()}', () => expect( FollyUtils.textColorByLuminance(Color(key)), Color(value), diff --git a/test/util/folly_utils_test.dart b/test/util/folly_utils_test.dart index b5c60601..7d614bc2 100644 --- a/test/util/folly_utils_test.dart +++ b/test/util/folly_utils_test.dart @@ -12,7 +12,7 @@ void main() { const Color staticColor = Colors.black; MaterialColor staticMaterialColor = MaterialColor( - staticColor.value, + FollyUtils.colorToInt(staticColor), const { 50: staticColor, 100: staticColor, @@ -46,7 +46,9 @@ void main() { test( 'Testing Integer Color', () => expect( - FollyUtils.createMaterialColor(intColor: staticColor.value), + FollyUtils.createMaterialColor( + intColor: FollyUtils.colorToInt(staticColor), + ), staticMaterialColor, ), ); diff --git a/test/util/model_utils/from_json_safe_list_test.dart b/test/util/model_utils/from_json_safe_list_test.dart index 38149aae..3988332b 100644 --- a/test/util/model_utils/from_json_safe_list_test.dart +++ b/test/util/model_utils/from_json_safe_list_test.dart @@ -5,7 +5,6 @@ import 'package:folly_fields/util/model_utils.dart'; import '../../mocks/crud/mock_string_consumer.dart'; import '../../mocks/crud/mock_string_model.dart'; import '../../mocks/mock_config.dart'; -import '../../mocks/mock_connectivity.dart'; import '../../mocks/mock_package_info.dart'; /// @@ -18,7 +17,6 @@ void main() { () { FollyFields.start( MockConfig(), - connectivity: MockConnectivity(), packageInfo: MockPackageInfo(), ); diff --git a/test/util/model_utils/from_json_safe_set_test.dart b/test/util/model_utils/from_json_safe_set_test.dart index 7d776848..e2ca09cb 100644 --- a/test/util/model_utils/from_json_safe_set_test.dart +++ b/test/util/model_utils/from_json_safe_set_test.dart @@ -5,7 +5,6 @@ import 'package:folly_fields/util/model_utils.dart'; import '../../mocks/crud/mock_string_consumer.dart'; import '../../mocks/crud/mock_string_model.dart'; import '../../mocks/mock_config.dart'; -import '../../mocks/mock_connectivity.dart'; import '../../mocks/mock_package_info.dart'; /// @@ -18,7 +17,6 @@ void main() { () { FollyFields.start( MockConfig(), - connectivity: MockConnectivity(), packageInfo: MockPackageInfo(), );