feat:按回车进行搜索
This commit is contained in:
1 parent
4a61bf35e0
commit
34e8f3ddd6
5 files changed
+55
-8
No files matched your search
@@ -2,8 +2,13 @@ import 'package:ducafe_ui_core/ducafe_ui_core.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:forui/forui.dart';
|
||||
|
||||
Widget appPrice(BuildContext context, dynamic price) {
|
||||
Widget appPrice(
|
||||
BuildContext context,
|
||||
dynamic price, {
|
||||
TextStyle? textStyle,
|
||||
}) {
|
||||
final theme = FTheme.of(context);
|
||||
textStyle ??= theme.typography.xl;
|
||||
double? priceNum = price is double
|
||||
? price
|
||||
: double.tryParse(
|
||||
@@ -21,7 +26,7 @@ Widget appPrice(BuildContext context, dynamic price) {
|
||||
),
|
||||
Text(
|
||||
priceNum.toStringAsFixed(2),
|
||||
style: theme.typography.xl.copyWith(
|
||||
style: textStyle.copyWith(
|
||||
color: theme.colorScheme.error,
|
||||
height: 1,
|
||||
),
|
||||
|
||||
@@ -68,6 +68,7 @@ Widget orderSelectPanel(
|
||||
int total = 1,
|
||||
double widget = 0,
|
||||
num price = 0,
|
||||
num totalPrice = 0,
|
||||
int index = 0,
|
||||
double height = 50,
|
||||
showPlus = false,
|
||||
@@ -153,11 +154,21 @@ Widget orderSelectPanel(
|
||||
}
|
||||
},
|
||||
),
|
||||
Text(
|
||||
"${widget.toString()}/kg",
|
||||
style: theme.typography.base.copyWith(height: 1),
|
||||
textAlign: TextAlign.center,
|
||||
).center().width(textWidth.w).height(double.infinity).decorated(
|
||||
<Widget>[
|
||||
Text(
|
||||
"${widget.toString()}/kg",
|
||||
style: theme.typography.sm.copyWith(height: 1),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
appPrice(context, totalPrice, textStyle: theme.typography.sm),
|
||||
]
|
||||
.toColumn(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
)
|
||||
.width(textWidth.w)
|
||||
.height(double.infinity)
|
||||
.decorated(
|
||||
color: theme.colorScheme.secondary,
|
||||
borderRadius: theme.style.borderRadius / 2,
|
||||
),
|
||||
|
||||
Reference in new issue
Block a user