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