From 5714918f6b05e670bf26c1437b0c139a4708015c Mon Sep 17 00:00:00 2001 From: zmtzawqlp Date: Thu, 26 Jan 2023 18:11:07 +0800 Subject: [PATCH] # 10.0.0 * Migrate to 3.7.0 --- CHANGELOG.md | 4 ++ example/ios/Runner.xcodeproj/project.pbxproj | 4 +- example/ios/Runner/Info.plist | 2 + example/lib/pages/background_text_demo.dart | 8 +-- .../lib/pages/custom_text_overflow_demo.dart | 10 +-- example/lib/pages/join_zero_width_space.dart | 6 +- example/lib/pages/main_page.dart | 5 +- example/lib/pages/regexp_text_demo.dart | 6 +- example/lib/pages/text_demo.dart | 4 +- example/lib/pages/text_selection_demo.dart | 9 +-- .../my_extended_text_selection_controls.dart | 5 +- example/pubspec.yaml | 4 +- .../selection/extended_text_selection.dart | 21 ++++++ lib/src/text_overflow_render_mixin.dart | 2 +- pubspec.lock | 71 ++++++++++++------- pubspec.yaml | 4 +- 16 files changed, 107 insertions(+), 58 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7503838..dfbcd51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 10.0.0 + +* Migrate to 3.7.0 + # 9.1.2 * Add TextOverflowWidget.clearType diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index 7ab17e9..325da1d 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -200,6 +200,7 @@ /* Begin PBXShellScriptBuildPhase section */ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -231,6 +232,7 @@ }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); diff --git a/example/ios/Runner/Info.plist b/example/ios/Runner/Info.plist index 1579fb3..4f68a2c 100644 --- a/example/ios/Runner/Info.plist +++ b/example/ios/Runner/Info.plist @@ -43,5 +43,7 @@ CADisableMinimumFrameDurationOnPhone + UIApplicationSupportsIndirectInputEvents + diff --git a/example/lib/pages/background_text_demo.dart b/example/lib/pages/background_text_demo.dart index 86b1d99..07c37ce 100644 --- a/example/lib/pages/background_text_demo.dart +++ b/example/lib/pages/background_text_demo.dart @@ -30,8 +30,8 @@ class BackgroundTextDemo extends StatelessWidget { ), recognizer: TapGestureRecognizer() ..onTap = () { - launch( - 'https://github.com/flutter/flutter/issues/24335'); + launchUrl(Uri.parse( + 'https://github.com/flutter/flutter/issues/24335')); }), const TextSpan(text: '/'), TextSpan( @@ -39,8 +39,8 @@ class BackgroundTextDemo extends StatelessWidget { style: const TextStyle(color: Colors.blue), recognizer: TapGestureRecognizer() ..onTap = () { - launch( - 'https://github.com/flutter/flutter/issues/24337'); + launchUrl(Uri.parse( + 'https://github.com/flutter/flutter/issues/24337')); }), ])), const Text( diff --git a/example/lib/pages/custom_text_overflow_demo.dart b/example/lib/pages/custom_text_overflow_demo.dart index 70f7646..b9c5baa 100644 --- a/example/lib/pages/custom_text_overflow_demo.dart +++ b/example/lib/pages/custom_text_overflow_demo.dart @@ -107,8 +107,8 @@ class _CustomTextOverflowDemoState extends State { 'more', ), onTap: () { - launch( - 'https://github.com/fluttercandies/extended_text'); + launchUrl(Uri.parse( + 'https://github.com/fluttercandies/extended_text')); }, ) ], @@ -125,12 +125,12 @@ class _CustomTextOverflowDemoState extends State { void onSpecialTextTap(dynamic parameter) { if (parameter.toString().startsWith('\$')) { if (parameter.toString().contains('issue')) { - launch('https://github.com/flutter/flutter/issues/26748'); + launchUrl(Uri.parse('https://github.com/flutter/flutter/issues/26748')); } else { - launch('https://github.com/fluttercandies'); + launchUrl(Uri.parse('https://github.com/fluttercandies')); } } else if (parameter.toString().startsWith('@')) { - launch('mailto:zmtzawqlp@live.com'); + launchUrl(Uri.parse('mailto:zmtzawqlp@live.com')); } } } diff --git a/example/lib/pages/join_zero_width_space.dart b/example/lib/pages/join_zero_width_space.dart index 8b09dea..2a57132 100644 --- a/example/lib/pages/join_zero_width_space.dart +++ b/example/lib/pages/join_zero_width_space.dart @@ -87,12 +87,12 @@ class JoinZeroWidthSpaceDemo extends StatelessWidget { void onSpecialTextTap(dynamic parameter) { if (parameter.toString().startsWith('\$')) { if (parameter.toString().contains('issue')) { - launch('https://github.com/flutter/flutter/issues/26748'); + launchUrl(Uri.parse('https://github.com/flutter/flutter/issues/26748')); } else { - launch('https://github.com/fluttercandies'); + launchUrl(Uri.parse('https://github.com/fluttercandies')); } } else if (parameter.toString().startsWith('@')) { - launch('mailto:zmtzawqlp@live.com'); + launchUrl(Uri.parse('mailto:zmtzawqlp@live.com')); } } } diff --git a/example/lib/pages/main_page.dart b/example/lib/pages/main_page.dart index f5b2775..ac0b1e4 100644 --- a/example/lib/pages/main_page.dart +++ b/example/lib/pages/main_page.dart @@ -42,7 +42,8 @@ class MainPage extends StatelessWidget { ), ), onPressed: () { - launch('https://github.com/fluttercandies/extended_text'); + launchUrl(Uri.parse( + 'https://github.com/fluttercandies/extended_text')); }, ), ), @@ -54,7 +55,7 @@ class MainPage extends StatelessWidget { child: Image.network( 'https://pub.idqqimg.com/wpa/images/group.png'), onPressed: () { - launch('https://jq.qq.com/?_wv=1027&k=5bcc0gy'); + launchUrl(Uri.parse('https://jq.qq.com/?_wv=1027&k=5bcc0gy')); }, ), ) diff --git a/example/lib/pages/regexp_text_demo.dart b/example/lib/pages/regexp_text_demo.dart index 2adbf2e..d02022e 100644 --- a/example/lib/pages/regexp_text_demo.dart +++ b/example/lib/pages/regexp_text_demo.dart @@ -23,11 +23,11 @@ class RegExpTextDemo extends StatelessWidget { '\n\nif you meet any problem, please let me know @zmtzawqlp and send an mailto:zmtzawqlp@live.com to me .[sun_glasses] ', onSpecialTextTap: (dynamic parameter) { if (parameter.toString().startsWith('\$')) { - launch('https://github.com/fluttercandies'); + launchUrl(Uri.parse('https://github.com/fluttercandies')); } else if (parameter.toString().startsWith('@')) { - launch('mailto:zmtzawqlp@live.com'); + launchUrl(Uri.parse('mailto:zmtzawqlp@live.com')); } else if (parameter.toString().startsWith('mailto:')) { - launch(parameter.toString()); + launchUrl(Uri.parse(parameter.toString())); } }, specialTextSpanBuilder: MyRegExpSpecialTextSpanBuilder(), diff --git a/example/lib/pages/text_demo.dart b/example/lib/pages/text_demo.dart index 8393a08..c0f3429 100644 --- a/example/lib/pages/text_demo.dart +++ b/example/lib/pages/text_demo.dart @@ -23,9 +23,9 @@ class TextDemo extends StatelessWidget { '\n\nif you meet any problem, please let me know @zmtzawqlp .[sun_glasses]', onSpecialTextTap: (dynamic parameter) { if (parameter.toString().startsWith('\$')) { - launch('https://github.com/fluttercandies'); + launchUrl(Uri.parse('https://github.com/fluttercandies')); } else if (parameter.toString().startsWith('@')) { - launch('mailto:zmtzawqlp@live.com'); + launchUrl(Uri.parse('mailto:zmtzawqlp@live.com')); } }, specialTextSpanBuilder: MySpecialTextSpanBuilder(), diff --git a/example/lib/pages/text_selection_demo.dart b/example/lib/pages/text_selection_demo.dart index a8de103..aafb0af 100644 --- a/example/lib/pages/text_selection_demo.dart +++ b/example/lib/pages/text_selection_demo.dart @@ -50,9 +50,10 @@ class _TextSelectionDemoState extends State { _attachContent, onSpecialTextTap: (dynamic parameter) { if (parameter.toString().startsWith('\$')) { - launch('https://github.com/fluttercandies'); + launchUrl( + Uri.parse('https://github.com/fluttercandies')); } else if (parameter.toString().startsWith('@')) { - launch('mailto:zmtzawqlp@live.com'); + launchUrl(Uri.parse('mailto:zmtzawqlp@live.com')); } }, specialTextSpanBuilder: MySpecialTextSpanBuilder(), @@ -67,8 +68,8 @@ class _TextSelectionDemoState extends State { InkWell( child: const Text('more'), onTap: () { - launch( - 'https://github.com/fluttercandies/extended_text'); + launchUrl(Uri.parse( + 'https://github.com/fluttercandies/extended_text')); }, ) ], diff --git a/example/lib/text/my_extended_text_selection_controls.dart b/example/lib/text/my_extended_text_selection_controls.dart index 0b5de51..95c9169 100644 --- a/example/lib/text/my_extended_text_selection_controls.dart +++ b/example/lib/text/my_extended_text_selection_controls.dart @@ -1,7 +1,6 @@ import 'dart:math' as math; import 'package:extended_text_library/extended_text_library.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -75,8 +74,8 @@ class MyTextSelectionControls extends TextSelectionControls { handleSelectAll: canSelectAll(delegate) ? () => handleSelectAll(delegate) : null, handleLike: () { - launch( - 'mailto:zmtzawqlp@live.com?subject=extended_text_share&body=${delegate.textEditingValue.text}'); + launchUrl(Uri.parse( + 'mailto:zmtzawqlp@live.com?subject=extended_text_share&body=${delegate.textEditingValue.text}')); delegate.hideToolbar(); delegate.userUpdateTextEditingValue( delegate.textEditingValue diff --git a/example/pubspec.yaml b/example/pubspec.yaml index c53f1f5..27ed0bf 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -10,8 +10,8 @@ description: A new Flutter application. version: 1.0.0+1 environment: - sdk: '>=2.17.0-0 <3.0.0' - flutter: ">=2.10.0" + sdk: '>=2.17.0 <3.0.0' + flutter: ">=3.7.0" dependencies: cupertino_icons: ^1.0.2 ff_annotation_route_library: ^3.0.0 diff --git a/lib/src/selection/extended_text_selection.dart b/lib/src/selection/extended_text_selection.dart index 383b008..d9fbcb2 100644 --- a/lib/src/selection/extended_text_selection.dart +++ b/lib/src/selection/extended_text_selection.dart @@ -843,6 +843,27 @@ class ExtendedTextSelectionState extends State @override void removeTextPlaceholder() {} + + @override + void didChangeInputControl( + TextInputControl? oldControl, TextInputControl? newControl) { + if (_hasFocus && _hasInputConnection) { + oldControl?.hide(); + newControl?.show(); + } + } + + @override + void performSelector(String selectorName) { + final Intent? intent = intentForMacOSSelector(selectorName); + + if (intent != null) { + final BuildContext? primaryContext = primaryFocus?.context; + if (primaryContext != null) { + Actions.invoke(primaryContext, intent); + } + } + } } class _CopySelectionAction extends ContextAction { diff --git a/lib/src/text_overflow_render_mixin.dart b/lib/src/text_overflow_render_mixin.dart index acba9fe..073c6ad 100644 --- a/lib/src/text_overflow_render_mixin.dart +++ b/lib/src/text_overflow_render_mixin.dart @@ -814,7 +814,7 @@ class _TextRange { ); @override - int get hashCode => hashValues(start, end); + int get hashCode => Object.hash(start, end); @override bool operator ==(Object other) { diff --git a/pubspec.lock b/pubspec.lock index 81f9de8..e99fee7 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,48 +5,47 @@ packages: dependency: transitive description: name: async + sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 url: "https://pub.flutter-io.cn" source: hosted - version: "2.8.2" + version: "2.10.0" boolean_selector: dependency: transitive description: name: boolean_selector + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.0" + version: "2.1.1" characters: dependency: transitive description: name: characters + sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c url: "https://pub.flutter-io.cn" source: hosted - version: "1.2.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.3.1" + version: "1.2.1" clock: dependency: transitive description: name: clock + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf url: "https://pub.flutter-io.cn" source: hosted - version: "1.1.0" + version: "1.1.1" collection: dependency: transitive description: name: collection + sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 url: "https://pub.flutter-io.cn" source: hosted - version: "1.16.0" + version: "1.17.0" extended_text_library: dependency: "direct main" description: name: extended_text_library + sha256: "3538b6ab1c177071b7897bc059d666ba289a042d2142e9f647b7ccbc3e65496b" url: "https://pub.flutter-io.cn" source: hosted version: "9.1.1" @@ -54,9 +53,10 @@ packages: dependency: transitive description: name: fake_async + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" url: "https://pub.flutter-io.cn" source: hosted - version: "1.3.0" + version: "1.3.1" flutter: dependency: "direct main" description: flutter @@ -67,34 +67,46 @@ packages: description: flutter source: sdk version: "0.0.0" + js: + dependency: transitive + description: + name: js + sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.6.5" matcher: dependency: transitive description: name: matcher + sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" url: "https://pub.flutter-io.cn" source: hosted - version: "0.12.11" + version: "0.12.13" material_color_utilities: dependency: transitive description: name: material_color_utilities + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 url: "https://pub.flutter-io.cn" source: hosted - version: "0.1.4" + version: "0.2.0" meta: dependency: transitive description: name: meta + sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" url: "https://pub.flutter-io.cn" source: hosted - version: "1.7.0" + version: "1.8.0" path: dependency: transitive description: name: path + sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b url: "https://pub.flutter-io.cn" source: hosted - version: "1.8.1" + version: "1.8.2" sky_engine: dependency: transitive description: flutter @@ -104,51 +116,58 @@ packages: dependency: transitive description: name: source_span + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 url: "https://pub.flutter-io.cn" source: hosted - version: "1.8.2" + version: "1.9.1" stack_trace: dependency: transitive description: name: stack_trace + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 url: "https://pub.flutter-io.cn" source: hosted - version: "1.10.0" + version: "1.11.0" stream_channel: dependency: transitive description: name: stream_channel + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.0" + version: "2.1.1" string_scanner: dependency: transitive description: name: string_scanner + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" url: "https://pub.flutter-io.cn" source: hosted - version: "1.1.0" + version: "1.2.0" term_glyph: dependency: transitive description: name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 url: "https://pub.flutter-io.cn" source: hosted - version: "1.2.0" + version: "1.2.1" test_api: dependency: transitive description: name: test_api + sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 url: "https://pub.flutter-io.cn" source: hosted - version: "0.4.9" + version: "0.4.16" vector_math: dependency: transitive description: name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.2" + version: "2.1.4" sdks: - dart: ">=2.17.0 <3.0.0" - flutter: ">=3.0.0" + dart: ">=2.18.0 <4.0.0" + flutter: ">=3.7.0" diff --git a/pubspec.yaml b/pubspec.yaml index 0e5f562..f36b084 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,11 +1,11 @@ name: extended_text description: Extended official text to build special text like inline image or @somebody quickly,it also support custom background,custom over flow and custom selection toolbar and handles. -version: 9.1.2 +version: 10.0.0 homepage: https://github.com/fluttercandies/extended_text environment: sdk: '>=2.17.0 <3.0.0' - flutter: ">=3.0.0" + flutter: ">=3.7.0" dependencies: extended_text_library: ^9.1.0