Parcourir la source

更新订单搜索

tags/0.0.1
Weller il y a 4 ans
Parent
révision
2b6c2f36bf
1 fichiers modifiés avec 39 ajouts et 20 suppressions
  1. +39
    -20
      lib/pages/orders_page/order_search_page.dart

+ 39
- 20
lib/pages/orders_page/order_search_page.dart Voir le fichier

@@ -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());
}
}

Chargement…
Annuler
Enregistrer