rich_text_writer 0.0.5 rich_text_writer: ^0.0.5 copied to clipboard
A Rich text writer for Flutter.
import 'package:example/demos.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'RichTextWriter Example',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key});
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
int _demoIndex = 0;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
),
body: Container(
padding: const EdgeInsets.only(
top: 100,
left: 200,
right: 200,
),
alignment: Alignment.center,
child: demos[_demoIndex](context),
),
floatingActionButton: _demoIndex + 1 < demos.length
? FloatingActionButton.extended(
label: const Text('Next'),
onPressed: () {
setState(() {
_demoIndex++;
});
},
)
: null,
);
}
}