2,新增修改绑定手机号/邮箱 3,新增获取安全信息列表接口 4,新增获取已设置的安全信息接口 5,新增设置安全信息接口 6,新增获取解绑手机号Token 7,新增获取解绑邮箱Token
118 lines
2.9 KiB
Dart
118 lines
2.9 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
import 'package:star_lock/app_settings/app_colors.dart';
|
|
|
|
class AlertBottomWidget extends StatelessWidget {
|
|
List<String> items;
|
|
ValueChanged<int> chooseCallback;
|
|
String topTitle;
|
|
|
|
AlertBottomWidget(
|
|
{Key? key,
|
|
required this.items,
|
|
required this.chooseCallback,
|
|
required this.topTitle})
|
|
: super(key: key);
|
|
|
|
List<Widget> itemsWidget(context) {
|
|
List<Widget> list = [];
|
|
|
|
if (topTitle.isNotEmpty) {
|
|
list.add(Container(
|
|
padding: const EdgeInsets.only(top: 18, bottom: 18),
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
Text(
|
|
topTitle,
|
|
style: TextStyle(
|
|
color: Colors.black,
|
|
fontWeight: FontWeight.w500,
|
|
fontSize: ScreenUtil().setSp(24)),
|
|
),
|
|
// const SizedBox(
|
|
// height: 4,
|
|
// ),
|
|
// Text(
|
|
// subTitle,
|
|
// style: TextStyle(
|
|
// color: AppColors.darkGrayTextColor,
|
|
// fontSize: ScreenUtil().setSp(24)),
|
|
// )
|
|
],
|
|
),
|
|
));
|
|
|
|
list.add(
|
|
Container(
|
|
color: AppColors.greyBackgroundColor,
|
|
height: 8,
|
|
),
|
|
);
|
|
}
|
|
|
|
for (int i = 0; i < items.length; i++) {
|
|
list.add(
|
|
SizedBox(
|
|
width: ScreenUtil().screenWidth,
|
|
child: TextButton(
|
|
style: ButtonStyle(
|
|
overlayColor: MaterialStateProperty.all<Color>(Colors.white)),
|
|
child: Text(
|
|
items[i],
|
|
style: TextStyle(
|
|
color: Colors.black, fontSize: ScreenUtil().setSp(22)),
|
|
),
|
|
onPressed: () {
|
|
Navigator.pop(context);
|
|
chooseCallback(i);
|
|
},
|
|
),
|
|
),
|
|
);
|
|
list.add(const Divider(
|
|
height: 1,
|
|
));
|
|
}
|
|
|
|
list.add(
|
|
Container(
|
|
color: AppColors.greyBackgroundColor,
|
|
height: 8,
|
|
),
|
|
);
|
|
|
|
list.add(SizedBox(
|
|
width: ScreenUtil().screenWidth,
|
|
child: TextButton(
|
|
style: ButtonStyle(
|
|
overlayColor: MaterialStateProperty.all<Color>(Colors.white)),
|
|
child: Text(
|
|
'取消',
|
|
style:
|
|
TextStyle(color: Colors.black, fontSize: ScreenUtil().setSp(24)),
|
|
),
|
|
onPressed: () {
|
|
Navigator.pop(context);
|
|
},
|
|
),
|
|
));
|
|
return list;
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
width: double.infinity,
|
|
decoration: BoxDecoration(
|
|
color: Colors.white,
|
|
borderRadius: BorderRadius.circular(10),
|
|
),
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: itemsWidget(context),
|
|
),
|
|
);
|
|
}
|
|
}
|