Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 3.6.0. #249

Merged
merged 1 commit into from
Feb 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion dev/fa_gen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 0 additions & 2 deletions example/macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down
7 changes: 2 additions & 5 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ environment:
flutter: ">=3.22.0"

dependencies:
# https://pub.dev/packages/connectivity_plus
connectivity_plus: 6.1.0

flutter:
sdk: flutter

Expand All @@ -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
Expand Down
3 changes: 0 additions & 3 deletions example/windows/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@

#include "generated_plugin_registrant.h"

#include <connectivity_plus/connectivity_plus_windows_plugin.h>
#include <url_launcher_windows/url_launcher_windows.h>

void RegisterPlugins(flutter::PluginRegistry* registry) {
ConnectivityPlusWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin"));
UrlLauncherWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("UrlLauncherWindows"));
}
1 change: 0 additions & 1 deletion example/windows/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#

list(APPEND FLUTTER_PLUGIN_LIST
connectivity_plus
url_launcher_windows
)

Expand Down
2 changes: 1 addition & 1 deletion lib/fields/bool_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class BoolField extends ResponsiveFormField<bool> {

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,
);

Expand Down
59 changes: 0 additions & 59 deletions lib/folly_fields.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -23,7 +22,6 @@ class FollyFields implements _InternalConfig {
List<double> responsiveSizes = const <double>[540, 720, 960, 1140],
FollyDateParse? dateParseUpdate,
FollyDateParse? dateParseDelete,
Connectivity? connectivity,
PackageInfo? packageInfo,
}) =>
FollyFields()._holder = holder
Expand All @@ -34,7 +32,6 @@ class FollyFields implements _InternalConfig {
dateParseUpdate: dateParseUpdate,
dateParseDelete: dateParseDelete,
responsiveSizes: responsiveSizes,
connectivity: connectivity,
packageInfo: packageInfo,
);

Expand All @@ -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;

///
///
///
Expand Down Expand Up @@ -202,16 +187,6 @@ abstract class _InternalConfig {
///
String get version;

///
///
///
bool get isOnline;

///
///
///
bool get isOffline;

///
///
///
Expand Down Expand Up @@ -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';
Expand All @@ -299,18 +273,6 @@ abstract class AbstractConfig implements _InternalConfig {
@override
String get version => _version;

///
///
///
@override
bool get isOnline => _online;

///
///
///
@override
bool get isOffline => !_online;

///
///
///
Expand Down Expand Up @@ -400,7 +362,6 @@ abstract class AbstractConfig implements _InternalConfig {
required List<double> responsiveSizes,
FollyDateParse? dateParseUpdate,
FollyDateParse? dateParseDelete,
Connectivity? connectivity,
PackageInfo? packageInfo,
}) async {
if (_started) {
Expand Down Expand Up @@ -441,26 +402,6 @@ abstract class AbstractConfig implements _InternalConfig {
packageInfo ??= await PackageInfo.fromPlatform();

_version = packageInfo.version;

connectivity ??= Connectivity();

List<ConnectivityResult> result = await connectivity.checkConnectivity();

_online = result.fold(
false,
(bool p, ConnectivityResult e) => p || e != ConnectivityResult.none,
);

connectivity.onConnectivityChanged
.listen((List<ConnectivityResult> result) {
_online = result.fold(
false,
(bool p, ConnectivityResult e) => p || e != ConnectivityResult.none,
);
if (kDebugMode) {
print('Connectivity Changed: $_online');
}
});
}
}
}
27 changes: 15 additions & 12 deletions lib/util/folly_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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');

///
///
Expand Down Expand Up @@ -144,7 +136,7 @@ class FollyUtils {
}

return MaterialColor(
color.value,
colorToInt(color),
<int, Color>{
50: color,
100: color,
Expand All @@ -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;
}
}
17 changes: 16 additions & 1 deletion lib/util/icon_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
///
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
7 changes: 5 additions & 2 deletions lib/widgets/animated_search.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class AnimatedSearchState extends State<AnimatedSearch> {
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,
Expand Down Expand Up @@ -71,7 +71,10 @@ class AnimatedSearchState extends State<AnimatedSearch> {
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),
),
),
),
Expand Down
Loading