Skip to content

Commit

Permalink
## 9.0.1
Browse files Browse the repository at this point in the history
* Support to use keyboard move cursor for SpecialInlineSpan. #135
* Fix issue that backspace delete two chars. #141
  • Loading branch information
zmtzawqlp committed Dec 14, 2021
1 parent 7fbc5d8 commit e1d2323
Show file tree
Hide file tree
Showing 21 changed files with 113 additions and 155 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 9.0.1

* Support to use keyboard move cursor for SpecialInlineSpan. #135
* Fix issue that backspace delete two chars. #141

## 9.0.0

* Migrate to 2.8
Expand Down
29 changes: 29 additions & 0 deletions example/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.

# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml

linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at
# https://dart-lang.github.io/linter/lints/index.html.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="?android:colorBackground" />

<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>
12 changes: 6 additions & 6 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
PODS:
- Flutter (1.0.0)
- url_launcher (0.0.1):
- url_launcher_ios (0.0.1):
- Flutter

DEPENDENCIES:
- Flutter (from `Flutter`)
- url_launcher (from `.symlinks/plugins/url_launcher/ios`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)

EXTERNAL SOURCES:
Flutter:
:path: Flutter
url_launcher:
:path: ".symlinks/plugins/url_launcher/ios"
url_launcher_ios:
:path: ".symlinks/plugins/url_launcher_ios/ios"

SPEC CHECKSUMS:
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
url_launcher: a1c0cc845906122c4784c542523d8cacbded5626
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
url_launcher_ios: 02f1989d4e14e998335b02b67a7590fa34f971af

PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c

Expand Down
4 changes: 2 additions & 2 deletions 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 = 46;
objectVersion = 50;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -156,7 +156,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1020;
LastUpgradeCheck = 1300;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1300"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
6 changes: 3 additions & 3 deletions example/lib/special_text/at_text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';

class AtText extends SpecialText {
AtText(TextStyle textStyle, SpecialTextGestureTapCallback? onTap,
AtText(TextStyle? textStyle, SpecialTextGestureTapCallback? onTap,
{this.showAtBackground = false, this.start})
: super(flag, ' ', textStyle, onTap: onTap);
static const String flag = '@';
Expand All @@ -14,8 +14,8 @@ class AtText extends SpecialText {

@override
InlineSpan finishText() {
final TextStyle textStyle =
this.textStyle.copyWith(color: Colors.blue, fontSize: 16.0);
final TextStyle? textStyle =
this.textStyle?.copyWith(color: Colors.blue, fontSize: 16.0);

final String atText = toString();

Expand Down
4 changes: 2 additions & 2 deletions example/lib/special_text/dollar_text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';

class DollarText extends SpecialText {
DollarText(TextStyle textStyle, SpecialTextGestureTapCallback? onTap,
DollarText(TextStyle? textStyle, SpecialTextGestureTapCallback? onTap,
{this.start})
: super(flag, flag, textStyle, onTap: onTap);
static const String flag = '\$';
Expand All @@ -19,7 +19,7 @@ class DollarText extends SpecialText {

///caret can move into special text
deleteAll: true,
style: textStyle.copyWith(color: Colors.orange),
style: textStyle?.copyWith(color: Colors.orange),
recognizer: TapGestureRecognizer()
..onTap = () {
if (onTap != null) {
Expand Down
2 changes: 1 addition & 1 deletion example/lib/special_text/emoji_text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:flutter/material.dart';

///emoji/image text
class EmojiText extends SpecialText {
EmojiText(TextStyle textStyle, {this.start})
EmojiText(TextStyle? textStyle, {this.start})
: super(EmojiText.flag, ']', textStyle);
static const String flag = '[';
final int? start;
Expand Down
2 changes: 1 addition & 1 deletion example/lib/special_text/image_text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:html/dom.dart' hide Text;
import 'package:html/parser.dart';

class ImageText extends SpecialText {
ImageText(TextStyle textStyle,
ImageText(TextStyle? textStyle,
{this.start, SpecialTextGestureTapCallback? onTap})
: super(
ImageText.flag,
Expand Down
10 changes: 5 additions & 5 deletions example/lib/special_text/my_special_text_span_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,21 @@ class MySpecialTextSpanBuilder extends SpecialTextSpanBuilder {

///index is end index of start flag, so text start index should be index-(flag.length-1)
if (isStart(flag, EmojiText.flag)) {
return EmojiText(textStyle!, start: index! - (EmojiText.flag.length - 1));
return EmojiText(textStyle, start: index! - (EmojiText.flag.length - 1));
} else if (isStart(flag, ImageText.flag)) {
return ImageText(textStyle!,
return ImageText(textStyle,
start: index! - (ImageText.flag.length - 1), onTap: onTap);
} else if (isStart(flag, AtText.flag)) {
return AtText(
textStyle!,
textStyle,
onTap,
start: index! - (AtText.flag.length - 1),
showAtBackground: showAtBackground,
);
} else if (isStart(flag, EmojiText.flag)) {
return EmojiText(textStyle!, start: index! - (EmojiText.flag.length - 1));
return EmojiText(textStyle, start: index! - (EmojiText.flag.length - 1));
} else if (isStart(flag, DollarText.flag)) {
return DollarText(textStyle!, onTap,
return DollarText(textStyle, onTap,
start: index! - (DollarText.flag.length - 1));
}
return null;
Expand Down
6 changes: 3 additions & 3 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ dependencies:


cupertino_icons: ^1.0.4
extended_text: ^8.0.0
extended_text: ^8.0.1
extended_text_field:
path: ../
ff_annotation_route_library: ^3.0.0
Expand All @@ -37,8 +37,8 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
#dependency_overrides:
dependency_overrides:

# For information on the generic Dart part of this file, see the
# following page: https://www.dartlang.org/tools/pub/pubspec

Expand Down
Binary file removed example/web/favicon.png
Binary file not shown.
Binary file removed example/web/icons/Icon-192.png
Binary file not shown.
Binary file removed example/web/icons/Icon-512.png
Binary file not shown.
33 changes: 0 additions & 33 deletions example/web/index.html

This file was deleted.

23 changes: 0 additions & 23 deletions example/web/manifest.json

This file was deleted.

21 changes: 20 additions & 1 deletion lib/src/extended_editable_text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2670,10 +2670,29 @@ class ExtendedEditableTextState extends State<ExtendedEditableText>
if (newValue == textEditingValue) {
return;
}
textEditingValue = newValue;

userUpdateTextEditingValue(newValue, cause);
}

@override
void setSelection(TextSelection nextSelection, SelectionChangedCause cause) {
// suport left ,right,keyboard
if (cause == SelectionChangedCause.keyboard) {
if (supportSpecialText) {
final TextSelection temp = convertKeyboardMoveSelection(
renderEditable.text!,
nextSelection,
);
if (temp != nextSelection) {
_textInputConnection
?.setEditingState(_value.copyWith(selection: temp));
nextSelection = temp;
}
}
}
super.setSelection(nextSelection, cause);
}

@override
TextLayoutMetrics get textLayoutMetrics => renderEditable;
}
Expand Down
Loading

0 comments on commit e1d2323

Please sign in to comment.