Skip to content

Commit

Permalink
# 11.0.0
Browse files Browse the repository at this point in the history
* Migrate to 3.7.0
  • Loading branch information
zmtzawqlp committed Jan 31, 2023
1 parent 37a0ee4 commit 2ed3c13
Show file tree
Hide file tree
Showing 12 changed files with 78 additions and 50 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 11.0.0

* Migrate to 3.7.0

# 10.2.0

* Add TextInputBindingMixin to prevent system keyboard show.
Expand Down
4 changes: 2 additions & 2 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/url_launcher_ios/ios"

SPEC CHECKSUMS:
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
url_launcher_ios: 02f1989d4e14e998335b02b67a7590fa34f971af
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
url_launcher_ios: ae1517e5e344f5544fb090b079e11f399dfbe4d2

PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3

Expand Down
4 changes: 3 additions & 1 deletion example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -222,6 +222,7 @@
};
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
Expand All @@ -236,6 +237,7 @@
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
Expand Down
2 changes: 2 additions & 0 deletions example/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,7 @@
<false/>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
</dict>
</plist>
4 changes: 2 additions & 2 deletions example/lib/pages/complex/text_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ class _TextDemoState extends State<TextDemo> {
specialTextSpanBuilder: _mySpecialTextSpanBuilder,
onSpecialTextTap: (dynamic value) {
if (value.toString().startsWith('\$')) {
launch('https://github.com/fluttercandies');
launchUrl(Uri.parse('https://github.com/fluttercandies'));
} else if (value.toString().startsWith('@')) {
launch('mailto:zmtzawqlp@live.com');
launchUrl(Uri.parse('mailto:zmtzawqlp@live.com'));
}
},
);
Expand Down
5 changes: 3 additions & 2 deletions example/lib/pages/main_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ class MainPage extends StatelessWidget {
),
),
onPressed: () {
launch('https://github.com/fluttercandies/extended_text_field');
launchUrl(Uri.parse(
'https://github.com/fluttercandies/extended_text_field'));
},
),
),
Expand All @@ -64,7 +65,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'));
},
),
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'dart:math' as math;
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:url_launcher/url_launcher.dart';

///
Expand Down Expand Up @@ -45,8 +44,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
Expand Down
6 changes: 3 additions & 3 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ publish_to: none
version: 1.0.0+1

environment:
sdk: '>=2.12.0 <3.0.0'
flutter: ">=2.10.0"
sdk: '>=2.17.0 <3.0.0'
flutter: ">=3.7.0"
dependencies:

# The following adds the Cupertino Icons font to your application.
Expand All @@ -27,7 +27,7 @@ dependencies:
#extended_text: ^9.0.0
#extended_text_library: ^9.0.0
ff_annotation_route_library: ^3.0.0
extended_text: ^9.1.0
extended_text: ^10.0.0
flutter:
sdk: flutter
html: ^0.15.0
Expand Down
25 changes: 23 additions & 2 deletions lib/src/extended_editable_text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1473,7 +1473,7 @@ class ExtendedEditableTextState extends State<ExtendedEditableText>
@override
void didChangeDependencies() {
super.didChangeDependencies();
final AutofillGroupState? newAutofillGroup = AutofillGroup.of(context);
final AutofillGroupState? newAutofillGroup = AutofillGroup.maybeOf(context);
if (currentAutofillScope != newAutofillGroup) {
_currentAutofillScope?.unregister(autofillId);
_currentAutofillScope = newAutofillGroup;
Expand Down Expand Up @@ -2977,7 +2977,7 @@ class ExtendedEditableTextState extends State<ExtendedEditableText>
textDirection: _textDirection,
locale: widget.locale,
textHeightBehavior: widget.textHeightBehavior ??
DefaultTextHeightBehavior.of(context),
DefaultTextHeightBehavior.maybeOf(context),
textWidthBasis: widget.textWidthBasis,
obscuringCharacter: widget.obscuringCharacter,
obscureText: widget.obscureText,
Expand Down Expand Up @@ -3198,6 +3198,27 @@ class ExtendedEditableTextState extends State<ExtendedEditableText>
_textInputConnection!.setSelectionRects(rects);
}
}

@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 _Editable extends MultiChildRenderObjectWidget {
Expand Down
63 changes: 32 additions & 31 deletions lib/src/extended_text_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import 'package:flutter/services.dart';
typedef InputCounterWidgetBuilder = Widget Function(
/// The build context for the TextField
BuildContext context, {

/// The length of the string currently in the input.
required int currentLength,

Expand Down Expand Up @@ -1400,40 +1399,42 @@ class ExtendedTextFieldState extends State<ExtendedTextField>
semanticsMaxValueLength = null;
}

return FocusTrapArea(
focusNode: focusNode,
child: MouseRegion(
cursor: effectiveMouseCursor,
onEnter: (PointerEnterEvent event) => _handleHover(true),
onExit: (PointerExitEvent event) => _handleHover(false),
child: IgnorePointer(
ignoring: !_isEnabled,
child: AnimatedBuilder(
animation: controller, // changes the _currentLength
builder: (BuildContext context, Widget? child) {
return Semantics(
maxValueLength: semanticsMaxValueLength,
currentValueLength: _currentLength,
onTap: widget.readOnly
? null
: () {
if (!_effectiveController.selection.isValid)
_effectiveController.selection =
TextSelection.collapsed(
offset: _effectiveController.text.length);
_requestKeyboard();
},
onDidGainAccessibilityFocus: handleDidGainAccessibilityFocus,
child: child,
);
},
child: _selectionGestureDetectorBuilder.buildGestureDetector(
behavior: HitTestBehavior.translucent,
return MouseRegion(
cursor: effectiveMouseCursor,
onEnter: (PointerEnterEvent event) => _handleHover(true),
onExit: (PointerExitEvent event) => _handleHover(false),
child:
// we didn't join the tap region
// TextFieldTapRegion(
// child:
IgnorePointer(
ignoring: !_isEnabled,
child: AnimatedBuilder(
animation: controller, // changes the _currentLength
builder: (BuildContext context, Widget? child) {
return Semantics(
maxValueLength: semanticsMaxValueLength,
currentValueLength: _currentLength,
onTap: widget.readOnly
? null
: () {
if (!_effectiveController.selection.isValid)
_effectiveController.selection =
TextSelection.collapsed(
offset: _effectiveController.text.length);
_requestKeyboard();
},
onDidGainAccessibilityFocus: handleDidGainAccessibilityFocus,
child: child,
),
);
},
child: _selectionGestureDetectorBuilder.buildGestureDetector(
behavior: HitTestBehavior.translucent,
child: child,
),
),
),
// ),
);
}

Expand Down
2 changes: 0 additions & 2 deletions lib/src/keyboard/binding.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'dart:ui';

import 'package:extended_text_field/src/keyboard/focus_node.dart';
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: extended_text_field
description: Extended official text field to build special text like inline image, @somebody, custom background etc quickly.It also support to build custom seleciton toolbar and handles.
version: 10.2.0
version: 11.0.0
homepage: https://github.com/fluttercandies/extended_text_field

environment:
sdk: '>=2.17.0 <3.0.0'
flutter: ">=3.0.0"
flutter: ">=3.7.0"
dependencies:

extended_text_library: ^9.1.0
Expand Down

0 comments on commit 2ed3c13

Please sign in to comment.