You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

68 lines
2.2 KiB

import 'package:flutter/material.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/view_widget/keyboard/custom_password_field_widget.dart';
import 'package:huixiang/view_widget/keyboard/keyboard_widget.dart';
import 'package:huixiang/view_widget/keyboard/pay_password.dart' as keyevent;
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class PayInputWidget extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _PayInputWidget();
}
}
class _PayInputWidget extends State<PayInputWidget> {
@override
Widget build(BuildContext context) {
var height = (MediaQuery.of(context).size.width - (20 * 7.0)) / 6.0;
return Scaffold(
appBar: MyAppBar(
title: S.of(context).shuruzhifumima,
titleSize: 14.sp,
titleColor: Color(0xFF353535),
background: Colors.white,
leadingColor: Colors.black,
),
body: Container(
color: Color(0xFFD5D7DD).withAlpha(237),
child: Column(
mainAxisSize: MainAxisSize.max,
children: [
Container(
width: double.infinity,
color: Color(0xFFE6E6E6),
height: height + 80,
padding: EdgeInsets.fromLTRB(16, 40, 16, 40),
child: CustomJPasswordField(password,),
),
Container(
child: MyKeyboard((event){
keyevent.KeyEvent keyEvent = event;
setState(() {
if (!keyEvent.isCommit() && !keyEvent.isDelete() && password.length < 6) {
setState(() {
password += (event as keyevent.KeyEvent).key;
});
} else {
if (keyEvent.isDelete() && password.length > 0) {
setState(() {
password = password.substring(0, password.length - 1);
});
} else if (keyEvent.isCommit() && password.length == 6) {
}
}
});
}),
),
],
),
),
);
}
var password = "";
}