107 lines
3.6 KiB
Dart
107 lines
3.6 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
///修改昵称弹窗
|
|
class ChangeNicknameDialog extends StatefulWidget {
|
|
final Function onTap;
|
|
|
|
const ChangeNicknameDialog({super.key, required this.onTap});
|
|
|
|
@override
|
|
State<ChangeNicknameDialog> createState() => _ChangeNicknameDialogState();
|
|
}
|
|
|
|
class _ChangeNicknameDialogState extends State<ChangeNicknameDialog> {
|
|
final TextEditingController _textController = TextEditingController();
|
|
String redemptionCode = "";
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Material(
|
|
type: MaterialType.transparency, //透明类型
|
|
color: Color(0x1A000000),
|
|
child: Center(
|
|
child: Container(
|
|
width: 296,
|
|
decoration: BoxDecoration(
|
|
color: Color(0xFF202530),
|
|
borderRadius: BorderRadius.circular(11),
|
|
),
|
|
child: Stack(
|
|
children: [
|
|
Positioned(
|
|
right: 11,
|
|
top: 11,
|
|
child: GestureDetector(
|
|
onTap: () {
|
|
Navigator.pop(context);
|
|
},
|
|
child: Image(
|
|
width: 16,
|
|
height: 16,
|
|
image: AssetImage('assets/images/ic_cross.png'),
|
|
),
|
|
),
|
|
),
|
|
Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
Container(
|
|
alignment: Alignment.center,
|
|
margin: EdgeInsets.only(top: 29),
|
|
child: Text(
|
|
"修改昵称",
|
|
style: TextStyle(fontSize: 16, color: Color(0xFFD6D6D7)),
|
|
),
|
|
),
|
|
Container(
|
|
width: 220,
|
|
height: 34,
|
|
alignment: Alignment.center,
|
|
margin: EdgeInsets.only(top: 29),
|
|
decoration: const BoxDecoration(
|
|
color: Color(0xFF111319),
|
|
borderRadius: BorderRadius.all(
|
|
Radius.circular(11),
|
|
)),
|
|
child: TextField(
|
|
textAlign: TextAlign.center,
|
|
controller: _textController,
|
|
cursorColor: Color(0xFF074CE7),
|
|
style: TextStyle(fontSize: 11, color: Colors.white),
|
|
decoration: InputDecoration(
|
|
border: InputBorder.none,
|
|
hintText: '请输入新的昵称',
|
|
hintStyle: TextStyle(fontSize: 11, color: Color(0xFF44474F)),
|
|
),
|
|
),
|
|
),
|
|
GestureDetector(
|
|
onTap: () {
|
|
Navigator.pop(context);
|
|
widget.onTap(_textController.text);
|
|
},
|
|
child: Container(
|
|
width: 102,
|
|
height: 32,
|
|
alignment: Alignment.center,
|
|
margin: EdgeInsets.only(top: 34, bottom: 17),
|
|
decoration: BoxDecoration(
|
|
color: Color(0xFF074CE7),
|
|
borderRadius: BorderRadius.all(Radius.circular(18)),
|
|
),
|
|
child: Text(
|
|
"修改",
|
|
style: TextStyle(fontSize: 13, color: Colors.white),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|