mirror of
https://github.com/foss42/apidash.git
synced 2025-08-06 05:32:26 +08:00
Widget refactoring
This commit is contained in:
@ -4,7 +4,7 @@ import 'package:markdown/markdown.dart' as md;
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import 'buttons.dart';
|
||||
|
||||
class CustomMarkdown extends StatefulWidget {
|
||||
class CustomMarkdown extends StatelessWidget {
|
||||
const CustomMarkdown({
|
||||
super.key,
|
||||
required this.data,
|
||||
@ -13,11 +13,6 @@ class CustomMarkdown extends StatefulWidget {
|
||||
final String data;
|
||||
final EdgeInsets padding;
|
||||
|
||||
@override
|
||||
State<CustomMarkdown> createState() => _CustomMarkdownState();
|
||||
}
|
||||
|
||||
class _CustomMarkdownState extends State<CustomMarkdown> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final mdStyleSheet = MarkdownStyleSheet(
|
||||
@ -25,9 +20,9 @@ class _CustomMarkdownState extends State<CustomMarkdown> {
|
||||
p: Theme.of(context).textTheme.titleMedium,
|
||||
);
|
||||
return Markdown(
|
||||
padding: widget.padding,
|
||||
padding: padding,
|
||||
styleSheet: mdStyleSheet,
|
||||
data: widget.data,
|
||||
data: data,
|
||||
selectable: true,
|
||||
extensionSet: md.ExtensionSet.gitHubFlavored,
|
||||
onTapLink: (text, href, title) {
|
||||
|
Reference in New Issue
Block a user