Skip to content

Commit

Permalink
Bump to Flutter 3.27.1
Browse files Browse the repository at this point in the history
  • Loading branch information
elibon99 committed Jan 8, 2025
1 parent d125a5c commit 6a0d2d7
Show file tree
Hide file tree
Showing 14 changed files with 91 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
FLUTTER=3.24.5
FLUTTER=3.27.1
PYVER=3.12.8
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
*.swp
.DS_Store
.atom/
.build/
.buildlog/
.history
.svn/
.swiftpm/
migrate_working_dir/

# IntelliJ related
Expand Down
24 changes: 24 additions & 0 deletions lib/app/color_extension.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import 'dart:ui';

/// This extension is to supplement deprecated_member_use for `value`
/// to convert RGBA into a 32 bit integer.
extension ColorExtension on Color {
static int floatToInt8(double x) {
return (x * 255.0).round() & 0xff;
}

/// A 32 bit value representing this color.
///
/// The bits are assigned as follows:
///
/// * Bits 24-31 are the alpha value.
/// * Bits 16-23 are the red value.
/// * Bits 8-15 are the green value.
/// * Bits 0-7 are the blue value.
int get toInt32 {
return floatToInt8(a) << 24 |
floatToInt8(r) << 16 |
floatToInt8(g) << 8 |
floatToInt8(b) << 0;
}
}
4 changes: 2 additions & 2 deletions lib/app/models.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import 'package:freezed_annotation/freezed_annotation.dart';
import '../../management/models.dart';
import '../core/models.dart';
import '../core/state.dart';
import 'color_extension.dart';

part 'models.freezed.dart';

part 'models.g.dart';

const _listEquality = ListEquality();
Expand Down Expand Up @@ -168,5 +168,5 @@ class _ColorConverter implements JsonConverter<Color?, int?> {
Color? fromJson(int? json) => json != null ? Color(json) : null;

@override
int? toJson(Color? object) => object?.value;
int? toJson(Color? object) => object?.toInt32;
}
3 changes: 2 additions & 1 deletion lib/app/state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import 'package:shared_preferences/shared_preferences.dart';

