refactor: format files with dartFmt
This commit is contained in:
parent
75ae842f4b
commit
4097c7c746
@ -27,4 +27,3 @@ class EditorState {
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -37,10 +37,7 @@ enum CommandName {
|
||||
INSERTIMAGE,
|
||||
INSERTCHECKBOX,
|
||||
// pseudo commands for toggling grouped command views
|
||||
ENTER_VIEWING_MODE,
|
||||
EXPANDING_SEARCH_VIEWING,
|
||||
TOGGLE_GROUPED_TEXT_STYLES_COMMANDS_VIEW,
|
||||
TOGGLE_GROUPED_INSERT_COMMANDS_COMMANDS_VIEW
|
||||
}
|
||||
|
||||
enum BarPosition { TOP, BOTTOM }
|
@ -17,7 +17,6 @@ class Family {
|
||||
fonts!.add(new Font.fromJson(v));
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
lang = json['lang'];
|
||||
variant = json['variant'];
|
||||
|
@ -1,148 +1 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rich_editor/src/models/button.dart';
|
||||
|
||||
import 'javascript_executor_base.dart';
|
||||
|
||||
List<Button> buttons = [
|
||||
Button(
|
||||
icon: Icons.format_bold,
|
||||
onTap: (JavascriptExecutorBase javascriptExecutorBase) async =>
|
||||
await javascriptExecutorBase.setBold(),
|
||||
),
|
||||
Button(
|
||||
icon: Icons.format_italic,
|
||||
onTap: (JavascriptExecutorBase javascriptExecutorBase) async =>
|
||||
await javascriptExecutorBase.setItalic(),
|
||||
),
|
||||
Button(
|
||||
icon: Icons.link,
|
||||
onTap: (JavascriptExecutorBase javascriptExecutorBase, String link, String title) async {
|
||||
await javascriptExecutorBase.insertLink(
|
||||
'https://github.com/JideGuru',
|
||||
'Sample',
|
||||
);
|
||||
},
|
||||
),
|
||||
Button(
|
||||
icon: Icons.image,
|
||||
onTap: (JavascriptExecutorBase javascriptExecutorBase) async {
|
||||
await javascriptExecutorBase.insertImage(
|
||||
'https://avatars.githubusercontent.com/u/24323581?v=4',
|
||||
alt: 'Jide',
|
||||
height: 200,
|
||||
width: 200,
|
||||
);
|
||||
},
|
||||
),
|
||||
Button(
|
||||
icon: Icons.format_underline,
|
||||
onTap: (JavascriptExecutorBase javascriptExecutorBase) async =>
|
||||
await javascriptExecutorBase.setUnderline(),
|
||||
),
|
||||
Button(
|
||||
icon: Icons.format_strikethrough,
|
||||
onTap: (JavascriptExecutorBase javascriptExecutorBase) async =>
|
||||
await javascriptExecutorBase.setStrikeThrough(),
|
||||
),
|
||||
Button(
|
||||
icon: Icons.superscript,
|
||||
onTap: (JavascriptExecutorBase javascriptExecutorBase) async =>
|
||||
await javascriptExecutorBase.setSuperscript(),
|
||||
),
|
||||
Button(
|
||||
icon: Icons.subscript,
|
||||
onTap: (JavascriptExecutorBase javascriptExecutorBase) async =>
|
||||
await javascriptExecutorBase.setSubscript(),
|
||||
),
|
||||
Button(
|
||||
icon: Icons.format_clear,
|
||||
onTap: (JavascriptExecutorBase javascriptExecutorBase) async =>
|
||||
await javascriptExecutorBase.removeFormat(),
|
||||
),
|
||||
Button(
|
||||
icon: Icons.undo,
|
||||
onTap: (JavascriptExecutorBase javascriptExecutorBase) async =>
|
||||
await javascriptExecutorBase.undo(),
|
||||
),
|
||||
Button(
|
||||
icon: Icons.redo,
|
||||
onTap: (JavascriptExecutorBase javascriptExecutorBase) async =>
|
||||
await javascriptExecutorBase.redo(),
|
||||
),
|
||||
Button(
|
||||
icon: Icons.format_quote,
|
||||
onTap: (JavascriptExecutorBase javascriptExecutorBase) async =>
|
||||
await javascriptExecutorBase.setBlockQuote(),
|
||||
),
|
||||
Button(
|
||||
icon: Icons.text_format,
|
||||
onTap: (JavascriptExecutorBase javascriptExecutorBase, String name) async =>
|
||||
await javascriptExecutorBase.setPreformat(),
|
||||
),
|
||||
Button(
|
||||
icon: Icons.font_download,
|
||||
onTap: (JavascriptExecutorBase javascriptExecutorBase, String name) async =>
|
||||
await javascriptExecutorBase.setFontName(name),
|
||||
),
|
||||
Button(
|
||||
icon: Icons.format_size,
|
||||
onTap: (JavascriptExecutorBase javascriptExecutorBase, int size) async =>
|
||||
await javascriptExecutorBase.setFontSize(size),
|
||||
),
|
||||
Button(
|
||||
icon: Icons.format_color_text,
|
||||
onTap: (JavascriptExecutorBase javascriptExecutorBase, Color color) async =>
|
||||
await javascriptExecutorBase.setTextColor(color),
|
||||
),
|
||||
Button(
|
||||
icon: Icons.format_color_fill,
|
||||
onTap: (JavascriptExecutorBase javascriptExecutorBase, Color color) async =>
|
||||
await javascriptExecutorBase.setTextBackgroundColor(color),
|
||||
),
|
||||
Button(
|
||||
icon: Icons.format_indent_increase,
|
||||
onTap: (JavascriptExecutorBase javascriptExecutorBase, int size) async =>
|
||||
await javascriptExecutorBase.setIndent(),
|
||||
),
|
||||
Button(
|
||||
icon: Icons.format_indent_decrease,
|
||||
onTap: (JavascriptExecutorBase javascriptExecutorBase) async =>
|
||||
await javascriptExecutorBase.setOutdent(),
|
||||
),
|
||||
Button(
|
||||
icon: Icons.format_align_left_outlined,
|
||||
onTap: (JavascriptExecutorBase javascriptExecutorBase) async =>
|
||||
await javascriptExecutorBase.setJustifyLeft(),
|
||||
),
|
||||
Button(
|
||||
icon: Icons.format_align_center,
|
||||
onTap: (JavascriptExecutorBase javascriptExecutorBase) async =>
|
||||
await javascriptExecutorBase.setJustifyCenter(),
|
||||
),
|
||||
Button(
|
||||
icon: Icons.format_align_right,
|
||||
onTap: (JavascriptExecutorBase javascriptExecutorBase) async =>
|
||||
await javascriptExecutorBase.setJustifyRight(),
|
||||
),
|
||||
Button(
|
||||
icon: Icons.format_align_justify,
|
||||
onTap: (JavascriptExecutorBase javascriptExecutorBase) async =>
|
||||
await javascriptExecutorBase.setJustifyFull(),
|
||||
),
|
||||
Button(
|
||||
icon: Icons.format_list_bulleted,
|
||||
onTap: (JavascriptExecutorBase javascriptExecutorBase) async =>
|
||||
await javascriptExecutorBase.insertBulletList(),
|
||||
),
|
||||
Button(
|
||||
icon: Icons.format_list_numbered,
|
||||
onTap: (JavascriptExecutorBase javascriptExecutorBase) async =>
|
||||
await javascriptExecutorBase.insertNumberedList(),
|
||||
),
|
||||
Button(
|
||||
icon: Icons.check_box_outlined,
|
||||
onTap: (JavascriptExecutorBase javascriptExecutorBase, String text) async =>
|
||||
await javascriptExecutorBase.insertCheckbox(text),
|
||||
),
|
||||
Button(icon: Icons.search),
|
||||
];
|
||||
|
@ -5,7 +5,6 @@ class CustomDialogTemplate extends StatelessWidget {
|
||||
final Function? onDone;
|
||||
final Function? onCancel;
|
||||
|
||||
|
||||
CustomDialogTemplate({this.body, this.onDone, this.onCancel});
|
||||
|
||||
@override
|
||||
|
Loading…
Reference in New Issue
Block a user