diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4329750..fb4a355 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,12 +16,12 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: subosito/flutter-action@v1 + - uses: subosito/flutter-action@v2 with: channel: 'stable' - run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev - - run: flutter config --enable-linux-desktop - - run: flutter build linux + - run: cd packages/combustile_editor && flutter build linux + - run: flutter build linux - name: Zips the build uses: papeloto/action-zip@v1 with: @@ -66,7 +66,7 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: subosito/flutter-action@v1 + - uses: subosito/flutter-action@v2 with: channel: 'stable' - run: flutter config --enable-windows-desktop @@ -118,7 +118,7 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: subosito/flutter-action@v1 + - uses: subosito/flutter-action@v2 - uses: erickzanardo/flutter-gh-pages@v3 with: workingDir: fire_atlas_editor diff --git a/fire_atlas_editor/lib/main_app.dart b/fire_atlas_editor/lib/main_app.dart index fec550b..2eb7785 100644 --- a/fire_atlas_editor/lib/main_app.dart +++ b/fire_atlas_editor/lib/main_app.dart @@ -20,16 +20,16 @@ class FireAtlasApp extends StatelessWidget { final SlicesStore store; const FireAtlasApp({ - Key? key, required this.store, - }) : super(key: key); + super.key, + }); @override Widget build(BuildContext context) { return SlicesProvider( store: store, child: SliceWatcher( - slicer: (state) => _FireAtlasAppSlice.fromState(state), + slicer: _FireAtlasAppSlice.fromState, builder: (context, store, slice) { return MaterialApp( title: 'Fire Atlas Editor', diff --git a/fire_atlas_editor/lib/screens/editor_screen/editor_screen.dart b/fire_atlas_editor/lib/screens/editor_screen/editor_screen.dart index cb023ea..0e83749 100644 --- a/fire_atlas_editor/lib/screens/editor_screen/editor_screen.dart +++ b/fire_atlas_editor/lib/screens/editor_screen/editor_screen.dart @@ -9,12 +9,12 @@ import 'package:flutter/material.dart'; import 'package:slices/slices.dart'; class EditorScreen extends StatelessWidget { - const EditorScreen({Key? key}) : super(key: key); + const EditorScreen({super.key}); @override Widget build(BuildContext ctx) { - final _store = SlicesProvider.of(ctx); - if (_store.state.currentAtlas == null) { + final store = SlicesProvider.of(ctx); + if (store.state.currentAtlas == null) { return Scaffold( body: Center( child: Column( @@ -36,10 +36,10 @@ class EditorScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.stretch, children: [ // Body - Expanded( + const Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, - children: const [ + children: [ Toolbar(), Expanded( child: SelectionCanvas(), @@ -49,8 +49,8 @@ class EditorScreen extends StatelessWidget { ), Container( width: 400, - child: Column( - children: const [ + child: const Column( + children: [ Expanded( flex: 4, child: Preview(), diff --git a/fire_atlas_editor/lib/screens/editor_screen/widgets/automap_font_modal.dart b/fire_atlas_editor/lib/screens/editor_screen/widgets/automap_font_modal.dart index a2f33d4..4fb08a5 100644 --- a/fire_atlas_editor/lib/screens/editor_screen/widgets/automap_font_modal.dart +++ b/fire_atlas_editor/lib/screens/editor_screen/widgets/automap_font_modal.dart @@ -16,9 +16,9 @@ class AutoMapFontModal extends StatefulWidget { final Sprite currentSprite; const AutoMapFontModal({ - Key? key, required this.currentSprite, - }) : super(key: key); + super.key, + }); @override State createState() { @@ -44,9 +44,9 @@ class _AutoMapFontModalState extends State { void didChangeDependencies() { super.didChangeDependencies(); - final _store = SlicesProvider.of(context); + final store = SlicesProvider.of(context); - final atlas = _store.state.currentAtlas; + final atlas = store.state.currentAtlas; if (atlas == null) { throw "Can't map a bitmap font without a atlas selected"; @@ -56,7 +56,7 @@ class _AutoMapFontModalState extends State { } void _calculateSelections() { - final _selections = []; + final selections = []; var x = 0; var y = 0; @@ -79,17 +79,17 @@ class _AutoMapFontModalState extends State { x++; - _selections.add(selection); + selections.add(selection); }); setState(() { - _currentSelections = _selections; + _currentSelections = selections; }); } @override Widget build(BuildContext context) { - final _store = SlicesProvider.of(context); + final store = SlicesProvider.of(context); return Container( padding: const EdgeInsets.symmetric(horizontal: 10), child: Column( @@ -138,7 +138,7 @@ class _AutoMapFontModalState extends State { FButton( label: 'Cancel', onSelect: () { - _store.dispatch(CloseEditorModal()); + store.dispatch(CloseEditorModal()); }, ), const SizedBox(width: 20), @@ -146,12 +146,12 @@ class _AutoMapFontModalState extends State { label: 'Confirm', selected: true, onSelect: () { - _store.dispatch( + store.dispatch( SetSelectionAction.multiple( selections: _currentSelections, ), ); - _store.dispatch(CloseEditorModal()); + store.dispatch(CloseEditorModal()); }, ), ], diff --git a/fire_atlas_editor/lib/screens/editor_screen/widgets/change_image_modal.dart b/fire_atlas_editor/lib/screens/editor_screen/widgets/change_image_modal.dart index 47d0ae3..21239e5 100644 --- a/fire_atlas_editor/lib/screens/editor_screen/widgets/change_image_modal.dart +++ b/fire_atlas_editor/lib/screens/editor_screen/widgets/change_image_modal.dart @@ -9,7 +9,7 @@ import 'package:flutter/material.dart'; import 'package:slices/slices.dart'; class ChangeImageModal extends StatefulWidget { - const ChangeImageModal({Key? key}) : super(key: key); + const ChangeImageModal({super.key}); @override State createState() => _ChangeImageModalState(); @@ -20,51 +20,49 @@ class _ChangeImageModalState extends State { @override Widget build(BuildContext ctx) { - final _store = SlicesProvider.of(ctx); - return Container( - child: Column( - children: [ - const FSubtitleTitle(title: 'Update image'), - Expanded( - child: ImageSelectionContainer( - margin: const EdgeInsets.all(30), - imageData: _imageData, - onSelectImage: (imageData) { - Flame.images.clearCache(); - setState(() { - _imageData = imageData; - }); + final store = SlicesProvider.of(ctx); + return Column( + children: [ + const FSubtitleTitle(title: 'Update image'), + Expanded( + child: ImageSelectionContainer( + margin: const EdgeInsets.all(30), + imageData: _imageData, + onSelectImage: (imageData) { + Flame.images.clearCache(); + setState(() { + _imageData = imageData; + }); + }, + ), + ), + const SizedBox(height: 20), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + FButton( + label: 'Cancel', + onSelect: () { + store.dispatch(CloseEditorModal()); }, ), - ), - const SizedBox(height: 20), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - FButton( - label: 'Cancel', - onSelect: () { - _store.dispatch(CloseEditorModal()); - }, - ), - FButton( - disabled: _imageData == null, - selected: true, - label: 'Ok', - onSelect: () { - _store.dispatch(CloseEditorModal()); - _store.dispatchAsync( - UpdateAtlasImageAction( - imageData: _imageData!, - ), - ); - }, - ), - ], - ), - const SizedBox(height: 20), - ], - ), + FButton( + disabled: _imageData == null, + selected: true, + label: 'Ok', + onSelect: () { + store.dispatch(CloseEditorModal()); + store.dispatchAsync( + UpdateAtlasImageAction( + imageData: _imageData!, + ), + ); + }, + ), + ], + ), + const SizedBox(height: 20), + ], ); } } diff --git a/fire_atlas_editor/lib/screens/editor_screen/widgets/concat_image_modal.dart b/fire_atlas_editor/lib/screens/editor_screen/widgets/concat_image_modal.dart index c5a6997..fb0c727 100644 --- a/fire_atlas_editor/lib/screens/editor_screen/widgets/concat_image_modal.dart +++ b/fire_atlas_editor/lib/screens/editor_screen/widgets/concat_image_modal.dart @@ -10,7 +10,7 @@ import 'package:flutter/material.dart'; import 'package:slices/slices.dart'; class ConcatImageModal extends StatefulWidget { - const ConcatImageModal({Key? key}) : super(key: key); + const ConcatImageModal({super.key}); @override State createState() => _ConcatImageModalState(); @@ -23,140 +23,138 @@ class _ConcatImageModalState extends State { @override Widget build(BuildContext ctx) { - final _store = SlicesProvider.of(ctx); - return Container( - child: Column( - children: [ - const FSubtitleTitle(title: 'Add image'), - Expanded( - child: Row( - children: [ - Expanded( - flex: 5, - child: ImageSelectionContainer( - margin: const EdgeInsets.only( - top: 30, - bottom: 10, - left: 10, - right: 10, - ), - imageData: _imageData, - onSelectImage: (imageData) { - setState(() { - _imageData = imageData; - }); - }, - ), - ), - Expanded( - flex: 5, - child: Column( - children: [ - const FSubtitleTitle(title: 'Position'), - FButton( - width: 100, - padding: const EdgeInsets.only(bottom: 10), - label: 'Top', - selected: _placement?.y == -1, - onSelect: () { - setState(() { - _placement = Vector2(0, -1); - _selection = null; - }); - }, - ), - FButton( - width: 100, - padding: const EdgeInsets.only(bottom: 10), - label: 'Bottom', - selected: _placement?.y == 1, - onSelect: () { - setState(() { - _placement = Vector2(0, 1); - _selection = null; - }); - }, - ), - FButton( - width: 100, - padding: const EdgeInsets.only(bottom: 10), - label: 'Left', - selected: _placement?.x == -1, - onSelect: () { - setState(() { - _placement = Vector2(-1, 0); - _selection = null; - }); - }, - ), - FButton( - width: 100, - padding: const EdgeInsets.only(bottom: 10), - label: 'Right', - selected: _placement?.x == 1, - onSelect: () { - setState(() { - _placement = Vector2(1, 0); - _selection = null; - }); - }, - ), - FButton( - width: 100, - padding: const EdgeInsets.only(bottom: 10), - label: 'Selection', - disabled: _store.state.canvasSelection == null, - selected: _selection != null, - onSelect: () { - setState(() { - _placement = null; - _selection = _store.state.canvasSelection; - }); - }, - ), - ], + final store = SlicesProvider.of(ctx); + return Column( + children: [ + const FSubtitleTitle(title: 'Add image'), + Expanded( + child: Row( + children: [ + Expanded( + flex: 5, + child: ImageSelectionContainer( + margin: const EdgeInsets.only( + top: 30, + bottom: 10, + left: 10, + right: 10, ), + imageData: _imageData, + onSelectImage: (imageData) { + setState(() { + _imageData = imageData; + }); + }, ), - ], - ), - ), - const SizedBox(height: 20), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - FButton( - label: 'Cancel', - onSelect: () { - _store.dispatch(CloseEditorModal()); - }, ), - const SizedBox(width: 5), - FButton( - disabled: _imageData == null || - (_placement == null && _selection == null), - selected: true, - label: 'Ok', - onSelect: () async { - final currentAtlas = _store.state.currentAtlas!; - final _newImageData = await concatenateImages( - currentAtlas.imageData!, - _imageData!, - _placement, - _selection, - ); - _store.dispatch(CloseEditorModal()); - await _store.dispatchAsync( - UpdateAtlasImageAction( - imageData: _newImageData, + Expanded( + flex: 5, + child: Column( + children: [ + const FSubtitleTitle(title: 'Position'), + FButton( + width: 100, + padding: const EdgeInsets.only(bottom: 10), + label: 'Top', + selected: _placement?.y == -1, + onSelect: () { + setState(() { + _placement = Vector2(0, -1); + _selection = null; + }); + }, + ), + FButton( + width: 100, + padding: const EdgeInsets.only(bottom: 10), + label: 'Bottom', + selected: _placement?.y == 1, + onSelect: () { + setState(() { + _placement = Vector2(0, 1); + _selection = null; + }); + }, ), - ); - }, + FButton( + width: 100, + padding: const EdgeInsets.only(bottom: 10), + label: 'Left', + selected: _placement?.x == -1, + onSelect: () { + setState(() { + _placement = Vector2(-1, 0); + _selection = null; + }); + }, + ), + FButton( + width: 100, + padding: const EdgeInsets.only(bottom: 10), + label: 'Right', + selected: _placement?.x == 1, + onSelect: () { + setState(() { + _placement = Vector2(1, 0); + _selection = null; + }); + }, + ), + FButton( + width: 100, + padding: const EdgeInsets.only(bottom: 10), + label: 'Selection', + disabled: store.state.canvasSelection == null, + selected: _selection != null, + onSelect: () { + setState(() { + _placement = null; + _selection = store.state.canvasSelection; + }); + }, + ), + ], + ), ), ], ), - const SizedBox(height: 20), - ], - ), + ), + const SizedBox(height: 20), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + FButton( + label: 'Cancel', + onSelect: () { + store.dispatch(CloseEditorModal()); + }, + ), + const SizedBox(width: 5), + FButton( + disabled: _imageData == null || + (_placement == null && _selection == null), + selected: true, + label: 'Ok', + onSelect: () async { + final currentAtlas = store.state.currentAtlas!; + final newImageData = await concatenateImages( + currentAtlas.imageData!, + _imageData!, + _placement, + _selection, + ); + store.dispatch(CloseEditorModal()); + await store.dispatchAsync( + UpdateAtlasImageAction( + imageData: newImageData, + ), + ); + }, + ), + ], + ), + const SizedBox(height: 20), + ], ); } } diff --git a/fire_atlas_editor/lib/screens/editor_screen/widgets/delete_selection_modal.dart b/fire_atlas_editor/lib/screens/editor_screen/widgets/delete_selection_modal.dart index 9cff619..f07cb7b 100644 --- a/fire_atlas_editor/lib/screens/editor_screen/widgets/delete_selection_modal.dart +++ b/fire_atlas_editor/lib/screens/editor_screen/widgets/delete_selection_modal.dart @@ -7,16 +7,16 @@ import 'package:flutter/material.dart'; import 'package:slices/slices.dart'; class DeleteSelectionModal extends StatelessWidget { - const DeleteSelectionModal({Key? key}) : super(key: key); + const DeleteSelectionModal({super.key}); @override Widget build(BuildContext ctx) { final store = SlicesProvider.of(ctx); - void _closeModal() => store.dispatch(CloseEditorModal()); + void closeModal() => store.dispatch(CloseEditorModal()); - void _confirm() { + void confirm() { store.dispatch(RemoveSelectedSelectionAction()); - _closeModal(); + closeModal(); } return Container( @@ -32,12 +32,12 @@ class DeleteSelectionModal extends StatelessWidget { children: [ FButton( label: 'Cancel', - onSelect: _closeModal, + onSelect: closeModal, ), FButton( selected: true, label: 'Yes', - onSelect: _confirm, + onSelect: confirm, ), ], ), diff --git a/fire_atlas_editor/lib/screens/editor_screen/widgets/preview.dart b/fire_atlas_editor/lib/screens/editor_screen/widgets/preview.dart index 1646ad0..210f433 100644 --- a/fire_atlas_editor/lib/screens/editor_screen/widgets/preview.dart +++ b/fire_atlas_editor/lib/screens/editor_screen/widgets/preview.dart @@ -32,12 +32,12 @@ class _PreviewSlice extends Equatable { } class Preview extends StatelessWidget { - const Preview({Key? key}) : super(key: key); + const Preview({super.key}); @override Widget build(_) { return SliceWatcher( - slicer: (state) => _PreviewSlice.fromState(state), + slicer: _PreviewSlice.fromState, builder: (ctx, store, slice) { Widget child = const Center(child: Text('Nothing selected')); final currentAtlas = slice.currentAtlas!; diff --git a/fire_atlas_editor/lib/screens/editor_screen/widgets/rename_atlas_modal.dart b/fire_atlas_editor/lib/screens/editor_screen/widgets/rename_atlas_modal.dart index 79d1b49..aeaa1b1 100644 --- a/fire_atlas_editor/lib/screens/editor_screen/widgets/rename_atlas_modal.dart +++ b/fire_atlas_editor/lib/screens/editor_screen/widgets/rename_atlas_modal.dart @@ -10,8 +10,7 @@ import 'package:slices/slices.dart'; class RenameAtlasModal extends StatefulWidget { final String? currentName; - const RenameAtlasModal({Key? key, required this.currentName}) - : super(key: key); + const RenameAtlasModal({required this.currentName, super.key}); @override State createState() => _RenameAtlasModalState(); diff --git a/fire_atlas_editor/lib/screens/editor_screen/widgets/selection_canvas/canvas_board.dart b/fire_atlas_editor/lib/screens/editor_screen/widgets/selection_canvas/canvas_board.dart index bb9959a..ef0d6db 100644 --- a/fire_atlas_editor/lib/screens/editor_screen/widgets/selection_canvas/canvas_board.dart +++ b/fire_atlas_editor/lib/screens/editor_screen/widgets/selection_canvas/canvas_board.dart @@ -21,12 +21,12 @@ class CanvasBoard extends StatefulWidget { final double tileHeight; const CanvasBoard({ - Key? key, required this.sprite, required this.size, required this.tileWidth, required this.tileHeight, - }) : super(key: key); + super.key, + }); @override State createState() => CanvasBoardState(); @@ -59,16 +59,16 @@ class CanvasBoardState extends State { } void _finishSelection(Offset offset) { - final _store = SlicesProvider.of(context); + final store = SlicesProvider.of(context); if (_selectionEnd != offset && _selectionStart != null) { - final _start = _selectionStart!; + final start = _selectionStart!; final rect = Rect.fromLTWH( - _start.dx * widget.tileWidth, - _start.dy * widget.tileHeight, - ((offset.dx - _start.dx) + 1) * widget.tileWidth, - ((offset.dy - _start.dy) + 1) * widget.tileHeight, + start.dx * widget.tileWidth, + start.dy * widget.tileHeight, + ((offset.dx - start.dx) + 1) * widget.tileWidth, + ((offset.dy - start.dy) + 1) * widget.tileHeight, ); - _store.dispatch(SetCanvasSelection(rect)); + store.dispatch(SetCanvasSelection(rect)); } _selectionEnd = offset; } @@ -82,10 +82,10 @@ class CanvasBoardState extends State { } void _handleMove(DragUpdateDetails details) { - final _last = _lastDrag; - if (_last != null) { + final last = _lastDrag; + if (last != null) { setState(() { - final delta = details.localPosition - _last; + final delta = details.localPosition - last; if (_currentTool == CanvasTools.MOVE) { _translateX += delta.dx; @@ -136,9 +136,9 @@ class CanvasBoardState extends State { } void _createItem() { - final _store = SlicesProvider.of(context); + final store = SlicesProvider.of(context); if (_selectionStart != null && _selectionEnd != null) { - _store.dispatch( + store.dispatch( OpenEditorModal( SelectionForm( selectionStart: _selectionStart, @@ -149,7 +149,7 @@ class CanvasBoardState extends State { ), ); } else { - _store.dispatch( + store.dispatch( CreateMessageAction( type: MessageType.ERROR, message: 'Nothing is selected', @@ -159,8 +159,8 @@ class CanvasBoardState extends State { } void _autoMapFont() { - final _store = SlicesProvider.of(context); - _store.dispatch( + final store = SlicesProvider.of(context); + store.dispatch( OpenEditorModal( AutoMapFontModal(currentSprite: widget.sprite), 800, diff --git a/fire_atlas_editor/lib/screens/editor_screen/widgets/selection_canvas/canvas_sprite.dart b/fire_atlas_editor/lib/screens/editor_screen/widgets/selection_canvas/canvas_sprite.dart index da44f04..f845a28 100644 --- a/fire_atlas_editor/lib/screens/editor_screen/widgets/selection_canvas/canvas_sprite.dart +++ b/fire_atlas_editor/lib/screens/editor_screen/widgets/selection_canvas/canvas_sprite.dart @@ -13,34 +13,32 @@ class CanvasSprite extends StatelessWidget { final Offset? selectionEnd; const CanvasSprite({ - Key? key, required this.sprite, required this.translateX, required this.translateY, required this.scale, required this.tileWidth, required this.tileHeight, + super.key, this.selectionStart, this.selectionEnd, - }) : super(key: key); + }); @override Widget build(BuildContext ctx) { - return Container( - child: CustomPaint( - painter: _CanvasSpritePainter( - sprite, - translateX, - translateY, - scale, - tileWidth, - tileHeight, - selectionStart, - selectionEnd, - Theme.of(ctx).primaryColor, - Theme.of(ctx).dividerColor, - Theme.of(ctx).brightness == Brightness.dark, - ), + return CustomPaint( + painter: _CanvasSpritePainter( + sprite, + translateX, + translateY, + scale, + tileWidth, + tileHeight, + selectionStart, + selectionEnd, + Theme.of(ctx).primaryColor, + Theme.of(ctx).dividerColor, + Theme.of(ctx).brightness == Brightness.dark, ), ); } @@ -71,6 +69,7 @@ class _CanvasSpritePainter extends CustomPainter { this._selectionEnd, this._selectionColor, this._gridTileColor, + // ignore: avoid_positional_boolean_parameters this._darkMode, ); @@ -148,14 +147,14 @@ class _CanvasSpritePainter extends CustomPainter { _sprite.render(canvas); // Selection - final _start = _selectionStart; - final _end = _selectionEnd; - if (_start != null && _end != null) { - final size = _end - _start + const Offset(1, 1); + final start = _selectionStart; + final end = _selectionEnd; + if (start != null && end != null) { + final size = end - start + const Offset(1, 1); canvas.drawRect( Rect.fromLTWH( - _start.dx * _tileWidth, - _start.dy * _tileHeight, + start.dx * _tileWidth, + start.dy * _tileHeight, size.dx * _tileWidth, size.dy * _tileHeight, ), diff --git a/fire_atlas_editor/lib/screens/editor_screen/widgets/selection_canvas/selection_canvas.dart b/fire_atlas_editor/lib/screens/editor_screen/widgets/selection_canvas/selection_canvas.dart index d0f6574..51de7fb 100644 --- a/fire_atlas_editor/lib/screens/editor_screen/widgets/selection_canvas/selection_canvas.dart +++ b/fire_atlas_editor/lib/screens/editor_screen/widgets/selection_canvas/selection_canvas.dart @@ -28,12 +28,12 @@ class _SelectionCanvasSlice extends Equatable { } class SelectionCanvas extends StatelessWidget { - const SelectionCanvas({Key? key}) : super(key: key); + const SelectionCanvas({super.key}); @override Widget build(BuildContext context) { return SliceWatcher( - slicer: (state) => _SelectionCanvasSlice.fromState(state), + slicer: _SelectionCanvasSlice.fromState, builder: (context, store, slice) { if (!slice.isLoaded()) { return const Text('No atlas selected'); diff --git a/fire_atlas_editor/lib/screens/editor_screen/widgets/selection_canvas/selection_form.dart b/fire_atlas_editor/lib/screens/editor_screen/widgets/selection_canvas/selection_form.dart index 21a6eae..ef55009 100644 --- a/fire_atlas_editor/lib/screens/editor_screen/widgets/selection_canvas/selection_form.dart +++ b/fire_atlas_editor/lib/screens/editor_screen/widgets/selection_canvas/selection_form.dart @@ -16,11 +16,11 @@ class SelectionForm extends StatefulWidget { final AnimationSelection? editingSelection; const SelectionForm({ - Key? key, + super.key, this.selectionStart, this.selectionEnd, this.editingSelection, - }) : super(key: key); + }); @override State createState() => _SelectionFormState(); @@ -53,9 +53,9 @@ class _SelectionFormState extends State { } } - void _chooseSelectionType(SelectionType _type) { + void _chooseSelectionType(SelectionType type) { setState(() { - _selectionType = _type; + _selectionType = type; }); } @@ -85,18 +85,18 @@ class _SelectionFormState extends State { } void _createSprite() { - final _store = SlicesProvider.of(context); + final store = SlicesProvider.of(context); if (selectionNameController.text.isNotEmpty) { final info = _fillSelectionBaseValues(); - _store.dispatch( + store.dispatch( SetSelectionAction( selection: SpriteSelection(info: info), ), ); - _store.dispatch(CloseEditorModal()); + store.dispatch(CloseEditorModal()); } else { - _store.dispatch( + store.dispatch( CreateMessageAction( type: MessageType.ERROR, message: 'You must inform the selection name', @@ -106,12 +106,12 @@ class _SelectionFormState extends State { } void _createAnimation() { - final _store = SlicesProvider.of(context); + final store = SlicesProvider.of(context); if (selectionNameController.text.isNotEmpty && frameCountController.text.isNotEmpty && stepTimeController.text.isNotEmpty) { if (!isValidNumber(frameCountController.text)) { - _store.dispatch( + store.dispatch( CreateMessageAction( type: MessageType.ERROR, message: 'Frame count is not a valid number', @@ -122,7 +122,7 @@ class _SelectionFormState extends State { } if (!isValidNumber(stepTimeController.text)) { - _store.dispatch( + store.dispatch( CreateMessageAction( type: MessageType.ERROR, message: 'Step time is not a valid number', @@ -146,13 +146,13 @@ class _SelectionFormState extends State { ..stepTime = stepTime ..loop = _animationLoop; - _store.dispatch( + store.dispatch( SetSelectionAction(selection: selectionToSave), ); - _store.dispatch(CloseEditorModal()); + store.dispatch(CloseEditorModal()); } else { - _store.dispatch( + store.dispatch( CreateMessageAction( type: MessageType.ERROR, message: 'All fields are required', diff --git a/fire_atlas_editor/lib/screens/editor_screen/widgets/selection_list.dart b/fire_atlas_editor/lib/screens/editor_screen/widgets/selection_list.dart index daccb01..3cd36e7 100644 --- a/fire_atlas_editor/lib/screens/editor_screen/widgets/selection_list.dart +++ b/fire_atlas_editor/lib/screens/editor_screen/widgets/selection_list.dart @@ -22,7 +22,7 @@ class _SelectionListSlice extends Equatable { } class SelectionList extends StatelessWidget { - const SelectionList({Key? key}) : super(key: key); + const SelectionList({super.key}); @override Widget build(_) { @@ -38,7 +38,7 @@ class SelectionList extends StatelessWidget { return const Text('No atlas selected'); } - void _select(BaseSelection selection) => + void select(BaseSelection selection) => store.dispatch(SelectSelectionAction(selection: selection)); return FContainer( @@ -64,7 +64,7 @@ class SelectionList extends StatelessWidget { ), ), child: GestureDetector( - onTap: () => _select(selection), + onTap: () => select(selection), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -87,7 +87,7 @@ class SelectionList extends StatelessWidget { FIconButton( iconData: Icons.edit, onPress: () { - _select(selection); + select(selection); store.dispatch( OpenEditorModal( SelectionForm( @@ -105,7 +105,7 @@ class SelectionList extends StatelessWidget { FIconButton( iconData: Icons.cancel, onPress: () { - _select(selection); + select(selection); store.dispatch( OpenEditorModal( const DeleteSelectionModal(), diff --git a/fire_atlas_editor/lib/screens/editor_screen/widgets/toolbar.dart b/fire_atlas_editor/lib/screens/editor_screen/widgets/toolbar.dart index 246cfca..753418e 100644 --- a/fire_atlas_editor/lib/screens/editor_screen/widgets/toolbar.dart +++ b/fire_atlas_editor/lib/screens/editor_screen/widgets/toolbar.dart @@ -28,7 +28,7 @@ class _ToolbarSlice extends Equatable { } class Toolbar extends StatelessWidget { - const Toolbar({Key? key}) : super(key: key); + const Toolbar({super.key}); Future _launchURL(FireAtlas atlas) async { final bytes = atlas.serialize(); @@ -41,7 +41,7 @@ class Toolbar extends StatelessWidget { @override Widget build(BuildContext ctx) { return SliceWatcher( - slicer: (state) => _ToolbarSlice.fromState(state), + slicer: _ToolbarSlice.fromState, builder: (ctx, store, slice) => FContainer( height: 60, child: Column( diff --git a/fire_atlas_editor/lib/screens/open_screen/open_screen.dart b/fire_atlas_editor/lib/screens/open_screen/open_screen.dart index feecf0b..4bfce54 100644 --- a/fire_atlas_editor/lib/screens/open_screen/open_screen.dart +++ b/fire_atlas_editor/lib/screens/open_screen/open_screen.dart @@ -17,7 +17,7 @@ import 'package:flutter/material.dart'; import 'package:slices/slices.dart'; class OpenScreen extends StatefulWidget { - const OpenScreen({Key? key}) : super(key: key); + const OpenScreen({super.key}); @override State createState() => _OpenScreenState(); @@ -43,7 +43,7 @@ class _OpenScreenState extends State { } Future _importAtlas() async { - final _store = SlicesProvider.of(context); + final store = SlicesProvider.of(context); try { final loaded = await _storage.selectProject(); @@ -52,11 +52,11 @@ class _OpenScreenState extends State { _projects.add(loaded.toLastProjectEntry()); }); - await _store.dispatchAsync(LoadAtlasAction(loaded.path!)); + await store.dispatchAsync(LoadAtlasAction(loaded.path!)); Navigator.of(context).pushNamed('/editor'); } catch (e) { debugPrint(e.toString()); - _store.dispatch( + store.dispatch( CreateMessageAction( message: 'Error importing atlas', type: MessageType.ERROR, @@ -66,8 +66,8 @@ class _OpenScreenState extends State { } void _newAtlas() { - final _store = SlicesProvider.of(context); - _store.dispatch( + final store = SlicesProvider.of(context); + store.dispatch( OpenEditorModal( AtlasOptionsContainer( onConfirm: ( @@ -76,9 +76,9 @@ class _OpenScreenState extends State { double tileWidth, double tileHeight, ) async { - _store.dispatch(CloseEditorModal()); + store.dispatch(CloseEditorModal()); - await _store.dispatchAsync( + await store.dispatchAsync( CreateAtlasAction( id: atlasName, imageData: imageData, @@ -89,7 +89,7 @@ class _OpenScreenState extends State { Navigator.of(context).pushNamed('/editor'); }, onCancel: () { - _store.dispatch(CloseEditorModal()); + store.dispatch(CloseEditorModal()); }, ), 600, @@ -100,7 +100,7 @@ class _OpenScreenState extends State { @override Widget build(_) { - final _store = SlicesProvider.of(context); + final store = SlicesProvider.of(context); final children = []; final containerChildren = []; @@ -124,7 +124,7 @@ class _OpenScreenState extends State { FIconButton( iconData: Icons.folder_open, onPress: () async { - await _store.dispatchAsync(LoadAtlasAction(p.path)); + await store.dispatchAsync(LoadAtlasAction(p.path)); Navigator.of(context).pushNamed('/editor'); }, ), @@ -201,7 +201,7 @@ class _OpenScreenState extends State { child: FButton( label: 'Support this project', onSelect: () { - _store.dispatch( + store.dispatch( OpenEditorModal( const SupportContainer(), 500, diff --git a/fire_atlas_editor/lib/screens/open_screen/widgets/atlas_options_container.dart b/fire_atlas_editor/lib/screens/open_screen/widgets/atlas_options_container.dart index 8a6c999..5005bd0 100644 --- a/fire_atlas_editor/lib/screens/open_screen/widgets/atlas_options_container.dart +++ b/fire_atlas_editor/lib/screens/open_screen/widgets/atlas_options_container.dart @@ -14,10 +14,10 @@ class AtlasOptionsContainer extends StatefulWidget { final Function(String, String, double, double) onConfirm; const AtlasOptionsContainer({ - Key? key, required this.onCancel, required this.onConfirm, - }) : super(key: key); + super.key, + }); @override State createState() => _AtlasOptionsContainerState(); @@ -47,13 +47,13 @@ class _AtlasOptionsContainerState extends State { } void _confirm() { - final _store = SlicesProvider.of(context); + final store = SlicesProvider.of(context); final tileWidthRaw = tileWidthController.text; final tileHeightRaw = tileHeightController.text; final atlasName = atlasNameController.text; if (atlasName.isEmpty) { - _store.dispatch( + store.dispatch( CreateMessageAction( message: 'Atlas name is required', type: MessageType.ERROR, @@ -62,7 +62,7 @@ class _AtlasOptionsContainerState extends State { return; } if (tileWidthRaw.isEmpty) { - _store.dispatch( + store.dispatch( CreateMessageAction( message: 'Tile Width is required', type: MessageType.ERROR, @@ -72,7 +72,7 @@ class _AtlasOptionsContainerState extends State { } if (tileHeightRaw.isEmpty) { - _store.dispatch( + store.dispatch( CreateMessageAction( message: 'Tile Height is required', type: MessageType.ERROR, @@ -82,7 +82,7 @@ class _AtlasOptionsContainerState extends State { } if (tileWidthRaw.isNotEmpty && !isValidNumber(tileWidthRaw)) { - _store.dispatch( + store.dispatch( CreateMessageAction( message: 'Tile Width must be a number', type: MessageType.ERROR, @@ -92,7 +92,7 @@ class _AtlasOptionsContainerState extends State { } if (tileHeightRaw.isNotEmpty && !isValidNumber(tileHeightRaw)) { - _store.dispatch( + store.dispatch( CreateMessageAction( message: 'Tile Height must be a number', type: MessageType.ERROR, @@ -102,7 +102,7 @@ class _AtlasOptionsContainerState extends State { } if (_imageData == null) { - _store.dispatch( + store.dispatch( CreateMessageAction( message: 'An image must be selected', type: MessageType.ERROR, diff --git a/fire_atlas_editor/lib/screens/open_screen/widgets/support_container.dart b/fire_atlas_editor/lib/screens/open_screen/widgets/support_container.dart index 15b08f4..828768e 100644 --- a/fire_atlas_editor/lib/screens/open_screen/widgets/support_container.dart +++ b/fire_atlas_editor/lib/screens/open_screen/widgets/support_container.dart @@ -3,10 +3,9 @@ import 'package:flutter/material.dart'; import 'package:url_launcher/url_launcher.dart'; final _patreonUrl = Uri.parse('https://www.patreon.com/bluefireoss'); -final _buyMeACoffeeUrl = Uri.parse('https://www.buymeacoffee.com/bluefire'); class SupportContainer extends StatelessWidget { - const SupportContainer({Key? key}) : super(key: key); + const SupportContainer({super.key}); Future _open(Uri url) async { if (await canLaunchUrl(url)) { @@ -45,20 +44,6 @@ class SupportContainer extends StatelessWidget { ), ), ), - const SizedBox(width: 20), - Material( - color: Colors.transparent, - child: InkWell( - onTap: () { - _open(_buyMeACoffeeUrl); - }, - child: Image.asset( - 'assets/coffee_button.png', - width: 150, - fit: BoxFit.cover, - ), - ), - ), ], ), ], diff --git a/fire_atlas_editor/lib/screens/widgets/messages_board.dart b/fire_atlas_editor/lib/screens/widgets/messages_board.dart index dd90c70..545c142 100644 --- a/fire_atlas_editor/lib/screens/widgets/messages_board.dart +++ b/fire_atlas_editor/lib/screens/widgets/messages_board.dart @@ -17,12 +17,12 @@ class _MessageBoardSlice extends Equatable { } class MessagesBoard extends StatelessWidget { - const MessagesBoard({Key? key}) : super(key: key); + const MessagesBoard({super.key}); @override Widget build(_) { return SliceWatcher( - slicer: (state) => _MessageBoardSlice.fromState(state), + slicer: _MessageBoardSlice.fromState, builder: (ctx, store, slice) { return Column( children: slice.messages @@ -50,8 +50,8 @@ class _Message extends StatelessWidget { const _Message({ required this.message, required this.onVanish, - Key? key, - }) : super(key: key); + super.key, + }); @override Widget build(BuildContext ctx) { diff --git a/fire_atlas_editor/lib/screens/widgets/modal_container.dart b/fire_atlas_editor/lib/screens/widgets/modal_container.dart index b668165..d2f580c 100644 --- a/fire_atlas_editor/lib/screens/widgets/modal_container.dart +++ b/fire_atlas_editor/lib/screens/widgets/modal_container.dart @@ -17,12 +17,12 @@ class _ModalContainerSlice extends Equatable { } class ModalContainer extends StatelessWidget { - const ModalContainer({Key? key}) : super(key: key); + const ModalContainer({super.key}); @override Widget build(_) { return SliceWatcher( - slicer: (state) => _ModalContainerSlice.fromState(state), + slicer: _ModalContainerSlice.fromState, builder: (ctx, store, slice) { final modal = slice.modal; if (modal != null) { diff --git a/fire_atlas_editor/lib/screens/widgets/scaffold.dart b/fire_atlas_editor/lib/screens/widgets/scaffold.dart index ce075a2..7938c1f 100644 --- a/fire_atlas_editor/lib/screens/widgets/scaffold.dart +++ b/fire_atlas_editor/lib/screens/widgets/scaffold.dart @@ -5,7 +5,7 @@ import 'package:flutter/material.dart'; class FScaffold extends StatelessWidget { final Widget child; - const FScaffold({Key? key, required this.child}) : super(key: key); + const FScaffold({required this.child, super.key}); @override Widget build(BuildContext ctx) { diff --git a/fire_atlas_editor/lib/screens/widgets/toggle_theme_button.dart b/fire_atlas_editor/lib/screens/widgets/toggle_theme_button.dart index f8b1dde..82778f4 100644 --- a/fire_atlas_editor/lib/screens/widgets/toggle_theme_button.dart +++ b/fire_atlas_editor/lib/screens/widgets/toggle_theme_button.dart @@ -16,12 +16,12 @@ class _ToggleThemeButtonSlice extends Equatable { } class ToggleThemeButton extends StatelessWidget { - const ToggleThemeButton({Key? key}) : super(key: key); + const ToggleThemeButton({super.key}); @override Widget build(BuildContext context) { return SliceWatcher( - slicer: (state) => _ToggleThemeButtonSlice.fromState(state), + slicer: _ToggleThemeButtonSlice.fromState, builder: (context, store, slice) { return FIconButton( iconData: slice.currentTheme == ThemeMode.light diff --git a/fire_atlas_editor/lib/store/store.dart b/fire_atlas_editor/lib/store/store.dart index 6d86cce..2994c81 100644 --- a/fire_atlas_editor/lib/store/store.dart +++ b/fire_atlas_editor/lib/store/store.dart @@ -91,13 +91,13 @@ class FireAtlasState extends SlicesState { final ThemeMode currentTheme; FireAtlasState({ - this.hasChanges = false, - this.messages = const [], required this.loadedProject, required Nullable selectedSelection, required Nullable canvasSelection, required Nullable modal, required this.currentTheme, + this.hasChanges = false, + this.messages = const [], }) : _selectedSelection = selectedSelection, _canvasSelection = canvasSelection, _modal = modal; diff --git a/fire_atlas_editor/lib/widgets/button.dart b/fire_atlas_editor/lib/widgets/button.dart index d5bdaa8..3135eb4 100644 --- a/fire_atlas_editor/lib/widgets/button.dart +++ b/fire_atlas_editor/lib/widgets/button.dart @@ -9,14 +9,14 @@ class FButton extends StatelessWidget { final void Function() onSelect; const FButton({ - Key? key, + required this.label, + required this.onSelect, + super.key, this.selected = false, this.disabled = false, this.width, this.padding, - required this.label, - required this.onSelect, - }) : super(key: key); + }); @override Widget build(BuildContext ctx) { diff --git a/fire_atlas_editor/lib/widgets/color_badge.dart b/fire_atlas_editor/lib/widgets/color_badge.dart index bb6a68b..fe46665 100644 --- a/fire_atlas_editor/lib/widgets/color_badge.dart +++ b/fire_atlas_editor/lib/widgets/color_badge.dart @@ -6,10 +6,10 @@ class ColorBadge extends StatelessWidget { final Color color; const ColorBadge({ - Key? key, required this.label, required this.color, - }) : super(key: key); + super.key, + }); @override Widget build(BuildContext ctx) { diff --git a/fire_atlas_editor/lib/widgets/container.dart b/fire_atlas_editor/lib/widgets/container.dart index 133f763..5202807 100644 --- a/fire_atlas_editor/lib/widgets/container.dart +++ b/fire_atlas_editor/lib/widgets/container.dart @@ -9,14 +9,14 @@ class FContainer extends StatelessWidget { final EdgeInsets padding; const FContainer({ - Key? key, + super.key, this.child, this.height, this.width, this.color, this.margin = const EdgeInsets.all(2.5), this.padding = EdgeInsets.zero, - }) : super(key: key); + }); @override Widget build(BuildContext ctx) { diff --git a/fire_atlas_editor/lib/widgets/icon_button.dart b/fire_atlas_editor/lib/widgets/icon_button.dart index 8ce7e63..1f629ec 100644 --- a/fire_atlas_editor/lib/widgets/icon_button.dart +++ b/fire_atlas_editor/lib/widgets/icon_button.dart @@ -8,13 +8,13 @@ class FIconButton extends StatefulWidget { final String? tooltip; const FIconButton({ - Key? key, required this.iconData, required this.onPress, this.disabled = false, this.color, this.tooltip, - }) : super(key: key); + super.key, + }); @override State createState() => _FIconButtonState(); diff --git a/fire_atlas_editor/lib/widgets/image_selection_container.dart b/fire_atlas_editor/lib/widgets/image_selection_container.dart index eab5d19..eb4fcb8 100644 --- a/fire_atlas_editor/lib/widgets/image_selection_container.dart +++ b/fire_atlas_editor/lib/widgets/image_selection_container.dart @@ -16,16 +16,16 @@ class ImageSelectionContainer extends StatelessWidget { final EdgeInsets margin; const ImageSelectionContainer({ - Key? key, - this.imageData, required this.onSelectImage, + this.imageData, this.margin = const EdgeInsets.only( left: 30, right: 2.5, top: 2.5, bottom: 2.5, ), - }) : super(key: key); + super.key, + }); @override Widget build(BuildContext context) { @@ -57,15 +57,13 @@ class ImageSelectionContainer extends StatelessWidget { : const Center(child: Text('No image selected')), ), ), - Container( - child: FButton( - label: 'Select image', - onSelect: () async { - final storage = FireAtlasStorage(); - final imgDataUrl = await storage.selectFile(); - onSelectImage(imgDataUrl); - }, - ), + FButton( + label: 'Select image', + onSelect: () async { + final storage = FireAtlasStorage(); + final imgDataUrl = await storage.selectFile(); + onSelectImage(imgDataUrl); + }, ) ], ); diff --git a/fire_atlas_editor/lib/widgets/input_text_row.dart b/fire_atlas_editor/lib/widgets/input_text_row.dart index 4a7bc93..6bf5047 100644 --- a/fire_atlas_editor/lib/widgets/input_text_row.dart +++ b/fire_atlas_editor/lib/widgets/input_text_row.dart @@ -8,12 +8,12 @@ class InputTextRow extends StatelessWidget { final bool autofocus; const InputTextRow({ - Key? key, required this.inputController, required this.label, + super.key, this.enabled = true, this.autofocus = false, - }) : super(key: key); + }); @override Widget build(BuildContext ctx) { diff --git a/fire_atlas_editor/lib/widgets/simple_animation_widget.dart b/fire_atlas_editor/lib/widgets/simple_animation_widget.dart index 56ddcde..c40009a 100644 --- a/fire_atlas_editor/lib/widgets/simple_animation_widget.dart +++ b/fire_atlas_editor/lib/widgets/simple_animation_widget.dart @@ -9,9 +9,9 @@ class SimpleAnimationLoaderWidget extends StatelessWidget { final Future future; const SimpleAnimationLoaderWidget({ - Key? key, required this.future, - }) : super(key: key); + super.key, + }); @override Widget build(BuildContext ctx) { @@ -36,9 +36,9 @@ class AnimationPlayerWidget extends StatefulWidget { final SpriteAnimation animation; const AnimationPlayerWidget({ - Key? key, required this.animation, - }) : super(key: key); + super.key, + }); @override State createState() => _AnimationPlayerWidget(); @@ -50,28 +50,31 @@ class _AnimationPlayerWidget extends State int _lastUpdated = 0; bool _playing = false; + late final SpriteAnimationTicker _ticker; + @override void initState() { super.initState(); + _ticker = widget.animation.ticker(); _controller = AnimationController(vsync: this) ..addListener(() { final now = DateTime.now().millisecond; final double dt = max(0, (now - _lastUpdated) / 1000); - widget.animation.update(dt); + _ticker.update(dt); setState(() { _lastUpdated = now; }); }); - widget.animation.onComplete = _pauseAnimation; + _ticker.onComplete = _pauseAnimation; } void _initAnimation() { setState(() { - widget.animation.reset(); + _ticker.reset(); _playing = true; _lastUpdated = DateTime.now().millisecond; _controller.repeat( @@ -100,7 +103,7 @@ class _AnimationPlayerWidget extends State children: [ Positioned.fill( child: SimpleSpriteWidget( - sprite: widget.animation.getSprite(), + sprite: _ticker.getSprite(), center: true, ), ), diff --git a/fire_atlas_editor/lib/widgets/simple_sprite_widget.dart b/fire_atlas_editor/lib/widgets/simple_sprite_widget.dart index caa4365..bc13b1a 100644 --- a/fire_atlas_editor/lib/widgets/simple_sprite_widget.dart +++ b/fire_atlas_editor/lib/widgets/simple_sprite_widget.dart @@ -9,10 +9,10 @@ class SimpleSpriteLoaderWidget extends StatelessWidget { final bool center; const SimpleSpriteLoaderWidget({ - Key? key, required this.future, + super.key, this.center = false, - }) : super(key: key); + }); @override Widget build(BuildContext ctx) { @@ -41,16 +41,14 @@ class SimpleSpriteWidget extends StatelessWidget { final bool center; const SimpleSpriteWidget({ - Key? key, required this.sprite, + super.key, this.center = false, - }) : super(key: key); + }); @override Widget build(_) { - return Container( - child: CustomPaint(painter: _SimpleSpritePainter(sprite, center)), - ); + return CustomPaint(painter: _SimpleSpritePainter(sprite, center: center)); } } @@ -58,7 +56,7 @@ class _SimpleSpritePainter extends CustomPainter { final Sprite _sprite; final bool _center; - _SimpleSpritePainter(this._sprite, this._center); + _SimpleSpritePainter(this._sprite, {required bool center}) : _center = center; @override bool shouldRepaint(_SimpleSpritePainter old) => old._sprite != _sprite; diff --git a/fire_atlas_editor/lib/widgets/slide_container.dart b/fire_atlas_editor/lib/widgets/slide_container.dart index 7273f0f..3a38a44 100644 --- a/fire_atlas_editor/lib/widgets/slide_container.dart +++ b/fire_atlas_editor/lib/widgets/slide_container.dart @@ -15,11 +15,11 @@ class SlideContainer extends StatefulWidget { this.to = Offset.zero, this.duration = const Duration(seconds: 1), this.curve = Curves.easeInExpo, - Key? key, - }) : super(key: key); + super.key, + }); @override - _SlideContainer createState() => _SlideContainer(); + State createState() => _SlideContainer(); } class _SlideContainer extends State diff --git a/fire_atlas_editor/lib/widgets/text.dart b/fire_atlas_editor/lib/widgets/text.dart index 0d8ad79..a7f7030 100644 --- a/fire_atlas_editor/lib/widgets/text.dart +++ b/fire_atlas_editor/lib/widgets/text.dart @@ -5,10 +5,10 @@ class FLabel extends StatelessWidget { final double? fontSize; const FLabel({ - Key? key, required this.label, this.fontSize, - }) : super(key: key); + super.key, + }); @override Widget build(BuildContext ctx) { @@ -56,9 +56,9 @@ class FTitle extends StatelessWidget { final String title; const FTitle({ - Key? key, required this.title, - }) : super(key: key); + super.key, + }); @override Widget build(BuildContext ctx) => _FTitle( @@ -71,9 +71,9 @@ class FSubtitleTitle extends StatelessWidget { final String title; const FSubtitleTitle({ - Key? key, required this.title, - }) : super(key: key); + super.key, + }); @override Widget build(BuildContext ctx) => _FTitle( diff --git a/fire_atlas_editor/macos/Podfile b/fire_atlas_editor/macos/Podfile index dade8df..049abe2 100644 --- a/fire_atlas_editor/macos/Podfile +++ b/fire_atlas_editor/macos/Podfile @@ -1,4 +1,4 @@ -platform :osx, '10.11' +platform :osx, '10.14' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/fire_atlas_editor/macos/Podfile.lock b/fire_atlas_editor/macos/Podfile.lock index 23bb08c..cbdc984 100644 --- a/fire_atlas_editor/macos/Podfile.lock +++ b/fire_atlas_editor/macos/Podfile.lock @@ -2,7 +2,8 @@ PODS: - file_selector_macos (0.0.1): - FlutterMacOS - FlutterMacOS (1.0.0) - - shared_preferences_macos (0.0.1): + - shared_preferences_foundation (0.0.1): + - Flutter - FlutterMacOS - url_launcher_macos (0.0.1): - FlutterMacOS @@ -10,7 +11,7 @@ PODS: DEPENDENCIES: - file_selector_macos (from `Flutter/ephemeral/.symlinks/plugins/file_selector_macos/macos`) - FlutterMacOS (from `Flutter/ephemeral`) - - shared_preferences_macos (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_macos/macos`) + - shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/macos`) - url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`) EXTERNAL SOURCES: @@ -18,17 +19,17 @@ EXTERNAL SOURCES: :path: Flutter/ephemeral/.symlinks/plugins/file_selector_macos/macos FlutterMacOS: :path: Flutter/ephemeral - shared_preferences_macos: - :path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_macos/macos + shared_preferences_foundation: + :path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/macos url_launcher_macos: :path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos SPEC CHECKSUMS: - file_selector_macos: ff6dc948d4ddd34e8602a1f60b7d0b4cc6051a47 - FlutterMacOS: 57701585bf7de1b3fc2bb61f6378d73bbdea8424 - shared_preferences_macos: 480ce071d0666e37cef23fe6c702293a3d21799e - url_launcher_macos: 45af3d61de06997666568a7149c1be98b41c95d4 + file_selector_macos: f1b08a781e66103e3ba279fd5d4024a2478b3af6 + FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24 + shared_preferences_foundation: 297b3ebca31b34ec92be11acd7fb0ba932c822ca + url_launcher_macos: c04e4fa86382d4f94f6b38f14625708be3ae52e2 -PODFILE CHECKSUM: 6eac6b3292e5142cfc23bdeb71848a40ec51c14c +PODFILE CHECKSUM: 353c8bcc5d5b0994e508d035b5431cfe18c1dea7 -COCOAPODS: 1.10.1 +COCOAPODS: 1.12.0 diff --git a/fire_atlas_editor/macos/Runner.xcodeproj/project.pbxproj b/fire_atlas_editor/macos/Runner.xcodeproj/project.pbxproj index 655b2ec..aed4c02 100644 --- a/fire_atlas_editor/macos/Runner.xcodeproj/project.pbxproj +++ b/fire_atlas_editor/macos/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 51; + objectVersion = 54; objects = { /* Begin PBXAggregateTarget section */ @@ -202,7 +202,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0920; - LastUpgradeCheck = 0930; + LastUpgradeCheck = 1300; ORGANIZATIONNAME = ""; TargetAttributes = { 33CC10EC2044A3C60003C045 = { @@ -277,6 +277,7 @@ }; 3399D490228B24CF009A79C7 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -403,7 +404,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; @@ -484,7 +485,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; @@ -531,7 +532,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; diff --git a/fire_atlas_editor/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/fire_atlas_editor/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 7b25e87..4dcb8ba 100644 --- a/fire_atlas_editor/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/fire_atlas_editor/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ =2.18.0 <3.0.0" + dart: ">=3.0.0 <4.0.0" flutter: ">=3.3.0" diff --git a/fire_atlas_editor/pubspec.yaml b/fire_atlas_editor/pubspec.yaml index c481efb..c3b9097 100644 --- a/fire_atlas_editor/pubspec.yaml +++ b/fire_atlas_editor/pubspec.yaml @@ -6,7 +6,7 @@ publish_to: 'none' version: 1.0.0+1 environment: - sdk: ">=2.12.0 <3.0.0" + sdk: ">=3.0.0 <4.0.0" dependencies: cupertino_icons: ^1.0.5 @@ -15,9 +15,9 @@ dependencies: file_selector_linux: ^0.9.1 file_selector_macos: ^0.9.0+4 file_selector_windows: ^0.9.1+4 - flame: ^1.6.0 - flame_fire_atlas: ^1.3.3 - flame_lint: ^0.2.0 + flame: ^1.8.0 + flame_fire_atlas: ^1.3.6 + flame_lint: ^1.0.0 flutter: sdk: flutter shared_preferences: ^2.0.17 diff --git a/scripts/lint.sh b/scripts/lint.sh index 33939fc..2fb2124 100755 --- a/scripts/lint.sh +++ b/scripts/lint.sh @@ -1,9 +1,9 @@ #!/usr/bin/env bash function run_lint { - FORMAT_ISSUES=$(flutter format --set-exit-if-changed -n .) + FORMAT_ISSUES=$(dart format --set-exit-if-changed .) if [ $? -eq 1 ]; then - echo "flutter format issues on" + echo "dart format issues on" echo $FORMAT_ISSUES exit 1 fi