You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
965 B
38 lines
965 B
import 'package:flutter/material.dart'; |
|
// import 'text_editor.dart'; |
|
|
|
class TemplateParser extends StatefulWidget { |
|
final String? initialContent; |
|
|
|
const TemplateParser({Key? key, this.initialContent}) : super(key: key); |
|
|
|
@override |
|
State<TemplateParser> createState() => _TemplateParserState(); |
|
} |
|
|
|
class _TemplateParserState extends State<TemplateParser> { |
|
late String _currentContent; |
|
|
|
@override |
|
void initState() { |
|
super.initState(); |
|
_currentContent = widget.initialContent ?? '这里是模板解析器的初始内容'; |
|
} |
|
|
|
@override |
|
Widget build(BuildContext context) { |
|
return Card( |
|
margin: EdgeInsets.zero, |
|
color: Colors.grey[100], |
|
// child: TextEditor( |
|
// editorTitle: '模板解析器', |
|
// initialContent: _currentContent, |
|
// onContentChanged: (newContent) { |
|
// setState(() { |
|
// _currentContent = newContent; |
|
// }); |
|
// }, |
|
// ), |
|
); |
|
} |
|
}
|
|
|