TextArea 文本域
代码演示
import 'package:antd_flutter_example/demo_block.dart';
import 'package:flutter/widgets.dart';
import 'package:trionesdev_antd_mobile/trionesdev_antd_mobile.dart';
class TextAreaPage extends StatefulWidget {
const TextAreaPage({super.key});
@override
State<StatefulWidget> createState() => _TextAreaPageState();
}
class _TextAreaPageState extends State<TextAreaPage> {
@override
Widget build(BuildContext context) {
return AntScaffold(
appBar: AntAppBar(title: const Text("TextArea 文本域")),
body: SingleChildScrollView(child: Column(children: [
DemoBlock(title: "基本用法", child: Column(children: [
AntTextArea()
]),),
DemoBlock(title: "最大行数", child: Column(children: [
AntTextArea(maxLines: 5,)
]),)
],),),
);
}
}
API
属性 | 说明 | 类型 | 默认值 |
---|---|---|---|
style | 样式 | StateStyle | - |
decoration | 边框样式,优先级别高于 style | BoxDecoration | - |
value | 输入框的值 | String | - |
onChange | 变化回调 | Function(String val) | - |
minLines | 最小行数 | int | 2 |
maxLines | 最大行数 | int | - |
onBlur | 失去焦点回调 | Function() | - |
onFocus | 获得焦点回调 | Function() | - |