remodl_rte 1.0.6 remodl_rte: ^1.0.6 copied to clipboard
HTML editor for Flutter (WYSIWYG, rich text) with built-in speech-to-text and custom features for Remodl.
import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:remodl_rte/remodl_rte.dart';
import 'fullscreen.dart';
void main() {
WidgetsFlutterBinding.ensureInitialized();
runApp(const HtmlEditorExampleApp());
}
class HtmlEditorExampleApp extends StatelessWidget {
const HtmlEditorExampleApp({Key? key}) : super(key: key);
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Rich Text with Dictation',
debugShowCheckedModeBanner: false,
scrollBehavior: MyCustomScrollBehavior(),
theme: ThemeData(),
darkTheme: ThemeData.dark(),
themeMode: ThemeMode.light,
home: const Fullscreen(),
);
}
}
class HtmlEditorExample extends StatefulWidget {
const HtmlEditorExample({Key? key, required this.title}) : super(key: key);
final String title;
@override
State<HtmlEditorExample> createState() => _HtmlEditorExampleState();
}
class _HtmlEditorExampleState extends State<HtmlEditorExample> {
String result = '';
final HtmlEditorController controller = HtmlEditorController();
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () {
if (!kIsWeb) {
controller.clearFocus();
}
},
child: const Fullscreen());
}
}
class MyCustomScrollBehavior extends MaterialScrollBehavior {
// Override behavior methods and getters like dragDevices
@override
Set<PointerDeviceKind> get dragDevices => {
PointerDeviceKind.touch,
PointerDeviceKind.mouse,
};
}