feat: added more editor settings

This commit is contained in:
jideguru 2021-06-03 00:37:45 +01:00
parent 9ce8ad2365
commit 75ae842f4b
3 changed files with 9 additions and 29 deletions

View File

@ -67,25 +67,17 @@ class _MyHomePageState extends State<MyHomePage> {
onSelected: (val) async { onSelected: (val) async {
switch (val) { switch (val) {
case 0: case 0:
{
String? html = await keyEditor.currentState?.getHtml(); String? html = await keyEditor.currentState?.getHtml();
print(html); print(html);
}
break; break;
case 1: case 1:
{
await keyEditor.currentState?.clear(); await keyEditor.currentState?.clear();
}
break; break;
case 2: case 2:
{
await keyEditor.currentState?.unFocus(); await keyEditor.currentState?.unFocus();
}
break; break;
case 3: case 3:
{
await keyEditor.currentState?.focus(); await keyEditor.currentState?.focus();
}
break; break;
} }
}, },

View File

@ -1,5 +1,3 @@
import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_html/flutter_html.dart'; import 'package:flutter_html/flutter_html.dart';
import 'package:path/path.dart'; import 'package:path/path.dart';
@ -21,7 +19,8 @@ class FontsDialog extends StatelessWidget {
children: [ children: [
for (SystemFont font in getSystemFonts()) for (SystemFont font in getSystemFonts())
InkWell( InkWell(
child: Html(data: '<p style="font-family:${font.name}">' child: Html(
data: '<p style="font-family:${font.name}">'
'${basename(font.path!)}</p>'), '${basename(font.path!)}</p>'),
onTap: () { onTap: () {
Navigator.pop(context, font.name); Navigator.pop(context, font.name);

View File

@ -1,12 +1 @@
import 'package:flutter_test/flutter_test.dart'; void main() {}
import 'package:rich_editor/rich_editor.dart';
void main() {
// test('adds one to input values', () {
// final calculator = Calculator();
// expect(calculator.addOne(2), 3);
// expect(calculator.addOne(-7), -6);
// expect(calculator.addOne(0), 1);
// });
}