Commit ac4c07fb authored by skeyboy's avatar skeyboy

订阅修改、登录页输入框键盘样式优化

parent e795f058
class MultiClickUtil {
const MultiClickUtil._();
static DateTime? _lastClickTime;
/*
* 判断是否为重复点击
* 可用于Gesture的onTap函数中拦截
* */
static bool isMultiClick({int intervalMilliseconds = 500}) {
if (_lastClickTime == null ||
DateTime.now().difference(_lastClickTime!) >
Duration(milliseconds: intervalMilliseconds)) {
_lastClickTime = DateTime.now();
return false;
} else {
return true;
}
}
}
......@@ -7,3 +7,4 @@ export 'iconfont.dart';
export 'date.dart';
export 'logger.dart';
export 'loading.dart';
export 'multi_click_util.dart';
......@@ -195,39 +195,40 @@ class PayItemWidget extends GetView<AndroidPayListController> {
Obx(
() => Container(
width: Get.width,
height: 150,
margin: const EdgeInsets.all(10),
child: ListView(
shrinkWrap: true,
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
children: controller.state.items
.map((element) => Container(
margin: const EdgeInsets.only(right: 20),
child: InkWell(
borderRadius: BorderRadius.circular(10),
onTap: () {
/// 增加选中事件
controller.state.setSelectedItem = element;
Vibrate.feedback(FeedbackType.impact);
},
child: Ink(
padding: const EdgeInsets.symmetric(
horizontal: 15, vertical: 20),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
// border: ,Color.argb(255, 62, 67, 95)
border: Border.all(
width: 1,
color: (controller.state.selectedItem
.id ??
0) ==
(element.id ?? 0)
? const Color.fromARGB(0, 0, 0, 0)
: const Color.fromARGB(
255, 90, 82, 91)),
gradient: LinearGradient(
colors:
(controller.state.selectedItem.id ??
child: IntrinsicHeight(
child: Row(
children: controller.state.items.reversed
.map((element) => Container(
margin: const EdgeInsets.only(right: 10),
child: InkWell(
borderRadius: BorderRadius.circular(10),
onTap: () {
/// 增加选中事件
controller.state.setSelectedItem = element;
Vibrate.feedback(FeedbackType.impact);
},
child: Ink(
padding: const EdgeInsets.symmetric(
horizontal: 5, vertical: 10),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
// border: ,Color.argb(255, 62, 67, 95)
border: Border.all(
width: 1,
color: (controller.state
.selectedItem.id ??
0) ==
(element.id ?? 0)
? const Color.fromARGB(
0, 0, 0, 0)
: const Color.fromARGB(
255, 90, 82, 91)),
gradient: LinearGradient(
colors: (controller.state.selectedItem
.id ??
0) ==
(element.id ?? 0)
? [
......@@ -243,74 +244,100 @@ class PayItemWidget extends GetView<AndroidPayListController> {
Color(0xFF333450),
Color(0xFF2b2b4d)
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
)),
child: Column(
children: [
Text(
element.goodsName!,
style: TextStyle(
fontWeight: FontWeight.bold,
color: controller.state.selectedItem.id ==
element.id
? Color.fromARGB(255, 23, 17, 7)
: Colors.white),
),
Text(
'¥${element.amount!}',
style: TextStyle(
fontWeight: FontWeight.bold,
color: controller.state.selectedItem.id ==
element.id
? Color.fromARGB(255, 230, 31, 32)
: Color.fromARGB(
255, 241, 197, 131)),
),
Container(
width: Get.width * 0.6,
child: Text(
element.goodsDesc!,
style: TextStyle(
fontWeight: FontWeight.bold,
color: controller.state.selectedItem.id ==
element.id
? Color.fromARGB(255, 230, 31, 32)
: Color.fromARGB(
255, 241, 197, 131)),
),
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
)),
child: Column(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Text(
element.goodsName!,
style: TextStyle(
fontWeight: FontWeight.bold,
color: controller.state
.selectedItem.id ==
element.id
? Color.fromARGB(
255, 23, 17, 7)
: Colors.white),
),
Text(
'¥${element.amount!}',
style: TextStyle(
fontWeight: FontWeight.bold,
color: controller.state
.selectedItem.id ==
element.id
? const Color.fromARGB(
255, 230, 31, 32)
: const Color.fromARGB(
255, 241, 197, 131)),
),
Container(
width: Get.width / 3.5,
child: Column(
children: element.goodsDesc!
.split('、')
.map((e) => Text(
e,
textAlign:
TextAlign.center,
style: TextStyle(
fontWeight:
FontWeight.bold,
color: controller
.state
.selectedItem
.id ==
element.id
? const Color
.fromARGB(
255,
230,
31,
32)
: const Color
.fromARGB(
255,
241,
197,
131)),
))
.toList(),
),
),
// Text(
// '¥${(double.parse(element.goodsDesc!) * 1.2).toStringAsFixed(2)}',
// style: TextStyle(
// color:
// Color.fromARGB(255, 140, 145, 151),
// decoration: TextDecoration.combine([
// // TextDecoration.underline,
// TextDecoration.lineThrough
// ]),
// ),
// ),
// Text('限时特惠',
// style: TextStyle(
// color: controller.state.selectedItem ==
// element.id
// ? Color.fromARGB(255, 230, 31, 32)
// : Color.fromARGB(
// 255, 169, 171, 196),
// decoration: TextDecoration.combine([
// // TextDecoration.underline,
// // TextDecoration.lineThrough
// ]),
// ))
],
),
// Text(
// '¥${(double.parse(element.goodsDesc!) * 1.2).toStringAsFixed(2)}',
// style: TextStyle(
// color:
// Color.fromARGB(255, 140, 145, 151),
// decoration: TextDecoration.combine([
// // TextDecoration.underline,
// TextDecoration.lineThrough
// ]),
// ),
// ),
// Text('限时特惠',
// style: TextStyle(
// color: controller.state.selectedItem ==
// element.id
// ? Color.fromARGB(255, 230, 31, 32)
// : Color.fromARGB(
// 255, 169, 171, 196),
// decoration: TextDecoration.combine([
// // TextDecoration.underline,
// // TextDecoration.lineThrough
// ]),
// ))
],
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
),
),
),
),
))
.toList(),
))
.toList(),
),
),
),
),
),
......@@ -344,7 +371,7 @@ class PayItemWidget extends GetView<AndroidPayListController> {
Image(
width: 40,
image: Image.asset(
'assets/images/account_header.png')
'assets/images/account_header.png')
.image),
SizedBox(
width: 10,
......@@ -359,7 +386,7 @@ class PayItemWidget extends GetView<AndroidPayListController> {
decoration: BoxDecoration(
color: Color.fromARGB(255, 53, 45, 55),
borderRadius:
BorderRadius.all(Radius.circular(40))),
BorderRadius.all(Radius.circular(40))),
// diamond
child: Row(
children: [
......@@ -415,7 +442,7 @@ class PayItemWidget extends GetView<AndroidPayListController> {
decoration: const BoxDecoration(
color: Color.fromARGB(255, 53, 45, 55),
borderRadius:
BorderRadius.all(Radius.circular(40))),
BorderRadius.all(Radius.circular(40))),
// diamond
child: Row(
children: const [
......@@ -472,7 +499,7 @@ class PayItemWidget extends GetView<AndroidPayListController> {
decoration: const BoxDecoration(
color: Color.fromARGB(255, 53, 45, 55),
borderRadius:
BorderRadius.all(Radius.circular(40))),
BorderRadius.all(Radius.circular(40))),
// diamond
child: Row(
children: const [
......@@ -514,7 +541,6 @@ class PayItemWidget extends GetView<AndroidPayListController> {
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
......
......@@ -641,7 +641,7 @@ class SignInPage extends GetView<SignInController> {
children: [
TextFormField(
controller: controller.mobileMemberController,
keyboardType: TextInputType.emailAddress,
keyboardType: TextInputType.phone,
textInputAction: TextInputAction.next,
cursorColor: kPrimaryColor,
onSaved: (email) {},
......@@ -658,6 +658,7 @@ class SignInPage extends GetView<SignInController> {
vertical: defaultPadding),
child: TextFormField(
controller: controller.codeController,
keyboardType: TextInputType.number,
textInputAction: TextInputAction.done,
obscureText: true,
cursorColor: kPrimaryColor,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment