效果如下
代码
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:trade_app/base/baseColor.dart';
import 'package:trade_app/base/baseSize.dart';
import 'package:trade_app/base/baseTextStyle.dart';
import 'package:trade_app/pages/utils/icon_utils.dart';
class FavoritesAlertView extends StatefulWidget {
final titleName;
final contentText;
final Function clearAction;
final ValueChanged<String> sureAction;
const FavoritesAlertView(
this.titleName,
this.contentText,
this.clearAction,
this.sureAction,
) : assert(titleName != null, 'title不能为空'),
assert(contentText != null, 'title不能为空');
@override
FavoritesAlertViewState createState() => FavoritesAlertViewState();
}
class FavoritesAlertViewState extends State<FavoritesAlertView> {
final myController = TextEditingController(); //输入监听
String foldName = '';
@override
void dispose() {
myController.dispose();
super.dispose();
}
@override
void initState() {
super.initState();
myController.text = widget.contentText;
foldName = widget.contentText;
}
@override
Widget build(BuildContext context) {
return