* 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
71 lines
1.8 KiB
Dart
71 lines
1.8 KiB
Dart
import 'package:appflowy_editor/appflowy_editor.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
class EditorList extends StatefulWidget {
|
|
const EditorList({
|
|
super.key,
|
|
});
|
|
|
|
@override
|
|
State<EditorList> createState() => _EditorListState();
|
|
}
|
|
|
|
class _EditorListState extends State<EditorList> {
|
|
final List<Document> documents = [];
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
|
|
for (var i = 0; i < 100; i++) {
|
|
final document = Document.blank()
|
|
..insert([
|
|
0,
|
|
], [
|
|
headingNode(level: 3, delta: Delta()..insert('Heading $i')),
|
|
paragraphNode(
|
|
delta: Delta()
|
|
..insert('Paragraph $i: ')
|
|
..insert(
|
|
'formatted text',
|
|
attributes: {'bold': true, 'italic': true, 'underline': true},
|
|
),
|
|
),
|
|
]);
|
|
documents.add(document);
|
|
}
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
backgroundColor: Colors.black,
|
|
title: const Text('Editor List'),
|
|
titleTextStyle: const TextStyle(color: Colors.white),
|
|
iconTheme: const IconThemeData(
|
|
color: Colors.white,
|
|
),
|
|
),
|
|
body: SingleChildScrollView(
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: documents
|
|
.map(
|
|
(e) => [
|
|
AppFlowyEditor(
|
|
editorState: EditorState(document: e),
|
|
shrinkWrap: true,
|
|
editable: false,
|
|
),
|
|
const Divider(),
|
|
],
|
|
)
|
|
.expand((element) => element)
|
|
.toList(),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|