-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
自定义插件中使用TextField,输入文字后不能删除 #112
Comments
请提供下包括Flutter版本的更多信息。并附上一个能复现问题的代码。 |
------版本信息------- ------自定义插件------ class FlutterUmeKitProxy extends StatefulWidget implements Pluggable {
FlutterUmeKitProxy({Key? key, required this.appKey, required this.setProxy});
GlobalKey appKey;
Function setProxy;
@override
_FlutterUmeKitProxyState createState() => _FlutterUmeKitProxyState();
@override
Widget? buildWidget(BuildContext? context) => this; // 返回插件面板
@override
String get name => 'Proxy'; // 插件名称
@override
String get displayName => 'Proxy';
@override
void onTrigger() {} // 点击插件面板图标时调用
@override
ImageProvider<Object> get iconImageProvider => const NetworkImage(
'xxx'); // 插件图标
}
class _FlutterUmeKitProxyState extends State<FlutterUmeKitProxy> {
String proxyAddress = '';
@override
Widget build(BuildContext context) {
return Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
alignment: Alignment.bottomCenter,
child: Container(
color: Colors.white,
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height / 2.0,
alignment: Alignment.topCenter,
padding: const EdgeInsets.all(10),
child: Column(
children: [
TextField(
onChanged: (text) {
print('=========change=======');
setState(() {
proxyAddress = text;
});
},
cursorColor: const Color(0xff000000),
style: TextStyle(color: Color(0xff000000)),
),
ElevatedButton(
child: const Text("确认代理"),
onPressed: () {
widget.setProxy(proxyAddress);
// (widget.appKey.currentState as dynamic).reStart();
},
),
],
)),
);
}
}
然后输入框能够输入,但是不能删除输入的字符 |
我也碰到了,请问有解决此问题吗? @Zhaoiii |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
自定义插件中使用TextField,输入文字后不能删除
flutter_ume: ^1.1.2
The text was updated successfully, but these errors were encountered: