feat: support Flutter stable channel (#581)

* feat: adjust toggle list block

* chore: upgrade Flutter to master channel

* chore: upgrade pbxproj

* fix: toolbar copy button not closing on mobile editor

* fix: formatting issues and add missing commas

* chore: add stable branch to GitHub Actions workflow

* chore: add missing trailing commas

* chore: adjust indentation padding in block component
configuration and unit tests
This commit is contained in:
Lucas.Xu 2023-11-08 13:46:33 +08:00 • committed by GitHub
commit c7d99913aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
65 changed files with 215 additions and 285 deletions

View file

@ -4,18 +4,17 @@ on:
push:
branches:
- "main"
- "stable"
pull_request:
branches:
- "main"
- "stable"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
FLUTTER_VERSION: "3.10.1"
# 3 jobs are configured.
# The first one runs tests on desktop OSs.
# The second runs tests on iOS simulator.
@ -34,11 +33,11 @@ jobs:
- uses: subosito/flutter-action@v2
with:
channel: "stable"
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true
- name: Run tests
run: |
flutter --version
flutter pub get
flutter analyze .
dart format --set-exit-if-changed .

4
.gitignore vendored
View file

@ -129,4 +129,6 @@ app.*.symbols
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
!/dev/ci/**/Gemfile.lock
!/dev/ci/**/Gemfile.lock
.fvm/

View file

@ -155,7 +155,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1300;
LastUpgradeCheck = 1430;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1430"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"

View file

@ -37,7 +37,7 @@ extension on ExportFileType {
}
class HomePage extends StatefulWidget {
const HomePage({Key? key}) : super(key: key);
const HomePage({super.key});
@override
State<HomePage> createState() => _HomePageState();

View file

@ -20,7 +20,7 @@ class _EditorListState extends State<EditorList> {
for (var i = 0; i < 100; i++) {
final document = Document.blank()
..insert([
0
0,
], [
headingNode(level: 3, delta: Delta()..insert('Heading $i')),
paragraphNode(

View file

@ -55,13 +55,17 @@ class _MobileEditorState extends State<MobileEditor> {
child: MobileFloatingToolbar(
editorState: editorState,
editorScrollController: editorScrollController,
toolbarBuilder: (context, anchor) {
toolbarBuilder: (context, anchor, closeToolbar) {
return AdaptiveTextSelectionToolbar.editable(
clipboardStatus: ClipboardStatus.pasteable,
onCopy: () => copyCommand.execute(editorState),
onCopy: () {
copyCommand.execute(editorState);
closeToolbar();
},
onCut: () => cutCommand.execute(editorState),
onPaste: () => pasteCommand.execute(editorState),
onSelectAll: () => selectAllCommand.execute(editorState),
onLiveTextInput: null,
anchors: TextSelectionToolbarAnchors(
primaryAnchor: anchor,
),

View file

@ -203,7 +203,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0920;
LastUpgradeCheck = 1300;
LastUpgradeCheck = 1430;
ORGANIZATIONNAME = "";
TargetAttributes = {
33CC10EC2044A3C60003C045 = {

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1430"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"

View file

@ -35,13 +35,13 @@ dependencies:
provider: ^6.0.3
url_launcher: ^6.1.5
path_provider: ^2.0.15
google_fonts: ^4.0.4
google_fonts: ^6.1.0
flutter_localizations:
sdk: flutter
file_picker: ^5.0.1
file_picker: ^6.1.1
universal_html: ^2.0.8
highlight: ^0.7.0
http: ^0.13.5
http: ^1.1.0
show_fps: ^1.0.6
dev_dependencies:
@ -53,7 +53,7 @@ dev_dependencies:
# activated in the `analysis_options.yaml` file located at the root of your
# package. See that file for information about deactivating specific lint
# rules and activating additional ones.
flutter_lints: ^2.0.1
flutter_lints: ^3.0.1
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

View file

@ -229,12 +229,11 @@ final class NodeV0 extends ChangeNotifier with LinkedListEntry<NodeV0> {
final class TextNodeV0 extends NodeV0 {
TextNodeV0({
required Delta delta,
LinkedList<NodeV0>? children,
super.children,
Attributes? attributes,
}) : _delta = delta,
super(
type: 'text',
children: children,
attributes: attributes ?? {},
);

View file

@ -71,9 +71,9 @@ EdgeInsets _padding(Node node) {
EdgeInsets _indentPadding(Node node, TextDirection textDirection) {
switch (textDirection) {
case TextDirection.ltr:
return const EdgeInsets.only(left: 30.0);
return const EdgeInsets.only(left: 24.0);
case TextDirection.rtl:
return const EdgeInsets.only(right: 30.0);
return const EdgeInsets.only(right: 24.0);
}
}

View file

@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
class NestedListWidget extends StatelessWidget {
const NestedListWidget({
super.key,
this.indentPadding = const EdgeInsets.only(left: 30),
this.indentPadding = const EdgeInsets.only(left: 28),
required this.child,
required this.children,
});

View file

@ -61,13 +61,13 @@ void showImageMenu(
class UploadImageMenu extends StatefulWidget {
const UploadImageMenu({
Key? key,
super.key,
this.backgroundColor = Colors.white,
this.headerColor = Colors.black,
this.width = 300,
required this.onSubmitted,
required this.onUpload,
}) : super(key: key);
});
final Color backgroundColor;
final Color headerColor;

View file

@ -5,7 +5,7 @@ import 'dart:math' as math;
class TableActionHandler extends StatefulWidget {
const TableActionHandler({
Key? key,
super.key,
this.visible = false,
this.height,
required this.node,
@ -15,7 +15,7 @@ class TableActionHandler extends StatefulWidget {
required this.transform,
required this.dir,
this.menuBuilder,
}) : super(key: key);
});
final bool visible;
final Node node;

View file

@ -2,13 +2,13 @@ import 'package:flutter/material.dart';
class TableActionButton extends StatefulWidget {
const TableActionButton({
Key? key,
super.key,
required this.width,
required this.height,
required this.padding,
required this.onPressed,
required this.icon,
}) : super(key: key);
});
final double width, height;
final EdgeInsetsGeometry padding;

View file

@ -8,14 +8,14 @@ import 'package:provider/provider.dart';
class TableCol extends StatefulWidget {
const TableCol({
Key? key,
super.key,
required this.tableNode,
required this.editorState,
required this.colIdx,
required this.borderColor,
required this.borderHoverColor,
this.menuBuilder,
}) : super(key: key);
});
final int colIdx;
final EditorState editorState;

View file

@ -5,14 +5,14 @@ import 'package:provider/provider.dart';
class TableColBorder extends StatefulWidget {
const TableColBorder({
Key? key,
super.key,
required this.tableNode,
required this.editorState,
required this.colIdx,
required this.resizable,
required this.borderColor,
required this.borderHoverColor,
}) : super(key: key);
});
final bool resizable;
final int colIdx;

View file

@ -6,14 +6,14 @@ import 'package:appflowy_editor/src/editor/block_component/table_block_component
class TableView extends StatefulWidget {
const TableView({
Key? key,
super.key,
required this.editorState,
required this.tableNode,
required this.addIcon,
required this.borderColor,
required this.borderHoverColor,
this.menuBuilder,
}) : super(key: key);
});
final EditorState editorState;
final TableNode tableNode;

View file

@ -63,14 +63,12 @@ class PageBlockComponent extends BlockComponentStatelessWidget {
return Column(
children: [
if (header != null) header!,
...items
.map(
(e) => Padding(
padding: editorState.editorStyle.padding,
child: editorState.renderer.build(context, e),
),
)
.toList(),
...items.map(
(e) => Padding(
padding: editorState.editorStyle.padding,
child: editorState.renderer.build(context, e),
),
),
if (footer != null) footer!,
],
);

Some files were not shown because too many files have changed in this diff Show more