import '../core/state.dart';
import '../theme.dart';
import 'color_extension.dart';
import 'features.dart' as features;
import 'logging.dart';
import 'models.dart';
Expand Down Expand Up @@ -159,7 +160,7 @@ final primaryColorProvider = Provider<Color>((ref) {
final customization = ref.watch(keyCustomizationManagerProvider)[serial];
final deviceColor = customization?.color;
if (deviceColor != null) {
prefs.setInt(prefLastUsedColor, deviceColor.value);
prefs.setInt(prefLastUsedColor, deviceColor.toInt32);
return deviceColor;
} else {
prefs.remove(prefLastUsedColor);
Expand Down
4 changes: 2 additions & 2 deletions lib/app/views/app_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -279,11 +279,11 @@ class _AppPageState extends ConsumerState<AppPage> {
? Theme.of(context)
.colorScheme
.onSurfaceVariant
.withOpacity(0.4)
.withValues(alpha: 0.4)
: Theme.of(context)
.colorScheme
.primary
.withOpacity(0.9),
.withValues(alpha: 0.9),
),
overflow: TextOverflow.ellipsis,
),
Expand Down
3 changes: 2 additions & 1 deletion lib/app/views/fs_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ class FsDialog extends StatelessWidget {
Widget build(BuildContext context) {
final l10n = AppLocalizations.of(context)!;
return Dialog.fullscreen(
backgroundColor: Theme.of(context).colorScheme.surface.withOpacity(0.7),
backgroundColor:
Theme.of(context).colorScheme.surface.withValues(alpha: 0.7),
child: SafeArea(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
Expand Down
11 changes: 6 additions & 5 deletions lib/home/views/home_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:material_symbols_icons/symbols.dart';

import '../../android/state.dart';
import '../../app/color_extension.dart';
import '../../app/message.dart';
import '../../app/models.dart';
import '../../app/state.dart';
Expand Down Expand Up @@ -264,7 +265,7 @@ class _DeviceContent extends ConsumerWidget {
].map((e) => _ColorButton(
color: e,
isSelected:
customColor?.value == e.value,
customColor?.toInt32 == e.toInt32,
onPressed: () {
_updateColor(e, ref, serial);
Navigator.of(context).pop();
Expand Down Expand Up @@ -315,7 +316,7 @@ class _DeviceContent extends ConsumerWidget {
color: Theme.of(context)
.colorScheme
.primary
.withOpacity(0.9)),
.withValues(alpha: 0.9)),
)
],
),
Expand Down Expand Up @@ -438,11 +439,11 @@ class _HeroAvatar extends StatelessWidget {
shape: BoxShape.circle,
gradient: RadialGradient(
colors: [
color.withOpacity(0.6),
color.withOpacity(0.25),
color.withValues(alpha: 0.6),
color.withValues(alpha: 0.25),
(DialogTheme.of(context).backgroundColor ??
theme.dialogBackgroundColor)
.withOpacity(0),
.withValues(alpha: 0),
],
),
),
Expand Down
3 changes: 1 addition & 2 deletions lib/oath/views/account_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/

import 'package:collection/collection.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';

Expand Down Expand Up @@ -42,7 +41,7 @@ class AccountView extends ConsumerStatefulWidget {
}

String _a11yCredentialLabel(String? issuer, String name, String? code) {
return [issuer, name, code].whereNotNull().join(' ');
return [issuer, name, code].nonNulls.join(' ');
}

class _AccountViewState extends ConsumerState<AccountView> {
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/file_drop_overlay.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class FileDropOverlay extends StatelessWidget {
color: Theme.of(context)
.colorScheme
.secondaryContainer
.withOpacity(0.95),
.withValues(alpha: 0.95),
border: Border.all(color: Theme.of(context).colorScheme.primary),
borderRadius: const BorderRadius.all(Radius.circular(20.0))),
child: Column(
Expand Down
18 changes: 18 additions & 0 deletions lib/widgets/info_popup.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import 'package:flutter/material.dart';
import 'package:material_symbols_icons/symbols.dart';

class InfoPopup extends StatelessWidget {
final InlineSpan infoMessage;
const InfoPopup({super.key, required this.infoMessage});

@override
Widget build(BuildContext context) {
return Tooltip(
richMessage: infoMessage,
child: const Icon(
Symbols.info,
size: 18.0,
),
);
}
}
3 changes: 2 additions & 1 deletion lib/widgets/toast.dart
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ void Function() showToast(
final Color backgroundColor = isThemeDark
? colorScheme.onSurface
: Color.alphaBlend(
colorScheme.onSurface.withOpacity(0.80), colorScheme.surface);
colorScheme.onSurface.withValues(alpha: 0.80), colorScheme.surface);

final textStyle =
ThemeData(brightness: isThemeDark ? Brightness.light : Brightness.dark)
.textTheme
Expand Down
4 changes: 4 additions & 0 deletions macos/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@ class AppDelegate: FlutterAppDelegate {
// Keep app running if window closes
return false
}

override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool {
return true
}
}
48 changes: 24 additions & 24 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ packages:
dependency: transitive
description:
name: _fe_analyzer_shared
sha256: f256b0c0ba6c7577c15e2e4e114755640a875e885099367bf6e012b19314c834
sha256: "16e298750b6d0af7ce8a3ba7c18c69c3785d11b15ec83f6dcd0ad2a0009b3cab"
url: "https://pub.dev"
source: hosted
version: "72.0.0"
version: "76.0.0"
_macros:
dependency: transitive
description: dart
source: sdk
version: "0.3.2"
version: "0.3.3"
analyzer:
dependency: "direct dev"
description:
name: analyzer
sha256: b652861553cd3990d8ed361f7979dc6d7053a9ac8843fa73820ab68ce5410139
sha256: "1f14db053a8c23e260789e9b0980fa27f2680dd640932cae5e1137cce0e46e1e"
url: "https://pub.dev"
source: hosted
version: "6.7.0"
version: "6.11.0"
analyzer_plugin:
dependency: "direct dev"
description:
Expand Down Expand Up @@ -186,10 +186,10 @@ packages:
dependency: "direct main"
description:
name: collection
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf
url: "https://pub.dev"
source: hosted
version: "1.18.0"
version: "1.19.0"
convert:
dependency: "direct main"
description:
Expand Down Expand Up @@ -469,18 +469,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:
Expand Down Expand Up @@ -524,10 +524,10 @@ packages:
dependency: transitive
description:
name: macros
sha256: "0acaed5d6b7eab89f63350bccd82119e6c602df0f391260d0e32b5e23db79536"
sha256: "1d9e801cd66f7ea3663c45fc708450db1fa57f988142c64289142c9b7ee80656"
url: "https://pub.dev"
source: hosted
version: "0.1.2-main.4"
version: "0.1.3-main.0"
matcher:
dependency: transitive
description:
Expand Down Expand Up @@ -819,7 +819,7 @@ packages:
dependency: transitive
description: flutter
source: sdk
version: "0.0.99"
version: "0.0.0"
source_gen:
dependency: transitive
description:
Expand Down Expand Up @@ -856,10 +856,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"
state_notifier:
dependency: transitive
description:
Expand Down Expand Up @@ -888,10 +888,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"
sync_http:
dependency: transitive
description:
Expand All @@ -912,10 +912,10 @@ 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"
test_res:
dependency: "direct dev"
description:
Expand Down Expand Up @@ -1055,10 +1055,10 @@ 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"
watcher:
dependency: transitive
description:
Expand Down Expand Up @@ -1095,10 +1095,10 @@ packages:
dependency: transitive
description:
name: webdriver
sha256: "003d7da9519e1e5f329422b36c4dcdf18d7d2978d1ba099ea4e45ba490ed845e"
sha256: "3d773670966f02a646319410766d3b5e1037efb7f07cc68f844d5e06cd4d61c8"
url: "https://pub.dev"
source: hosted
version: "3.0.3"
version: "3.0.4"
win32:
dependency: transitive
description:
Expand Down

0 comments on commit 6a0d2d7

Please sign in to comment.