feat: optimize

This commit is contained in:
louis 2024-03-29 13:38:56 +08:00
parent 4c13315bb2
commit 88be83aceb
4 changed files with 20 additions and 20 deletions

View File

@ -160,7 +160,7 @@ class InventoryInoutCard extends StatelessWidget {
Widget buildContent() { Widget buildContent() {
return Column( return Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Row(
@ -178,6 +178,7 @@ class InventoryInoutCard extends StatelessWidget {
buildInOrOut() buildInOrOut()
], ],
), ),
Spacer(),
Text( Text(
controller.list[ind][index].product?.company?.name ?? '-', controller.list[ind][index].product?.company?.name ?? '-',
style: TextStyle( style: TextStyle(
@ -192,7 +193,7 @@ class InventoryInoutCard extends StatelessWidget {
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
'项目: ${controller.list[ind][index].project?.name}', '${controller.list[ind][index].project?.name}',
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: ScreenAdaper.height(20)), fontSize: ScreenAdaper.height(20)),
@ -207,17 +208,17 @@ class InventoryInoutCard extends StatelessWidget {
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
'数量: ${controller.list[ind][index].quantity} ${controller.list[ind][index].product?.unit?.label ?? '-'}', '${controller.list[ind][index].quantity} ${controller.list[ind][index].product?.unit?.label ?? '-'}',
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: ScreenAdaper.height(25)), fontSize: ScreenAdaper.height(20)),
), ),
), ),
Text( Text(
controller.list[ind][index].agent ?? '-', controller.list[ind][index].agent ?? '-',
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: ScreenAdaper.height(25)), fontSize: ScreenAdaper.height(20)),
), ),
], ],
) )

View File

@ -174,16 +174,17 @@ class LoginScreen extends StatelessWidget {
Widget buildUserNameInput() { Widget buildUserNameInput() {
return TextFormField( return TextFormField(
// //
keyboardType: TextInputType.text, // keyboardType: TextInputType.url,
decoration: InputDecoration( decoration: InputDecoration(
prefixIcon: Icon( prefixIcon: Icon(
Icons.person_2_outlined, Icons.person_2_outlined,
size: ScreenAdaper.height(40), size: ScreenAdaper.height(40),
), ),
errorStyle: TextStyle(fontSize: ScreenAdaper.height(20)), errorStyle: TextStyle(fontSize: ScreenAdaper.height(20)),
// contentPadding: EdgeInsets.symmetric( contentPadding: EdgeInsets.symmetric(
// horizontal: ScreenAdaper.width(30), vertical: ScreenAdaper.height(10),
// vertical: ScreenAdaper.height(10)), horizontal: ScreenAdaper.width(30),
),
hintText: '用户名', hintText: '用户名',
hintStyle: TextStyle(fontSize: ScreenAdaper.height(25)), hintStyle: TextStyle(fontSize: ScreenAdaper.height(25)),
border: InputBorder.none, border: InputBorder.none,

View File

@ -138,14 +138,14 @@ class InventorySearch extends StatelessWidget {
2: FlexColumnWidth(ScreenAdaper.screenShortDistance() / 4), 2: FlexColumnWidth(ScreenAdaper.screenShortDistance() / 4),
3: MinColumnWidth( 3: MinColumnWidth(
FixedColumnWidth( FixedColumnWidth(
ScreenAdaper.screenShortDistance() / 8), ScreenAdaper.screenShortDistance() / 5),
FixedColumnWidth( FixedColumnWidth(
ScreenAdaper.screenShortDistance() / 8)), ScreenAdaper.screenShortDistance() / 5)),
4: MinColumnWidth( 4: MinColumnWidth(
FixedColumnWidth( FixedColumnWidth(
ScreenAdaper.screenShortDistance() / 8), ScreenAdaper.screenShortDistance() / 6),
FixedColumnWidth( FixedColumnWidth(
ScreenAdaper.screenShortDistance() / 8)), ScreenAdaper.screenShortDistance() / 6)),
}, children: [ }, children: [
// table header // table header
TableRow( TableRow(
@ -270,10 +270,11 @@ class InventorySearch extends StatelessWidget {
} }
if (onInventorySelected != null) onInventorySelected!(itemData); if (onInventorySelected != null) onInventorySelected!(itemData);
}, },
child: Container( child: AbsorbPointer(
constraints: BoxConstraints(minHeight: ScreenAdaper.height(80)), child: Container(
alignment: alignment ?? Alignment.centerLeft, constraints: BoxConstraints(minHeight: ScreenAdaper.height(80)),
child: child), alignment: alignment ?? Alignment.centerLeft,
child: child)),
), ),
); );
} }

View File

@ -43,9 +43,6 @@ class ZtSearchSelect<T> extends StatelessWidget {
return TextFormField( return TextFormField(
focusNode: focusNode, focusNode: focusNode,
controller: _, controller: _,
onTapOutside: (event) {
FocusScope.of(context).unfocus();
},
decoration: InputDecoration( decoration: InputDecoration(
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderSide: const BorderSide( borderSide: const BorderSide(