diff --git a/api/pubspec.lock b/api/pubspec.lock index 367c14ee142f..452df5e7445f 100644 --- a/api/pubspec.lock +++ b/api/pubspec.lock @@ -5,23 +5,23 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: "45cfa8471b89fb6643fe9bf51bd7931a76b8f5ec2d65de4fb176dba8d4f22c77" + sha256: "16e298750b6d0af7ce8a3ba7c18c69c3785d11b15ec83f6dcd0ad2a0009b3cab" url: "https://pub.dev" source: hosted - version: "73.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: "4959fec185fe70cce007c57e9ab6983101dbe593d2bf8bbfb4453aaec0cf470a" + sha256: "1f14db053a8c23e260789e9b0980fa27f2680dd640932cae5e1137cce0e46e1e" url: "https://pub.dev" source: hosted - version: "6.8.0" + version: "6.11.0" archive: dependency: "direct main" description: @@ -298,10 +298,10 @@ packages: dependency: "direct dev" description: name: lints - sha256: "3315600f3fb3b135be672bf4a178c55f274bebe368325ae18462c89ac1e3b413" + sha256: "4a16b3f03741e1252fda5de3ce712666d010ba2122f8e912c94f9f7b90e1a4c3" url: "https://pub.dev" source: hosted - version: "5.0.0" + version: "5.1.0" logging: dependency: transitive description: @@ -323,10 +323,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: @@ -664,4 +664,4 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.5.0 <4.0.0" + dart: ">=3.6.0-0 <4.0.0" diff --git a/app/lib/cubits/settings.dart b/app/lib/cubits/settings.dart index e4b1a16de254..8fbbb9d241ad 100644 --- a/app/lib/cubits/settings.dart +++ b/app/lib/cubits/settings.dart @@ -102,7 +102,7 @@ class InputConfiguration with _$InputConfiguration { firstPenButton, secondPenButton, touch - }.whereNotNull().toSet(); + }.nonNulls.toSet(); } enum SortBy { name, created, modified } diff --git a/app/lib/dialogs/area/context.dart b/app/lib/dialogs/area/context.dart index cd703af3db40..98a94ccd0401 100644 --- a/app/lib/dialogs/area/context.dart +++ b/app/lib/dialogs/area/context.dart @@ -5,7 +5,6 @@ import 'package:butterfly/helpers/point.dart'; import 'package:butterfly/helpers/rect.dart'; import 'package:butterfly/widgets/context_menu.dart'; import 'package:butterfly_api/butterfly_api.dart'; -import 'package:collection/collection.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; @@ -72,7 +71,7 @@ ContextMenuBuilder buildAreaContextMenu(DocumentBloc bloc, .map((e) => e.transform( position: -area.position.toOffset(), relative: true)) .map((e) => e?.element) - .whereNotNull() + .nonNulls .toList(), )(context) ]; diff --git a/app/lib/dialogs/elements.dart b/app/lib/dialogs/elements.dart index cf9c9c861336..0e7ea62c439d 100644 --- a/app/lib/dialogs/elements.dart +++ b/app/lib/dialogs/elements.dart @@ -5,7 +5,6 @@ import 'package:butterfly/services/export.dart'; import 'package:butterfly/visualizer/event.dart'; import 'package:butterfly/widgets/context_menu.dart'; import 'package:butterfly_api/butterfly_api.dart'; -import 'package:collection/collection.dart'; import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:lw_sysapi/lw_sysapi.dart'; @@ -92,7 +91,7 @@ ContextMenuBuilder buildElementsContextMenu( final state = bloc.state; if (state is! DocumentLoadSuccess) return; bloc.add(ElementsRemoved( - renderers.map((r) => r.element.id).whereNotNull().toList())); + renderers.map((r) => r.element.id).nonNulls.toList())); }, icon: const PhosphorIcon(PhosphorIconsLight.trash), label: AppLocalizations.of(context).delete, @@ -111,7 +110,7 @@ ContextMenuBuilder buildElementsContextMenu( e, renderers .map((r) => r.element.id) - .whereNotNull() + .nonNulls .toList())); }, )) @@ -130,7 +129,7 @@ ContextMenuBuilder buildElementsContextMenu( onPressed: () { operations.values .map((v) => v[e]) - .whereNotNull() + .nonNulls .forEach((e) => e(bloc, context)); if (context.mounted) Navigator.of(context).pop(true); }, diff --git a/app/lib/dialogs/packs/color_pick.dart b/app/lib/dialogs/packs/color_pick.dart index 2346044b0dab..8acd72315086 100644 --- a/app/lib/dialogs/packs/color_pick.dart +++ b/app/lib/dialogs/packs/color_pick.dart @@ -249,7 +249,7 @@ class _ColorPalettePickerDialogState extends State { child: Material( color: Theme.of(context) .scaffoldBackgroundColor - .withOpacity(0.5), + .withValues(alpha: 0.5), shape: const RoundedRectangleBorder( borderRadius: BorderRadius.all(Radius.circular(32))), diff --git a/app/lib/dialogs/packs/select.dart b/app/lib/dialogs/packs/select.dart index b5c77a5c42a3..e3dfd63676e7 100644 --- a/app/lib/dialogs/packs/select.dart +++ b/app/lib/dialogs/packs/select.dart @@ -1,5 +1,4 @@ import 'package:butterfly_api/butterfly_api.dart'; -import 'package:collection/collection.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; @@ -24,7 +23,7 @@ class SelectPackAssetDialog extends StatelessWidget { List _getAssets(NoteData document) => document .getPacks() .map((e) => document.getPack(e)) - .whereNotNull() + .nonNulls .expand((pack) => switch (type) { PackAssetType.component => pack.getComponents(), PackAssetType.style => pack.getStyles(), diff --git a/app/lib/dialogs/packs/styles/text.dart b/app/lib/dialogs/packs/styles/text.dart index 015a6a6080f9..379ed172491b 100644 --- a/app/lib/dialogs/packs/styles/text.dart +++ b/app/lib/dialogs/packs/styles/text.dart @@ -53,6 +53,7 @@ class _TextStyleViewState extends State { widget.onChanged(widget.value.copyWith(color: null))), defaultColor: null, onChanged: (color) => + // ignore: deprecated_member_use widget.onChanged(widget.value.copyWith(color: color.value))), ColorField( title: Text(AppLocalizations.of(context).background), @@ -72,6 +73,7 @@ class _TextStyleViewState extends State { widget.value.copyWith(backgroundColor: null))), defaultColor: null, onChanged: (color) => widget.onChanged( + // ignore: deprecated_member_use widget.value.copyWith(backgroundColor: color.value))), ExactSlider( header: Text(AppLocalizations.of(context).size), @@ -216,6 +218,7 @@ class _TextStyleViewState extends State { .copyWith(decorationColor: null))), defaultColor: null, onChanged: (color) => widget.onChanged(widget.value + // ignore: deprecated_member_use .copyWith(decorationColor: color.value))), Padding( padding: const EdgeInsets.all(16.0), diff --git a/app/lib/dialogs/texture.dart b/app/lib/dialogs/texture.dart index ecf94be41d96..78f864ff5844 100644 --- a/app/lib/dialogs/texture.dart +++ b/app/lib/dialogs/texture.dart @@ -40,6 +40,7 @@ class _TextureViewState extends State { title: Text(AppLocalizations.of(context).color), value: Color(widget.value.boxColor), onChanged: (value) => + // ignore: deprecated_member_use widget.onChanged(widget.value.copyWith(boxColor: value.value)), ), const SizedBox(height: 16), @@ -60,6 +61,7 @@ class _TextureViewState extends State { value: Color(widget.value.boxXColor), title: Text(AppLocalizations.of(context).color), onChanged: (value) => widget + // ignore: deprecated_member_use .onChanged(widget.value.copyWith(boxXColor: value.value)), ), const SizedBox(height: 16), @@ -99,6 +101,7 @@ class _TextureViewState extends State { title: Text(AppLocalizations.of(context).color), value: Color(widget.value.boxYColor), onChanged: (value) => widget + // ignore: deprecated_member_use .onChanged(widget.value.copyWith(boxYColor: value.value)), ), const SizedBox(height: 16), diff --git a/app/lib/handlers/area.dart b/app/lib/handlers/area.dart index 9ee3e9dfc9bd..c360c83e6d43 100644 --- a/app/lib/handlers/area.dart +++ b/app/lib/handlers/area.dart @@ -53,7 +53,7 @@ class AreaHandler extends Handler { ...[ _currentArea, ...page.areas.where((element) => element.name != _currentArea?.name) - ].whereNotNull().map((e) => AreaForegroundRenderer(e)) + ].nonNulls.map((e) => AreaForegroundRenderer(e)) ], _selectionManager.renderer, ]; @@ -82,7 +82,9 @@ class AreaHandler extends Handler { bool onScaleStart(ScaleStartDetails details, EventContext context) { final currentIndex = context.getCurrentIndex(); if (currentIndex.buttons == kSecondaryMouseButton && - currentIndex.temporaryHandler == null) return true; + currentIndex.temporaryHandler == null) { + return true; + } final transform = context.getCameraTransform(); final globalPos = transform.localToGlobal(details.localFocalPoint); if (_selectionManager.isValid) { diff --git a/app/lib/handlers/import.dart b/app/lib/handlers/import.dart index a21f33ea6e29..6d4383f7048b 100644 --- a/app/lib/handlers/import.dart +++ b/app/lib/handlers/import.dart @@ -59,7 +59,7 @@ class ImportHandler extends Handler { state.page, )) .map((e) => e.transform(position: _offset, relative: true)?.element) - .whereNotNull() + .nonNulls .toList())); context .getCurrentIndexCubit() diff --git a/app/lib/handlers/laser.dart b/app/lib/handlers/laser.dart index 32e1c8d24d8c..983862d328b1 100644 --- a/app/lib/handlers/laser.dart +++ b/app/lib/handlers/laser.dart @@ -45,10 +45,11 @@ class LaserHandler extends Handler with ColoredHandler { return element.copyWith(points: subPoints); } var color = Color(data.color); - final toolOpacity = color.opacity; + final toolOpacity = color.a; final opacity = (1 - delta) * toolOpacity; - color = color.withOpacity(opacity.clamp(0, 1)); + color = color.withValues(alpha: opacity.clamp(0, 1)); return element.copyWith( + // ignore: deprecated_member_use property: element.property.copyWith(color: color.value), ); } @@ -88,8 +89,7 @@ class LaserHandler extends Handler with ColoredHandler { } void _submit(DocumentBloc bloc, List indexes) { - final elements = - indexes.map((e) => _elements.remove(e)).whereNotNull().toList(); + final elements = indexes.map((e) => _elements.remove(e)).nonNulls.toList(); if (elements.isEmpty) return; _submittedElements.addAll(elements); bloc.refresh(); diff --git a/app/lib/handlers/path_eraser.dart b/app/lib/handlers/path_eraser.dart index a0c25de78ec6..9c4682781f49 100644 --- a/app/lib/handlers/path_eraser.dart +++ b/app/lib/handlers/path_eraser.dart @@ -62,7 +62,7 @@ class PathEraserHandler extends Handler { final page = state?.page; if (page == null) return; if (!data.eraseElements) ray = ray.where((e) => e.element.isStroke()); - var ids = ray.map((e) => e.element.id).whereNotNull(); + var ids = ray.map((e) => e.element.id).nonNulls; _erased.addAll(ids); _currentlyErasing = false; } diff --git a/app/lib/handlers/pen.dart b/app/lib/handlers/pen.dart index 7ac833fafc5b..7e2d0367d6da 100644 --- a/app/lib/handlers/pen.dart +++ b/app/lib/handlers/pen.dart @@ -62,7 +62,7 @@ class PenHandler extends Handler with ColoredHandler { // Submit elements for processing and rendering. Future submitElements(DocumentBloc bloc, List indexes) async { final elements = - indexes.map((e) => this.elements.remove(e)).whereNotNull().toList(); + indexes.map((e) => this.elements.remove(e)).nonNulls.toList(); if (elements.isEmpty) return; lastPosition.removeWhere((key, value) => indexes.contains(key)); bloc.add(ElementsCreated(elements)); diff --git a/app/lib/handlers/select.dart b/app/lib/handlers/select.dart index 6391a26e1ac8..8043239e43b5 100644 --- a/app/lib/handlers/select.dart +++ b/app/lib/handlers/select.dart @@ -50,7 +50,7 @@ class SelectHandler extends Handler { changed = true; return renderer; }) - .whereNotNull() + .nonNulls .toList(); _updateSelectionRect(); return changed; @@ -149,7 +149,7 @@ class SelectHandler extends Handler { final id = _selected[i].element.id; if (id == null) return null; return MapEntry(id, [e.element]); - }).whereNotNull()))); + }).nonNulls))); if (_duplicate) { return _selected; } @@ -446,7 +446,7 @@ class SelectHandler extends Handler { if (state is! DocumentLoadSuccess) return; if (cut) { bloc.add(ElementsRemoved( - _selected.map((r) => r.element.id).whereNotNull().toList())); + _selected.map((r) => r.element.id).nonNulls.toList())); } final point = getSelectionRect()?.topLeft; if (point == null) return; @@ -498,7 +498,7 @@ class SelectHandler extends Handler { final state = bloc.state; if (state is! DocumentLoadSuccess) return null; context.read().add(ElementsRemoved( - _selected.map((r) => r.element.id).whereNotNull().toList())); + _selected.map((r) => r.element.id).nonNulls.toList())); _selected.clear(); bloc.refresh(); return null; diff --git a/app/lib/handlers/spacer.dart b/app/lib/handlers/spacer.dart index 9df3c3ef9528..73bd6d8f44a1 100644 --- a/app/lib/handlers/spacer.dart +++ b/app/lib/handlers/spacer.dart @@ -90,7 +90,7 @@ class SpacerHandler extends Handler { ); }, ) - .whereNotNull() + .nonNulls .toList() ?? []); _startPosition = null; diff --git a/app/lib/renderers/cursors/label.dart b/app/lib/renderers/cursors/label.dart index eb8adb56c299..e6c63f388f99 100644 --- a/app/lib/renderers/cursors/label.dart +++ b/app/lib/renderers/cursors/label.dart @@ -1,3 +1,5 @@ +// ignore_for_file: deprecated_member_use + import 'package:butterfly/cubits/transform.dart'; import 'package:butterfly_api/butterfly_api.dart'; import 'package:flutter/material.dart'; diff --git a/app/lib/renderers/foregrounds/area.dart b/app/lib/renderers/foregrounds/area.dart index 4d9a6adc9a2a..7d742a1f4235 100644 --- a/app/lib/renderers/foregrounds/area.dart +++ b/app/lib/renderers/foregrounds/area.dart @@ -16,8 +16,8 @@ class AreaForegroundRenderer extends Renderer { ..color = colorScheme?.primary ?? Colors.blue; var backgroundPaint = Paint() ..style = PaintingStyle.fill - ..color = - (colorScheme?.primaryContainer ?? Colors.lightBlue).withOpacity(0.2); + ..color = (colorScheme?.primaryContainer ?? Colors.lightBlue) + .withValues(alpha: 0.2); canvas.drawRRect( RRect.fromRectAndRadius(rect, Radius.circular(5 / transform.size)), paint); diff --git a/app/lib/renderers/foregrounds/select.dart b/app/lib/renderers/foregrounds/select.dart index 3d4d3d5da577..64c284255f82 100644 --- a/app/lib/renderers/foregrounds/select.dart +++ b/app/lib/renderers/foregrounds/select.dart @@ -25,7 +25,7 @@ class LassoSelectionForegroundRenderer extends Renderer> { ..strokeJoin = StrokeJoin.round ..isAntiAlias = true; final fillPaint = Paint() - ..color = scheme.primaryContainer.withOpacity(0.2) + ..color = scheme.primaryContainer.withValues(alpha: 0.2) ..style = PaintingStyle.fill; final path = Path(); path.addPolygon(element, true); diff --git a/app/lib/selections/elements/element.dart b/app/lib/selections/elements/element.dart index 6a77b41f18cd..f6917c3638ec 100644 --- a/app/lib/selections/elements/element.dart +++ b/app/lib/selections/elements/element.dart @@ -108,11 +108,10 @@ class ElementSelection extends Selection> { update(context, renderers); } - Rect? get rect => - _expandRects(selected.map((e) => e.rect).whereNotNull().toList()); + Rect? get rect => _expandRects(selected.map((e) => e.rect).nonNulls.toList()); Rect? get expandedRect => - _expandRects(selected.map((e) => e.expandedRect).whereNotNull().toList()); + _expandRects(selected.map((e) => e.expandedRect).nonNulls.toList()); Rect? _expandRects(List rects) { var rect = rects.firstOrNull; @@ -130,7 +129,7 @@ class ElementSelection extends Selection> { final bloc = context.read(); final state = bloc.state; if (state is! DocumentLoadSuccess) return; - final ids = selected.map((r) => r.element.id).whereNotNull().toList(); + final ids = selected.map((r) => r.element.id).nonNulls.toList(); context.read().add(ElementsRemoved(ids)); } diff --git a/app/lib/selections/elements/pen.dart b/app/lib/selections/elements/pen.dart index 52e28b4ceea4..d0648fe77b68 100644 --- a/app/lib/selections/elements/pen.dart +++ b/app/lib/selections/elements/pen.dart @@ -15,6 +15,7 @@ class PenElementSelection extends ElementSelection { context, elements .map((e) => e.copyWith( + // ignore: deprecated_member_use property: e.property.copyWith(color: color.value))) .toList()), ), diff --git a/app/lib/selections/elements/shape.dart b/app/lib/selections/elements/shape.dart index 37a638c1b580..c17d6355b31a 100644 --- a/app/lib/selections/elements/shape.dart +++ b/app/lib/selections/elements/shape.dart @@ -15,10 +15,12 @@ class ShapeElementSelection extends ElementSelection { context, elements .map((e) => e.copyWith( + // ignore: deprecated_member_use property: e.property.copyWith(color: color.value))) .toList()), ), ExactSlider( + // ignore: deprecated_member_use value: Color(element.property.color).alpha.toDouble(), header: Text(AppLocalizations.of(context).alpha), fractionDigits: 0, diff --git a/app/lib/selections/properties/pen.dart b/app/lib/selections/properties/pen.dart index 8915fc973607..b2f705f534ac 100644 --- a/app/lib/selections/properties/pen.dart +++ b/app/lib/selections/properties/pen.dart @@ -16,10 +16,12 @@ class PenPropertySelection extends PropertySelection ColorField( value: Color(property.color), onChanged: (value) => + // ignore: deprecated_member_use onChanged(property.copyWith(color: value.value)), title: Text(AppLocalizations.of(context).color), ), ExactSlider( + // ignore: deprecated_member_use value: Color(property.color).alpha.toDouble(), header: Text(AppLocalizations.of(context).alpha), fractionDigits: 0, diff --git a/app/lib/selections/tools/label.dart b/app/lib/selections/tools/label.dart index eb49f47a7675..cced00d36004 100644 --- a/app/lib/selections/tools/label.dart +++ b/app/lib/selections/tools/label.dart @@ -12,12 +12,15 @@ class LabelToolSelection extends ToolSelection { ...super.buildProperties(context), ColorField( value: Color(selected.first.foreground), - onChanged: (value) => update(context, + onChanged: (value) => update( + context, + // ignore: deprecated_member_use selected.map((e) => e.copyWith(foreground: value.value)).toList()), title: Text(AppLocalizations.of(context).foreground), ), ExactSlider( header: Text(AppLocalizations.of(context).alpha), + // ignore: deprecated_member_use value: Color(selected.first.foreground).alpha.toDouble(), defaultValue: 255, min: 0, @@ -28,6 +31,7 @@ class LabelToolSelection extends ToolSelection { selected .map((e) => e.copyWith( foreground: + // ignore: deprecated_member_use Color(e.foreground).withAlpha(value.toInt()).value)) .toList()), ), diff --git a/app/lib/selections/tools/laser.dart b/app/lib/selections/tools/laser.dart index dce7b6ac3073..86086ee088df 100644 --- a/app/lib/selections/tools/laser.dart +++ b/app/lib/selections/tools/laser.dart @@ -34,6 +34,7 @@ class LaserToolSelection extends ToolSelection { value: Color(selected.first.color), onChanged: (value) => update( context, + // ignore: deprecated_member_use selected.map((e) => e.copyWith(color: value.value)).toList(), ), title: Text(AppLocalizations.of(context).color), diff --git a/app/lib/selections/tools/shape.dart b/app/lib/selections/tools/shape.dart index 58793771b8cf..0e6b453beb06 100644 --- a/app/lib/selections/tools/shape.dart +++ b/app/lib/selections/tools/shape.dart @@ -88,11 +88,13 @@ class ShapeToolSelection extends ToolSelection { context, selected .map((e) => e.copyWith( + // ignore: deprecated_member_use property: e.property.copyWith(color: color.value))) .toList()), title: Text(AppLocalizations.of(context).color), ), ExactSlider( + // ignore: deprecated_member_use value: Color(property.color).alpha.toDouble(), header: Text(AppLocalizations.of(context).alpha), fractionDigits: 0, @@ -238,9 +240,11 @@ class _CircleShapeView extends StatelessWidget { title: Text(AppLocalizations.of(context).fill), leading: const PhosphorIcon(PhosphorIconsLight.paintBucket), defaultColor: Colors.transparent, + // ignore: deprecated_member_use onChanged: (color) => onChanged(shape.copyWith(fillColor: color.value)), ), ExactSlider( + // ignore: deprecated_member_use value: Color(shape.fillColor).alpha.toDouble(), header: Text(AppLocalizations.of(context).alpha), fractionDigits: 0, @@ -267,9 +271,11 @@ class _TriangleShapeView extends StatelessWidget { title: Text(AppLocalizations.of(context).fill), leading: const PhosphorIcon(PhosphorIconsLight.paintBucket), defaultColor: Colors.transparent, + // ignore: deprecated_member_use onChanged: (color) => onChanged(shape.copyWith(fillColor: color.value)), ), ExactSlider( + // ignore: deprecated_member_use value: Color(shape.fillColor).alpha.toDouble(), header: Text(AppLocalizations.of(context).alpha), fractionDigits: 0, @@ -304,9 +310,11 @@ class _RectangleShapeViewState extends State<_RectangleShapeView> { value: Color(widget.shape.fillColor), defaultColor: Colors.transparent, onChanged: (color) => + // ignore: deprecated_member_use widget.onChanged(widget.shape.copyWith(fillColor: color.value)), ), ExactSlider( + // ignore: deprecated_member_use value: Color(widget.shape.fillColor).alpha.toDouble(), header: Text(AppLocalizations.of(context).alpha), fractionDigits: 0, diff --git a/app/lib/selections/utilities.dart b/app/lib/selections/utilities.dart index 46d4fc8c114d..194ce4043ad4 100644 --- a/app/lib/selections/utilities.dart +++ b/app/lib/selections/utilities.dart @@ -232,6 +232,7 @@ class _UtilitiesViewState extends State<_UtilitiesView> title: Text(AppLocalizations.of(context).color), value: Color(widget.option.gridColor), onChanged: (value) => widget.onToolChanged( + // ignore: deprecated_member_use widget.option.copyWith(gridColor: value.value), ), ), @@ -239,6 +240,7 @@ class _UtilitiesViewState extends State<_UtilitiesView> ExactSlider( header: Text(AppLocalizations.of(context).alpha), value: Color(widget.option.gridColor) + // ignore: deprecated_member_use .alpha .toDouble(), defaultValue: 255, @@ -249,6 +251,7 @@ class _UtilitiesViewState extends State<_UtilitiesView> widget.option.copyWith( gridColor: Color(widget.option.gridColor) .withAlpha(value.toInt()) + // ignore: deprecated_member_use .value, ), ), diff --git a/app/lib/services/import.dart b/app/lib/services/import.dart index 9c87ac555c6c..e800a3d79762 100644 --- a/app/lib/services/import.dart +++ b/app/lib/services/import.dart @@ -182,7 +182,7 @@ class ImportService { .firstWhereOrNull((f) => reader.canProvide(f)); return format == null ? null : (e, format); }) - .whereNotNull() + .nonNulls .firstOrNull; if (result == null) return null; if (result.$2 is FileFormat) { @@ -267,7 +267,7 @@ class ImportService { } else if (bloc == null) { return data; } - for (final page in pages.map((e) => data.getPage(e)).whereNotNull()) { + for (final page in pages.map((e) => data.getPage(e)).nonNulls) { if (advanced) { document = document.addPage(page).$1; } else { @@ -275,7 +275,7 @@ class ImportService { } bloc?.add(PageAdded(null, page)); } - for (final packs in packs.map((e) => data.getPack(e)).whereNotNull()) { + for (final packs in packs.map((e) => data.getPack(e)).nonNulls) { document = document.setPack(packs); bloc?.add(PackAdded(packs)); } diff --git a/app/lib/views/files/list.dart b/app/lib/views/files/list.dart index f2c2ee8bf645..7f41356ed570 100644 --- a/app/lib/views/files/list.dart +++ b/app/lib/views/files/list.dart @@ -412,7 +412,7 @@ class FileEntityListTile extends StatelessWidget { ), IconButton( icon: const PhosphorIcon(PhosphorIconsLight.trash), - highlightColor: colorScheme.error.withOpacity(0.2), + highlightColor: colorScheme.error.withValues(alpha: 0.2), tooltip: AppLocalizations.of(context).delete, onPressed: () { onDelete(); diff --git a/app/lib/views/navigator/components.dart b/app/lib/views/navigator/components.dart index 705e96e3dc13..5332d30600ec 100644 --- a/app/lib/views/navigator/components.dart +++ b/app/lib/views/navigator/components.dart @@ -72,7 +72,7 @@ class _ComponentsViewState extends State { if (component == null) return null; return (e, component); }) - .whereNotNull() + .nonNulls .map((e) { final location = PackAssetLocation( currentPack!, diff --git a/app/lib/views/navigator/pages.dart b/app/lib/views/navigator/pages.dart index 6c65b20be3a1..d65c353599ab 100644 --- a/app/lib/views/navigator/pages.dart +++ b/app/lib/views/navigator/pages.dart @@ -100,7 +100,9 @@ class _PagesViewState extends State { onReorder: (oldIndex, newIndex) { if (oldIndex < 0 || newIndex < 0 || - oldIndex >= all.length) return; + oldIndex >= all.length) { + return; + } final current = all[oldIndex]; final name = current.path; final isFile = current.isFile; diff --git a/app/lib/views/toolbar/color.dart b/app/lib/views/toolbar/color.dart index 55d5dc2962c7..0999f31d71b4 100644 --- a/app/lib/views/toolbar/color.dart +++ b/app/lib/views/toolbar/color.dart @@ -69,6 +69,7 @@ class _ColorToolbarViewState extends State { final document = state.data; ColorPalette? palette; NoteData? pack; + // ignore: deprecated_member_use int color = Color(widget.color).withAlpha(255).value; void addColor() async { diff --git a/app/lib/views/toolbar/components.dart b/app/lib/views/toolbar/components.dart index 8f70880f492a..58ad23566782 100644 --- a/app/lib/views/toolbar/components.dart +++ b/app/lib/views/toolbar/components.dart @@ -67,7 +67,7 @@ class _ComponentsToolbarViewState extends State { if (component == null) return null; return (e, component); }) - .whereNotNull() + .nonNulls .toList() ?? []; return Row( diff --git a/app/lib/views/toolbar/label.dart b/app/lib/views/toolbar/label.dart index c3ba9034b3bd..10b79487d78e 100644 --- a/app/lib/views/toolbar/label.dart +++ b/app/lib/views/toolbar/label.dart @@ -580,9 +580,11 @@ class _LabelToolbarViewState extends State { if (result == null) return; updateSpan((value) => value.copyWith( color: Color(result) - .withAlpha( - Color(widget.value.tool.foreground) - .alpha) + .withValues( + alpha: Color(widget + .value.tool.foreground) + .a) + // ignore: deprecated_member_use .value)); }, ), diff --git a/app/lib/views/toolbar/presentation/timeline.dart b/app/lib/views/toolbar/presentation/timeline.dart index bad51823855b..ba290424abda 100644 --- a/app/lib/views/toolbar/presentation/timeline.dart +++ b/app/lib/views/toolbar/presentation/timeline.dart @@ -40,7 +40,7 @@ class _PresentationTimelineViewState extends State { height: 50, decoration: BoxDecoration( border: Border.all( - color: colorScheme.onSurface.withOpacity(0.2), + color: colorScheme.onSurface.withValues(alpha: 0.2), ), borderRadius: BorderRadius.circular(4), ), diff --git a/app/lib/views/view.dart b/app/lib/views/view.dart index 5d106c25293e..c521959d9f08 100644 --- a/app/lib/views/view.dart +++ b/app/lib/views/view.dart @@ -227,7 +227,9 @@ class _MainViewViewportState extends State if (openView) openView = details.scale == 1; final settings = context.read().state; if (cubit.fetchHandler() == null && - !settings.inputGestures) return; + !settings.inputGestures) { + return; + } var current = details.scale; current = current - size; var sensitivity = context diff --git a/app/pubspec.lock b/app/pubspec.lock index f77d78a0f561..4a7a3889702b 100644 --- a/app/pubspec.lock +++ b/app/pubspec.lock @@ -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: transitive description: name: analyzer - sha256: b652861553cd3990d8ed361f7979dc6d7053a9ac8843fa73820ab68ce5410139 + sha256: "1f14db053a8c23e260789e9b0980fa27f2680dd640932cae5e1137cce0e46e1e" url: "https://pub.dev" source: hosted - version: "6.7.0" + version: "6.11.0" animations: dependency: "direct main" description: @@ -249,10 +249,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" connectivity_plus: dependency: "direct main" description: @@ -657,10 +657,10 @@ packages: dependency: transitive description: name: http_parser - sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + sha256: "76d306a1c3afb33fe82e2bbacad62a61f409b5634c915fceb0d799de1a913360" url: "https://pub.dev" source: hosted - version: "4.0.2" + version: "4.1.1" idb_shim: dependency: "direct main" description: @@ -742,18 +742,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: @@ -766,10 +766,10 @@ packages: dependency: transitive description: name: lints - sha256: "3315600f3fb3b135be672bf4a178c55f274bebe368325ae18462c89ac1e3b413" + sha256: "4a16b3f03741e1252fda5de3ce712666d010ba2122f8e912c94f9f7b90e1a4c3" url: "https://pub.dev" source: hosted - version: "5.0.0" + version: "5.1.0" logging: dependency: transitive description: @@ -809,10 +809,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" markdown: dependency: "direct main" description: @@ -1270,10 +1270,10 @@ packages: dependency: transitive description: name: shelf - sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 + sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12 url: "https://pub.dev" source: hosted - version: "1.4.1" + version: "1.4.2" shelf_web_socket: dependency: transitive description: @@ -1286,7 +1286,7 @@ packages: dependency: transitive description: flutter source: sdk - version: "0.0.99" + version: "0.0.0" source_gen: dependency: transitive description: @@ -1323,10 +1323,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: @@ -1347,10 +1347,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" super_clipboard: dependency: "direct main" description: @@ -1395,10 +1395,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" timing: dependency: transitive description: @@ -1531,10 +1531,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: @@ -1571,10 +1571,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: @@ -1624,5 +1624,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.5.0 <4.0.0" - flutter: ">=3.24.5" + dart: ">=3.6.0-0 <4.0.0" + flutter: ">=3.27.0" diff --git a/app/pubspec.yaml b/app/pubspec.yaml index 70cc9b0af842..97e6061a8b47 100644 --- a/app/pubspec.yaml +++ b/app/pubspec.yaml @@ -17,7 +17,7 @@ version: 2.2.3-rc.1+124 environment: sdk: ">=3.4.0 <4.0.0" - flutter: 3.24.5 + flutter: 3.27.0 dependencies: flutter: diff --git a/docs/package.json b/docs/package.json index c4c089e5abce..6c06f57ad551 100644 --- a/docs/package.json +++ b/docs/package.json @@ -12,7 +12,7 @@ "dependencies": { "@astrojs/check": "^0.9.4", "@astrojs/react": "^3.6.3", - "@astrojs/starlight": "^0.29.2", + "@astrojs/starlight": "^0.29.3", "@phosphor-icons/react": "^2.1.7", "@types/react": "^18.3.16", "@types/react-dom": "^18.3.5", diff --git a/docs/pnpm-lock.yaml b/docs/pnpm-lock.yaml index e40972dc178e..8a4548ed0b53 100644 --- a/docs/pnpm-lock.yaml +++ b/docs/pnpm-lock.yaml @@ -15,8 +15,8 @@ importers: specifier: ^3.6.3 version: 3.6.3(@types/react-dom@18.3.5(@types/react@18.3.16))(@types/react@18.3.16)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.82.0)(terser@5.36.0) '@astrojs/starlight': - specifier: ^0.29.2 - version: 0.29.2(astro@4.16.17(rollup@4.28.1)(sass@1.82.0)(terser@5.36.0)(typescript@5.7.2)) + specifier: ^0.29.3 + version: 0.29.3(astro@4.16.17(rollup@4.28.1)(sass@1.82.0)(terser@5.36.0)(typescript@5.7.2)) '@phosphor-icons/react': specifier: ^2.1.7 version: 2.1.7(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -107,8 +107,8 @@ packages: '@astrojs/sitemap@3.2.1': resolution: {integrity: sha512-uxMfO8f7pALq0ADL6Lk68UV6dNYjJ2xGUzyjjVj60JLBs5a6smtlkBYv3tQ0DzoqwS7c9n4FUx5lgv0yPo/fgA==} - '@astrojs/starlight@0.29.2': - resolution: {integrity: sha512-xv9AhWkP3fxCB6EF6MlT4yEbxzye3aMSbuVbFEGbQh8G/w1MPhdNCnQakIHpmIwwyxwG9cW3mQdAZum4oOO39w==} + '@astrojs/starlight@0.29.3': + resolution: {integrity: sha512-dzKuGBA7sodGV2dCzpby6UKMx/4b7WrhcYDYlhfX5Ntxh8DCdGU1hIu8jHso/LeFv/jNAfi7m6C7+w/PNSYRgA==} peerDependencies: astro: ^4.14.0 @@ -501,8 +501,8 @@ packages: cpu: [x64] os: [win32] - '@jridgewell/gen-mapping@0.3.5': - resolution: {integrity: sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==} + '@jridgewell/gen-mapping@0.3.8': + resolution: {integrity: sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==} engines: {node: '>=6.0.0'} '@jridgewell/resolve-uri@3.1.2': @@ -806,6 +806,9 @@ packages: '@types/hast@3.0.4': resolution: {integrity: sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==} + '@types/js-yaml@4.0.9': + resolution: {integrity: sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg==} + '@types/mdast@4.0.4': resolution: {integrity: sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==} @@ -2374,10 +2377,10 @@ packages: resolution: {integrity: sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g==} engines: {node: '>=12.20'} - zod-to-json-schema@3.23.5: - resolution: {integrity: sha512-5wlSS0bXfF/BrL4jPAbz9da5hDlDptdEppYfe+x4eIJ7jioqKG9uUxOwPzqof09u/XeVdrgFu29lZi+8XNDJtA==} + zod-to-json-schema@3.24.1: + resolution: {integrity: sha512-3h08nf3Vw3Wl3PK+q3ow/lIil81IT2Oa7YpQyUUDsEWbXveMesdfK1xBd2RhCkynwZndAxixji/7SYJJowr62w==} peerDependencies: - zod: ^3.23.3 + zod: ^3.24.1 zod-to-ts@1.2.0: resolution: {integrity: sha512-x30XE43V+InwGpvTySRNz9kB7qFU8DlyEy7BsSTCHPH1R0QasMmHWZDCzYm6bVXtj/9NNJAZF3jW8rzFvH5OFA==} @@ -2395,7 +2398,7 @@ snapshots: '@ampproject/remapping@2.3.0': dependencies: - '@jridgewell/gen-mapping': 0.3.5 + '@jridgewell/gen-mapping': 0.3.8 '@jridgewell/trace-mapping': 0.3.25 '@astrojs/check@0.9.4(typescript@5.7.2)': @@ -2509,12 +2512,13 @@ snapshots: stream-replace-string: 2.0.0 zod: 3.24.1 - '@astrojs/starlight@0.29.2(astro@4.16.17(rollup@4.28.1)(sass@1.82.0)(terser@5.36.0)(typescript@5.7.2))': + '@astrojs/starlight@0.29.3(astro@4.16.17(rollup@4.28.1)(sass@1.82.0)(terser@5.36.0)(typescript@5.7.2))': dependencies: '@astrojs/mdx': 3.1.9(astro@4.16.17(rollup@4.28.1)(sass@1.82.0)(terser@5.36.0)(typescript@5.7.2)) '@astrojs/sitemap': 3.2.1 '@pagefind/default-ui': 1.2.0 '@types/hast': 3.0.4 + '@types/js-yaml': 4.0.9 '@types/mdast': 4.0.4 astro: 4.16.17(rollup@4.28.1)(sass@1.82.0)(terser@5.36.0)(typescript@5.7.2) astro-expressive-code: 0.38.3(astro@4.16.17(rollup@4.28.1)(sass@1.82.0)(terser@5.36.0)(typescript@5.7.2)) @@ -2586,7 +2590,7 @@ snapshots: dependencies: '@babel/parser': 7.26.3 '@babel/types': 7.26.3 - '@jridgewell/gen-mapping': 0.3.5 + '@jridgewell/gen-mapping': 0.3.8 '@jridgewell/trace-mapping': 0.3.25 jsesc: 3.1.0 @@ -2887,7 +2891,7 @@ snapshots: '@img/sharp-win32-x64@0.33.5': optional: true - '@jridgewell/gen-mapping@0.3.5': + '@jridgewell/gen-mapping@0.3.8': dependencies: '@jridgewell/set-array': 1.2.1 '@jridgewell/sourcemap-codec': 1.5.0 @@ -2899,7 +2903,7 @@ snapshots: '@jridgewell/source-map@0.3.6': dependencies: - '@jridgewell/gen-mapping': 0.3.5 + '@jridgewell/gen-mapping': 0.3.8 '@jridgewell/trace-mapping': 0.3.25 optional: true @@ -3170,6 +3174,8 @@ snapshots: dependencies: '@types/unist': 3.0.3 + '@types/js-yaml@4.0.9': {} + '@types/mdast@4.0.4': dependencies: '@types/unist': 3.0.3 @@ -3374,7 +3380,7 @@ snapshots: xxhash-wasm: 1.1.0 yargs-parser: 21.1.1 zod: 3.24.1 - zod-to-json-schema: 3.23.5(zod@3.24.1) + zod-to-json-schema: 3.24.1(zod@3.24.1) zod-to-ts: 1.2.0(typescript@5.7.2)(zod@3.24.1) optionalDependencies: sharp: 0.33.5 @@ -5329,7 +5335,7 @@ snapshots: yocto-queue@1.1.1: {} - zod-to-json-schema@3.23.5(zod@3.24.1): + zod-to-json-schema@3.24.1(zod@3.24.1): dependencies: zod: 3.24.1 diff --git a/metadata/en-US/changelogs/124.txt b/metadata/en-US/changelogs/124.txt index 01f61cf08916..da91336b945e 100644 --- a/metadata/en-US/changelogs/124.txt +++ b/metadata/en-US/changelogs/124.txt @@ -12,5 +12,6 @@ * Fix ruler not working correctly in pen tool * Fix ruler position is wrong when moving on the canvas * Fix zoom dependent not working correctly with the label tool ([#765](https://github.com/LinwoodDev/Butterfly/issues/765)) +* Upgrade to flutter 3.27 Read more here: https://linwood.dev/butterfly/2.2.3-rc.1 \ No newline at end of file diff --git a/tools/pubspec.lock b/tools/pubspec.lock index db6140c9b6a1..e6d50c3f0a91 100644 --- a/tools/pubspec.lock +++ b/tools/pubspec.lock @@ -61,10 +61,10 @@ packages: dependency: "direct main" description: name: lints - sha256: "3315600f3fb3b135be672bf4a178c55f274bebe368325ae18462c89ac1e3b413" + sha256: "4a16b3f03741e1252fda5de3ce712666d010ba2122f8e912c94f9f7b90e1a4c3" url: "https://pub.dev" source: hosted - version: "5.0.0" + version: "5.1.0" meta: dependency: transitive description: @@ -130,4 +130,4 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.5.0 <4.0.0" + dart: ">=3.6.0-0 <4.0.0"