Bladeren bron

更新订单搜索

tags/0.0.1
Weller 4 jaren geleden
bovenliggende
commit
2b6c2f36bf
1 gewijzigde bestanden met toevoegingen van 39 en 20 verwijderingen
  1. +39
    -20
      lib/pages/orders_page/order_search_page.dart

+ 39
- 20
lib/pages/orders_page/order_search_page.dart Bestand weergeven

@@ -1,7 +1,7 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:zhiying_comm/zhiying_comm.dart';
import 'package:zhiying_base_widget/widgets/empty/empty_widget.dart';
import 'package:zhiying_comm/zhiying_comm.dart';

// 订单搜索页面
class OrderSearchPage extends StatefulWidget {
@@ -18,14 +18,26 @@ class _OrderSearchPageState extends State<OrderSearchPage> {
super.initState();
}

@override
void dispose() {
_keywordController.dispose();
super.dispose();
}

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: _createNav(),
body: SafeArea(
child: Container(width: double.infinity,
height: double.infinity,
child: Center(child: EmptyWidget())),
return GestureDetector(
onTap: () {
FocusScope.of(context).requestFocus(FocusNode());
},
child: Scaffold(
appBar: _createNav(),
body: SafeArea(
child: Container(
width: double.infinity,
height: double.infinity,
child: Center(child: EmptyWidget())),
),
),
);
}
@@ -42,19 +54,19 @@ class _OrderSearchPageState extends State<OrderSearchPage> {
backgroundColor: Colors.white,
leading: Navigator.canPop(context)
? GestureDetector(
child: Container(
padding: EdgeInsets.zero,
child: Icon(
Icons.arrow_back_ios,
size: 20,
),
),
onTap: () {
if (Navigator.canPop(context)) {
Navigator.pop(context);
}
},
)
child: Container(
padding: EdgeInsets.zero,
child: Icon(
Icons.arrow_back_ios,
size: 20,
),
),
onTap: () {
if (Navigator.canPop(context)) {
Navigator.pop(context);
}
},
)
: Container(),
middle: Container(
height: 32,
@@ -68,6 +80,8 @@ class _OrderSearchPageState extends State<OrderSearchPage> {
placeholderStyle: TextStyle(color: Color(0xff999999), fontSize: 14),
controller: _keywordController,
style: TextStyle(fontSize: 14, color: Color(0xff333333)),
textInputAction: TextInputAction.search,
onSubmitted: _search,
),
),
trailing: Container(
@@ -83,9 +97,14 @@ class _OrderSearchPageState extends State<OrderSearchPage> {
),
onPressed: () {
Logger.debug(_keywordController.text);
_search(_keywordController.text);
},
),
),
);
}

void _search(String keyword) {
FocusScope.of(context).requestFocus(FocusNode());
}
}

Laden…
Annuleren
Opslaan