From bc79339117981ab465193089f1462c4d47be29ca Mon Sep 17 00:00:00 2001 From: Alan Mantoux Date: Fri, 9 Aug 2024 22:08:55 +0200 Subject: [PATCH] Linting --- packages/fleather/example/ios/Podfile.lock | 12 +++++++--- .../ios/Runner.xcodeproj/project.pbxproj | 2 ++ .../example/ios/Runner/AppDelegate.swift | 2 +- packages/fleather/example/lib/main.dart | 23 ++++++++++--------- .../fleather/lib/src/widgets/autoformats.dart | 1 - .../fleather/lib/src/widgets/controller.dart | 1 - packages/fleather/lib/src/widgets/editor.dart | 1 - .../fleather/lib/src/widgets/history.dart | 1 - packages/fleather/lib/util.dart | 1 - packages/fleather/test/testing.dart | 1 - .../test/widgets/controller_test.dart | 1 - .../test/widgets/editable_text_test.dart | 1 - .../fleather/test/widgets/editor_test.dart | 1 - .../test/widgets/editor_toolbar_test.dart | 1 - .../fleather/test/widgets/history_test.dart | 1 - packages/parchment/lib/parchment.dart | 2 ++ packages/parchment/test/codecs/html_test.dart | 1 - .../parchment/test/codecs/markdown_test.dart | 1 - .../parchment/test/document/block_test.dart | 1 - .../parchment/test/document/leaf_test.dart | 1 - .../parchment/test/document/line_test.dart | 1 - packages/parchment/test/document_test.dart | 1 - .../test/heuristics/delete_rules_test.dart | 1 - .../test/heuristics/format_rules_test.dart | 1 - .../test/heuristics/insert_rules_test.dart | 1 - 25 files changed, 26 insertions(+), 35 deletions(-) diff --git a/packages/fleather/example/ios/Podfile.lock b/packages/fleather/example/ios/Podfile.lock index 1c707a36..56e8085c 100644 --- a/packages/fleather/example/ios/Podfile.lock +++ b/packages/fleather/example/ios/Podfile.lock @@ -2,12 +2,15 @@ PODS: - Flutter (1.0.0) - image_picker_ios (0.0.1): - Flutter + - integration_test (0.0.1): + - Flutter - url_launcher_ios (0.0.1): - Flutter DEPENDENCIES: - Flutter (from `Flutter`) - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`) + - integration_test (from `.symlinks/plugins/integration_test/ios`) - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) EXTERNAL SOURCES: @@ -15,14 +18,17 @@ EXTERNAL SOURCES: :path: Flutter image_picker_ios: :path: ".symlinks/plugins/image_picker_ios/ios" + integration_test: + :path: ".symlinks/plugins/integration_test/ios" url_launcher_ios: :path: ".symlinks/plugins/url_launcher_ios/ios" SPEC CHECKSUMS: Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 - image_picker_ios: b545a5f16c0fa88e3ecbbce3ed4de45567a8ec18 - url_launcher_ios: 6116280ddcfe98ab8820085d8d76ae7449447586 + image_picker_ios: c560581cceedb403a6ff17f2f816d7fea1421fc1 + integration_test: 252f60fa39af5e17c3aa9899d35d908a0721b573 + url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe PODFILE CHECKSUM: c4c93c5f6502fe2754f48404d3594bf779584011 -COCOAPODS: 1.14.3 +COCOAPODS: 1.15.2 diff --git a/packages/fleather/example/ios/Runner.xcodeproj/project.pbxproj b/packages/fleather/example/ios/Runner.xcodeproj/project.pbxproj index 602a2de0..463ff17b 100644 --- a/packages/fleather/example/ios/Runner.xcodeproj/project.pbxproj +++ b/packages/fleather/example/ios/Runner.xcodeproj/project.pbxproj @@ -245,11 +245,13 @@ inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", "${BUILT_PRODUCTS_DIR}/image_picker_ios/image_picker_ios.framework", + "${BUILT_PRODUCTS_DIR}/integration_test/integration_test.framework", "${BUILT_PRODUCTS_DIR}/url_launcher_ios/url_launcher_ios.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/image_picker_ios.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/integration_test.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher_ios.framework", ); runOnlyForDeploymentPostprocessing = 0; diff --git a/packages/fleather/example/ios/Runner/AppDelegate.swift b/packages/fleather/example/ios/Runner/AppDelegate.swift index 70693e4a..b6363034 100644 --- a/packages/fleather/example/ios/Runner/AppDelegate.swift +++ b/packages/fleather/example/ios/Runner/AppDelegate.swift @@ -1,7 +1,7 @@ import UIKit import Flutter -@UIApplicationMain +@main @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/packages/fleather/example/lib/main.dart b/packages/fleather/example/lib/main.dart index 3923988a..2bcce3d4 100644 --- a/packages/fleather/example/lib/main.dart +++ b/packages/fleather/example/lib/main.dart @@ -6,7 +6,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:image_picker/image_picker.dart'; -import 'package:parchment_delta/parchment_delta.dart'; import 'package:url_launcher/url_launcher.dart'; void main() { @@ -14,7 +13,7 @@ void main() { } class FleatherApp extends StatelessWidget { - const FleatherApp({Key? key}) : super(key: key); + const FleatherApp({super.key}); @override Widget build(BuildContext context) => MaterialApp( @@ -22,15 +21,15 @@ class FleatherApp extends StatelessWidget { theme: ThemeData.light(), darkTheme: ThemeData.dark(), title: 'Fleather - rich-text editor for Flutter', - home: HomePage(), + home: const HomePage(), ); } class HomePage extends StatefulWidget { - const HomePage({Key? key}) : super(key: key); + const HomePage({super.key}); @override - _HomePageState createState() => _HomePageState(); + State createState() => _HomePageState(); } class _HomePageState extends State { @@ -67,7 +66,9 @@ class _HomePageState extends State { ); _controller = FleatherController(document: doc); } catch (err, st) { - print('Cannot read welcome.json: $err\n$st'); + if (kDebugMode) { + print('Cannot read welcome.json: $err\n$st'); + } _controller = FleatherController(); } setState(() {}); @@ -76,7 +77,7 @@ class _HomePageState extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar(elevation: 0, title: Text('Fleather Demo')), + appBar: AppBar(elevation: 0, title: const Text('Fleather Demo')), floatingActionButton: FloatingActionButton( onPressed: () async { final picker = ImagePicker(); @@ -100,10 +101,10 @@ class _HomePageState extends State { ); } }, - child: Icon(Icons.add_a_photo), + child: const Icon(Icons.add_a_photo), ), body: _controller == null - ? Center(child: const CircularProgressIndicator()) + ? const Center(child: CircularProgressIndicator()) : Column( children: [ FleatherToolbar.basic( @@ -176,8 +177,8 @@ class _HomePageState extends State { void _launchUrl(String? url) async { if (url == null) return; final uri = Uri.parse(url); - final _canLaunch = await canLaunchUrl(uri); - if (_canLaunch) { + final canLaunch = await canLaunchUrl(uri); + if (canLaunch) { await launchUrl(uri); } } diff --git a/packages/fleather/lib/src/widgets/autoformats.dart b/packages/fleather/lib/src/widgets/autoformats.dart index a25005ec..a811dea5 100644 --- a/packages/fleather/lib/src/widgets/autoformats.dart +++ b/packages/fleather/lib/src/widgets/autoformats.dart @@ -3,7 +3,6 @@ import 'dart:math' as math; import 'package:flutter/services.dart'; import 'package:intl/intl.dart' as intl; import 'package:parchment/parchment.dart'; -import 'package:parchment_delta/parchment_delta.dart'; /// An [AutoFormat] is responsible for looking backwards for a pattern and /// applying a formatting suggestion to a document. diff --git a/packages/fleather/lib/src/widgets/controller.dart b/packages/fleather/lib/src/widgets/controller.dart index 6ecb410a..0d738614 100644 --- a/packages/fleather/lib/src/widgets/controller.dart +++ b/packages/fleather/lib/src/widgets/controller.dart @@ -4,7 +4,6 @@ import 'dart:math' as math; import 'package:collection/collection.dart'; import 'package:flutter/cupertino.dart'; import 'package:parchment/parchment.dart'; -import 'package:parchment_delta/parchment_delta.dart'; import '../../util.dart'; import 'autoformats.dart'; diff --git a/packages/fleather/lib/src/widgets/editor.dart b/packages/fleather/lib/src/widgets/editor.dart index f83d7460..43379301 100644 --- a/packages/fleather/lib/src/widgets/editor.dart +++ b/packages/fleather/lib/src/widgets/editor.dart @@ -9,7 +9,6 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter/services.dart'; import 'package:parchment/parchment.dart'; -import 'package:parchment_delta/parchment_delta.dart'; import '../../util.dart'; import '../rendering/editor.dart'; diff --git a/packages/fleather/lib/src/widgets/history.dart b/packages/fleather/lib/src/widgets/history.dart index 58d23f58..ad52253a 100644 --- a/packages/fleather/lib/src/widgets/history.dart +++ b/packages/fleather/lib/src/widgets/history.dart @@ -1,6 +1,5 @@ import 'package:flutter/widgets.dart'; import 'package:parchment/parchment.dart'; -import 'package:parchment_delta/parchment_delta.dart'; import 'controller.dart'; import '../util.dart'; diff --git a/packages/fleather/lib/util.dart b/packages/fleather/lib/util.dart index 4c977577..68d0f9e7 100644 --- a/packages/fleather/lib/util.dart +++ b/packages/fleather/lib/util.dart @@ -5,7 +5,6 @@ import 'dart:math' as math; import 'dart:ui'; import 'package:parchment/parchment.dart'; -import 'package:parchment_delta/parchment_delta.dart'; export 'src/fast_diff.dart'; diff --git a/packages/fleather/test/testing.dart b/packages/fleather/test/testing.dart index b26d0a65..a7905953 100644 --- a/packages/fleather/test/testing.dart +++ b/packages/fleather/test/testing.dart @@ -4,7 +4,6 @@ import 'package:fleather/src/widgets/text_selection.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:parchment_delta/parchment_delta.dart'; var delta = Delta()..insert('This House Is A Circus\n'); diff --git a/packages/fleather/test/widgets/controller_test.dart b/packages/fleather/test/widgets/controller_test.dart index b62c9691..92e29232 100644 --- a/packages/fleather/test/widgets/controller_test.dart +++ b/packages/fleather/test/widgets/controller_test.dart @@ -2,7 +2,6 @@ import 'package:fake_async/fake_async.dart'; import 'package:fleather/fleather.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:parchment_delta/parchment_delta.dart'; void main() { group('$FleatherController', () { diff --git a/packages/fleather/test/widgets/editable_text_test.dart b/packages/fleather/test/widgets/editable_text_test.dart index 449955d3..107a8755 100644 --- a/packages/fleather/test/widgets/editable_text_test.dart +++ b/packages/fleather/test/widgets/editable_text_test.dart @@ -3,7 +3,6 @@ import 'package:fleather/src/widgets/checkbox.dart'; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:parchment_delta/parchment_delta.dart'; import '../testing.dart'; diff --git a/packages/fleather/test/widgets/editor_test.dart b/packages/fleather/test/widgets/editor_test.dart index 73547385..692145b6 100644 --- a/packages/fleather/test/widgets/editor_test.dart +++ b/packages/fleather/test/widgets/editor_test.dart @@ -7,7 +7,6 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:parchment_delta/parchment_delta.dart'; import '../testing.dart'; diff --git a/packages/fleather/test/widgets/editor_toolbar_test.dart b/packages/fleather/test/widgets/editor_toolbar_test.dart index 91e2b590..5fbaec53 100644 --- a/packages/fleather/test/widgets/editor_toolbar_test.dart +++ b/packages/fleather/test/widgets/editor_toolbar_test.dart @@ -1,7 +1,6 @@ import 'package:fleather/fleather.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:parchment_delta/parchment_delta.dart'; import '../testing.dart'; diff --git a/packages/fleather/test/widgets/history_test.dart b/packages/fleather/test/widgets/history_test.dart index 7d2ef755..996ed892 100644 --- a/packages/fleather/test/widgets/history_test.dart +++ b/packages/fleather/test/widgets/history_test.dart @@ -3,7 +3,6 @@ import 'package:fleather/src/widgets/history.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:parchment_delta/parchment_delta.dart'; import '../testing.dart'; diff --git a/packages/parchment/lib/parchment.dart b/packages/parchment/lib/parchment.dart index bf150509..b24984fa 100644 --- a/packages/parchment/lib/parchment.dart +++ b/packages/parchment/lib/parchment.dart @@ -1,6 +1,8 @@ /// Rich text document model for Fleather editor. library parchment; +export 'package:parchment_delta/parchment_delta.dart'; + export 'src/document.dart'; export 'src/document/attributes.dart'; export 'src/document/block.dart'; diff --git a/packages/parchment/test/codecs/html_test.dart b/packages/parchment/test/codecs/html_test.dart index ba309219..3d57ed90 100644 --- a/packages/parchment/test/codecs/html_test.dart +++ b/packages/parchment/test/codecs/html_test.dart @@ -1,6 +1,5 @@ import 'package:parchment/parchment.dart'; import 'package:parchment/src/codecs/html.dart'; -import 'package:parchment_delta/parchment_delta.dart'; import 'package:test/test.dart'; void main() { diff --git a/packages/parchment/test/codecs/markdown_test.dart b/packages/parchment/test/codecs/markdown_test.dart index e498716b..c74db785 100644 --- a/packages/parchment/test/codecs/markdown_test.dart +++ b/packages/parchment/test/codecs/markdown_test.dart @@ -2,7 +2,6 @@ import 'dart:convert'; import 'package:parchment/codecs.dart'; import 'package:parchment/parchment.dart'; -import 'package:parchment_delta/parchment_delta.dart'; import 'package:test/test.dart'; void main() { diff --git a/packages/parchment/test/document/block_test.dart b/packages/parchment/test/document/block_test.dart index bcbc228c..2428d238 100644 --- a/packages/parchment/test/document/block_test.dart +++ b/packages/parchment/test/document/block_test.dart @@ -1,5 +1,4 @@ import 'package:parchment/parchment.dart'; -import 'package:parchment_delta/parchment_delta.dart'; import 'package:test/test.dart'; final rightAttrs = ParchmentStyle().merge(ParchmentAttribute.right); diff --git a/packages/parchment/test/document/leaf_test.dart b/packages/parchment/test/document/leaf_test.dart index 43d7e95a..23b197aa 100644 --- a/packages/parchment/test/document/leaf_test.dart +++ b/packages/parchment/test/document/leaf_test.dart @@ -1,7 +1,6 @@ import 'dart:convert'; import 'package:parchment/parchment.dart'; -import 'package:parchment_delta/parchment_delta.dart'; import 'package:test/test.dart'; final boldStyle = ParchmentStyle().merge(ParchmentAttribute.bold); diff --git a/packages/parchment/test/document/line_test.dart b/packages/parchment/test/document/line_test.dart index 23170480..b6a3328e 100644 --- a/packages/parchment/test/document/line_test.dart +++ b/packages/parchment/test/document/line_test.dart @@ -1,5 +1,4 @@ import 'package:parchment/parchment.dart'; -import 'package:parchment_delta/parchment_delta.dart'; import 'package:test/test.dart'; final boldStyle = ParchmentStyle().merge(ParchmentAttribute.bold); diff --git a/packages/parchment/test/document_test.dart b/packages/parchment/test/document_test.dart index 12717889..27288d5b 100644 --- a/packages/parchment/test/document_test.dart +++ b/packages/parchment/test/document_test.dart @@ -1,7 +1,6 @@ import 'dart:convert'; import 'package:parchment/parchment.dart'; -import 'package:parchment_delta/parchment_delta.dart'; import 'package:test/test.dart'; import 'matchers.dart'; diff --git a/packages/parchment/test/heuristics/delete_rules_test.dart b/packages/parchment/test/heuristics/delete_rules_test.dart index ed039131..12535b3c 100644 --- a/packages/parchment/test/heuristics/delete_rules_test.dart +++ b/packages/parchment/test/heuristics/delete_rules_test.dart @@ -1,5 +1,4 @@ import 'package:parchment/parchment.dart'; -import 'package:parchment_delta/parchment_delta.dart'; import 'package:test/test.dart'; final ul = ParchmentAttribute.ul.toJson(); diff --git a/packages/parchment/test/heuristics/format_rules_test.dart b/packages/parchment/test/heuristics/format_rules_test.dart index e159a1a5..6fe3a4a9 100644 --- a/packages/parchment/test/heuristics/format_rules_test.dart +++ b/packages/parchment/test/heuristics/format_rules_test.dart @@ -1,5 +1,4 @@ import 'package:parchment/parchment.dart'; -import 'package:parchment_delta/parchment_delta.dart'; import 'package:test/test.dart'; final ul = ParchmentAttribute.ul.toJson(); diff --git a/packages/parchment/test/heuristics/insert_rules_test.dart b/packages/parchment/test/heuristics/insert_rules_test.dart index c9ac4cc6..0f2cfb85 100644 --- a/packages/parchment/test/heuristics/insert_rules_test.dart +++ b/packages/parchment/test/heuristics/insert_rules_test.dart @@ -1,5 +1,4 @@ import 'package:parchment/parchment.dart'; -import 'package:parchment_delta/parchment_delta.dart'; import 'package:test/test.dart'; final ul = ParchmentAttribute.ul.toJson();