chore: upgrade flutter to 3.10.1 (#136)
* chore: upgrade to flutter 3.10.1 * cicd: update actions * fix: example application upgrade * fix: formatting issues
This commit is contained in:
parent
b3d4529e39
commit
cbe2902373
19 changed files with 78 additions and 82 deletions
5
.github/workflows/commit_lint.yml
vendored
5
.github/workflows/commit_lint.yml
vendored
|
|
@ -5,8 +5,7 @@ jobs:
|
|||
commitlint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: wagoid/commitlint-github-action@v4
|
||||
|
||||
- uses: wagoid/commitlint-github-action@v5
|
||||
|
|
|
|||
6
.github/workflows/test.yml
vendored
6
.github/workflows/test.yml
vendored
|
|
@ -12,7 +12,7 @@ on:
|
|||
- "release/*"
|
||||
|
||||
env:
|
||||
FLUTTER_VERSION: "3.7.5"
|
||||
FLUTTER_VERSION: "3.10.1"
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
|
|
@ -23,7 +23,7 @@ jobs:
|
|||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: subosito/flutter-action@v2
|
||||
with:
|
||||
|
|
@ -42,4 +42,4 @@ jobs:
|
|||
with:
|
||||
env_vars: ${{ matrix.os }}
|
||||
fail_ci_if_error: true
|
||||
verbose: true
|
||||
verbose: true
|
||||
|
|
|
|||
|
|
@ -79,10 +79,10 @@ SelectionMenuItem continueToWriteMenuItem = SelectionMenuItem(
|
|||
context: context,
|
||||
builder: (context) {
|
||||
diglogContext = context;
|
||||
return AlertDialog(
|
||||
return const AlertDialog(
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: const [
|
||||
children: [
|
||||
CircularProgressIndicator(),
|
||||
SizedBox(height: 10),
|
||||
Text('Loading'),
|
||||
|
|
|
|||
|
|
@ -170,10 +170,10 @@ class _SmartEditWidgetState extends State<SmartEditWidget> {
|
|||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return AlertDialog(
|
||||
return const AlertDialog(
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: const [
|
||||
children: [
|
||||
CircularProgressIndicator(),
|
||||
SizedBox(height: 10),
|
||||
Text('Loading'),
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
|
|||
version: 1.0.0+1
|
||||
|
||||
environment:
|
||||
sdk: ">=2.17.0 <3.0.0"
|
||||
sdk: ">=3.0.0 <4.0.0"
|
||||
|
||||
# Dependencies specify other packages that your package needs in order to work.
|
||||
# To automatically upgrade your package dependencies to the latest versions
|
||||
|
|
@ -30,15 +30,12 @@ dependencies:
|
|||
flutter:
|
||||
sdk: flutter
|
||||
|
||||
# The following adds the Cupertino Icons font to your application.
|
||||
# Use with the CupertinoIcons class for iOS style icons.
|
||||
cupertino_icons: ^1.0.2
|
||||
appflowy_editor:
|
||||
path: ../
|
||||
provider: ^6.0.3
|
||||
url_launcher: ^6.1.5
|
||||
path_provider: ^2.0.11
|
||||
google_fonts: ^3.0.1
|
||||
path_provider: ^2.0.15
|
||||
google_fonts: ^4.0.4
|
||||
flutter_localizations:
|
||||
sdk: flutter
|
||||
file_picker: ^5.0.1
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import 'package:appflowy_editor/src/core/legacy/built_in_attribute_keys.dart';
|
|||
///
|
||||
/// ONLY USE FOR MIGRATION.
|
||||
///
|
||||
class NodeV0 extends ChangeNotifier with LinkedListEntry<NodeV0> {
|
||||
final class NodeV0 extends ChangeNotifier with LinkedListEntry<NodeV0> {
|
||||
NodeV0({
|
||||
required this.type,
|
||||
Attributes? attributes,
|
||||
|
|
@ -226,7 +226,7 @@ class NodeV0 extends ChangeNotifier with LinkedListEntry<NodeV0> {
|
|||
}
|
||||
}
|
||||
|
||||
class TextNodeV0 extends NodeV0 {
|
||||
final class TextNodeV0 extends NodeV0 {
|
||||
TextNodeV0({
|
||||
required Delta delta,
|
||||
LinkedList<NodeV0>? children,
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ import 'package:nanoid/nanoid.dart';
|
|||
/// 'data': Map<String, Object>
|
||||
/// 'children': List<Node>,
|
||||
/// }
|
||||
class Node extends ChangeNotifier with LinkedListEntry<Node> {
|
||||
final class Node extends ChangeNotifier with LinkedListEntry<Node> {
|
||||
Node({
|
||||
required this.type,
|
||||
String? id,
|
||||
|
|
@ -231,7 +231,7 @@ class Node extends ChangeNotifier with LinkedListEntry<Node> {
|
|||
}
|
||||
|
||||
@Deprecated('Use Paragraph instead')
|
||||
class TextNode extends Node {
|
||||
final class TextNode extends Node {
|
||||
TextNode({
|
||||
required Delta delta,
|
||||
Iterable<Node>? children,
|
||||
|
|
|
|||
|
|
@ -231,28 +231,25 @@ class UpdateTextOperation extends Operation {
|
|||
|
||||
// TODO(Lucas.Xu): refactor this part
|
||||
Path transformPath(Path preInsertPath, Path b, [int delta = 1]) {
|
||||
if (preInsertPath.length > b.length) {
|
||||
return b;
|
||||
}
|
||||
if (preInsertPath.isEmpty || b.isEmpty) {
|
||||
if (preInsertPath.length > b.length || preInsertPath.isEmpty || b.isEmpty) {
|
||||
return b;
|
||||
}
|
||||
|
||||
// check the prefix
|
||||
for (var i = 0; i < preInsertPath.length - 1; i++) {
|
||||
for (int i = 0; i < preInsertPath.length - 1; i++) {
|
||||
if (preInsertPath[i] != b[i]) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
|
||||
final prefix = preInsertPath.sublist(0, preInsertPath.length - 1);
|
||||
final suffix = b.sublist(preInsertPath.length);
|
||||
final preInsertLast = preInsertPath.last;
|
||||
final bAtIndex = b[preInsertPath.length - 1];
|
||||
if (preInsertLast <= bAtIndex) {
|
||||
prefix.add(bAtIndex + delta);
|
||||
} else {
|
||||
prefix.add(bAtIndex);
|
||||
}
|
||||
|
||||
prefix.add(preInsertLast <= bAtIndex ? bAtIndex + delta : bAtIndex);
|
||||
prefix.addAll(suffix);
|
||||
|
||||
return prefix;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,14 +13,12 @@ Future<bool> formatMarkdownSymbol(
|
|||
bool Function(
|
||||
String text,
|
||||
Selection selection,
|
||||
)
|
||||
predicate,
|
||||
) predicate,
|
||||
Node Function(
|
||||
String text,
|
||||
Node node,
|
||||
Delta delta,
|
||||
)
|
||||
nodeBuilder,
|
||||
) nodeBuilder,
|
||||
) async {
|
||||
final selection = editorState.selection;
|
||||
if (selection == null || !selection.isCollapsed) {
|
||||
|
|
|
|||
|
|
@ -190,8 +190,7 @@ extension TextTransforms on EditorState {
|
|||
Selection? selection,
|
||||
Node Function(
|
||||
Node node,
|
||||
)
|
||||
nodeBuilder,
|
||||
) nodeBuilder,
|
||||
) async {
|
||||
selection ??= this.selection;
|
||||
selection = selection?.normalized;
|
||||
|
|
|
|||
|
|
@ -181,6 +181,11 @@ class DeltaTextInputService extends TextInputService with DeltaTextInputClient {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void insertContent(KeyboardInsertedContent content) {
|
||||
// TODO: implement insertContent
|
||||
}
|
||||
}
|
||||
|
||||
const String _whitespace = ' ';
|
||||
|
|
|
|||
|
|
@ -570,7 +570,7 @@ class OverlayState extends State<Overlay> with TickerProviderStateMixin {
|
|||
///
|
||||
/// The first [skipCount] children are considered "offstage".
|
||||
class _Theatre extends MultiChildRenderObjectWidget {
|
||||
_Theatre({
|
||||
const _Theatre({
|
||||
Key? key,
|
||||
this.skipCount = 0,
|
||||
this.clipBehavior = Clip.hardEdge,
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import 'package:appflowy_editor/src/editor_state.dart';
|
|||
/// A [HistoryItem] contains list of operations committed by users.
|
||||
/// If a [HistoryItem] is not sealed, operations can be added sequentially.
|
||||
/// Otherwise, the operations should be added to a new [HistoryItem].
|
||||
class HistoryItem extends LinkedListEntry<HistoryItem> {
|
||||
final class HistoryItem extends LinkedListEntry<HistoryItem> {
|
||||
final List<Operation> operations = [];
|
||||
Selection? beforeSelection;
|
||||
Selection? afterSelection;
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:intl/message_lookup_by_library.dart';
|
||||
import 'package:intl/src/intl_helpers.dart';
|
||||
|
|
@ -41,29 +42,29 @@ import 'messages_zh-TW.dart' as messages_zh_tw;
|
|||
|
||||
typedef Future<dynamic> LibraryLoader();
|
||||
Map<String, LibraryLoader> _deferredLibraries = {
|
||||
'bn_BN': () => new Future.value(null),
|
||||
'ca': () => new Future.value(null),
|
||||
'cs_CZ': () => new Future.value(null),
|
||||
'da': () => new Future.value(null),
|
||||
'de_DE': () => new Future.value(null),
|
||||
'en': () => new Future.value(null),
|
||||
'es_VE': () => new Future.value(null),
|
||||
'fr_CA': () => new Future.value(null),
|
||||
'fr_FR': () => new Future.value(null),
|
||||
'hi_IN': () => new Future.value(null),
|
||||
'hu_HU': () => new Future.value(null),
|
||||
'id_ID': () => new Future.value(null),
|
||||
'it_IT': () => new Future.value(null),
|
||||
'ja_JP': () => new Future.value(null),
|
||||
'ml_IN': () => new Future.value(null),
|
||||
'nl_NL': () => new Future.value(null),
|
||||
'pl_PL': () => new Future.value(null),
|
||||
'pt_BR': () => new Future.value(null),
|
||||
'pt_PT': () => new Future.value(null),
|
||||
'ru_RU': () => new Future.value(null),
|
||||
'tr_TR': () => new Future.value(null),
|
||||
'zh_CN': () => new Future.value(null),
|
||||
'zh_TW': () => new Future.value(null),
|
||||
'bn_BN': () => new SynchronousFuture(null),
|
||||
'ca': () => new SynchronousFuture(null),
|
||||
'cs_CZ': () => new SynchronousFuture(null),
|
||||
'da': () => new SynchronousFuture(null),
|
||||
'de_DE': () => new SynchronousFuture(null),
|
||||
'en': () => new SynchronousFuture(null),
|
||||
'es_VE': () => new SynchronousFuture(null),
|
||||
'fr_CA': () => new SynchronousFuture(null),
|
||||
'fr_FR': () => new SynchronousFuture(null),
|
||||
'hi_IN': () => new SynchronousFuture(null),
|
||||
'hu_HU': () => new SynchronousFuture(null),
|
||||
'id_ID': () => new SynchronousFuture(null),
|
||||
'it_IT': () => new SynchronousFuture(null),
|
||||
'ja_JP': () => new SynchronousFuture(null),
|
||||
'ml_IN': () => new SynchronousFuture(null),
|
||||
'nl_NL': () => new SynchronousFuture(null),
|
||||
'pl_PL': () => new SynchronousFuture(null),
|
||||
'pt_BR': () => new SynchronousFuture(null),
|
||||
'pt_PT': () => new SynchronousFuture(null),
|
||||
'ru_RU': () => new SynchronousFuture(null),
|
||||
'tr_TR': () => new SynchronousFuture(null),
|
||||
'zh_CN': () => new SynchronousFuture(null),
|
||||
'zh_TW': () => new SynchronousFuture(null),
|
||||
};
|
||||
|
||||
MessageLookupByLibrary? _findExact(String localeName) {
|
||||
|
|
@ -120,18 +121,18 @@ MessageLookupByLibrary? _findExact(String localeName) {
|
|||
}
|
||||
|
||||
/// User programs should call this before using [localeName] for messages.
|
||||
Future<bool> initializeMessages(String localeName) async {
|
||||
Future<bool> initializeMessages(String localeName) {
|
||||
var availableLocale = Intl.verifiedLocale(
|
||||
localeName, (locale) => _deferredLibraries[locale] != null,
|
||||
onFailure: (_) => null);
|
||||
if (availableLocale == null) {
|
||||
return new Future.value(false);
|
||||
return new SynchronousFuture(false);
|
||||
}
|
||||
var lib = _deferredLibraries[availableLocale];
|
||||
await (lib == null ? new Future.value(false) : lib());
|
||||
lib == null ? new SynchronousFuture(false) : lib();
|
||||
initializeInternalMessageLookup(() => new CompositeMessageLookup());
|
||||
messageLookup.addLocale(availableLocale, _findGeneratedMessagesFor);
|
||||
return new Future.value(true);
|
||||
return new SynchronousFuture(true);
|
||||
}
|
||||
|
||||
bool _messagesExistFor(String locale) {
|
||||
|
|
|
|||
|
|
@ -32,9 +32,7 @@ mixin BuiltInTextWidgetMixin<T extends BuiltInTextWidget> on State<T>
|
|||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// TODO: customize
|
||||
const SizedBox(
|
||||
width: 20,
|
||||
),
|
||||
const SizedBox(width: 20),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
|
|
|
|||
|
|
@ -89,8 +89,7 @@ class SelectionMenuItem {
|
|||
Path insertPath,
|
||||
bool replaced,
|
||||
bool insertedBefore,
|
||||
)?
|
||||
updateSelection,
|
||||
)? updateSelection,
|
||||
}) {
|
||||
return SelectionMenuItem(
|
||||
name: name,
|
||||
|
|
|
|||
|
|
@ -344,4 +344,9 @@ class _AppFlowyInputState extends State<AppFlowyInput>
|
|||
void performSelector(String selectorName) {
|
||||
// TODO: implement performSelector
|
||||
}
|
||||
|
||||
@override
|
||||
void insertContent(KeyboardInsertedContent content) {
|
||||
// TODO: implement insertContent
|
||||
}
|
||||
}
|
||||
|
|
|
|||
18
pubspec.yaml
18
pubspec.yaml
|
|
@ -10,8 +10,8 @@ platforms:
|
|||
web:
|
||||
|
||||
environment:
|
||||
sdk: ">=2.19.0 <3.0.0"
|
||||
flutter: ">=3.7.0"
|
||||
sdk: ">=3.0.0 <4.0.0"
|
||||
flutter: ">=3.10.0"
|
||||
|
||||
dependencies:
|
||||
flutter:
|
||||
|
|
@ -19,13 +19,13 @@ dependencies:
|
|||
|
||||
rich_clipboard: ^1.0.0
|
||||
html: ^0.15.0
|
||||
flutter_svg: ^2.0.2
|
||||
provider: ^6.0.3
|
||||
url_launcher: ^6.1.5
|
||||
logging: ^1.0.2
|
||||
intl_utils: ^2.7.0
|
||||
flutter_svg: ^2.0.6
|
||||
provider: ^6.0.5
|
||||
url_launcher: ^6.1.11
|
||||
logging: ^1.2.0
|
||||
intl_utils: ^2.8.2
|
||||
intl: any
|
||||
markdown: ^7.0.1
|
||||
markdown: ^7.1.0
|
||||
flutter_localizations:
|
||||
sdk: flutter
|
||||
tuple: ^2.0.1
|
||||
|
|
@ -37,7 +37,7 @@ dev_dependencies:
|
|||
sdk: flutter
|
||||
flutter_lints: ^2.0.1
|
||||
network_image_mock: ^2.1.1
|
||||
mockito: ^5.3.2
|
||||
mockito: ^5.4.1
|
||||
|
||||
# For information on the generic Dart part of this file, see the
|
||||
# following page: https://dart.dev/tools/pub/pubspec
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
import 'package:appflowy_editor/appflowy_editor.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:mockito/mockito.dart';
|
||||
|
||||
class MockNode extends Mock implements Node {}
|
||||
import '../infra/test_editor.dart';
|
||||
|
||||
void main() {
|
||||
group('node_extension.dart', () {
|
||||
|
|
|
|||
Loading…
Reference in a new issue