app-starlock/star_lock/lib/tools/showTFView.dart
Daisy 0de13dd926 1,编辑电子钥匙名字接口调试
2,密码钥匙列表接口调试
3,密码钥匙重置接口调试
4,国家地区接口调试及注册选择国家逻辑处理
2023-08-23 14:27:50 +08:00

108 lines
3.5 KiB
Dart

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import '../translations/trans_lib.dart';
class ShowTFView extends StatelessWidget {
String? title;
String? tipTitle;
TextEditingController? controller;
Function()? sureClick;
Function()? cancelClick;
ShowTFView(
{Key? key,
this.title,
this.tipTitle,
this.controller,
this.sureClick,
this.cancelClick})
: super(key: key);
@override
Widget build(BuildContext context) {
return Card(
color: const Color(0x00FFFFFF),
child: CupertinoAlertDialog(
title: Text(title!),
content: Column(
children: <Widget>[
const SizedBox(
height: 10,
),
Container(
height: 50.h,
// color: Colors.white,
// padding: EdgeInsets.only(left:20.w, right: 110.w),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(15.w)),
child: TextField(
//输入框一行
maxLines: 1,
controller: controller,
autofocus: false,
decoration: InputDecoration(
//输入里面输入文字内边距设置
contentPadding:
EdgeInsets.only(top: 20.h, left: 15.0, bottom: 13.h),
hintText: tipTitle,
hintStyle: TextStyle(fontSize: 28.sp),
//不需要输入框下划线
border: InputBorder.none,
//左边图标设置
// icon: Padding(
// padding: EdgeInsets.only(top:30.w, bottom: 20.w, right: 20.w, left: 20.w),
// child: Image.asset('images/main/icon_main_search.png', width: 40.w, height: 40.w,),
// ),
// //右边图标设置
// suffixIcon: GestureDetector(
// onTap: () {
// //addPostFrameCallback是 StatefulWidge 渲染结束的回调,只会被调用一次
// // SchedulerBinding.instance.addPostFrameCallback((_) {
// // _controller.text = "";
// // });
// },
// child: Padding(
// padding: EdgeInsets.all(8),
// child: Image.asset('images/main/icon_main_cell.png', width: 50.w, height: 50.w,),
// ),
// )
),
),
)
],
),
actions: <Widget>[
CupertinoDialogAction(
child: Text(
TranslationLoader.lanKeys!.cancel!.tr,
style: const TextStyle(color: Colors.black),
),
onPressed: () {
// Navigator.pop(context);
// print("取消");
if (cancelClick != null) {
cancelClick!();
}
},
),
CupertinoDialogAction(
child: Text(TranslationLoader.lanKeys!.sure!.tr,
style: const TextStyle(color: Colors.black)),
onPressed: () {
if (sureClick != null) {
sureClick!();
}
// Navigator.pop(context);
// print("确定");
},
),
],
),
);
}
}