Browse Source

更新订单搜索

tags/0.0.1
Weller 4 years ago
parent
commit
2b6c2f36bf
1 changed files with 39 additions and 20 deletions
  1. +39
    -20
      lib/pages/orders_page/order_search_page.dart

+ 39
- 20
lib/pages/orders_page/order_search_page.dart View File

@@ -1,7 +1,7 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.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_base_widget/widgets/empty/empty_widget.dart';
import 'package:zhiying_comm/zhiying_comm.dart';


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


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

@override @override
Widget build(BuildContext context) { 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, backgroundColor: Colors.white,
leading: Navigator.canPop(context) leading: Navigator.canPop(context)
? GestureDetector( ? 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(), : Container(),
middle: Container( middle: Container(
height: 32, height: 32,
@@ -68,6 +80,8 @@ class _OrderSearchPageState extends State<OrderSearchPage> {
placeholderStyle: TextStyle(color: Color(0xff999999), fontSize: 14), placeholderStyle: TextStyle(color: Color(0xff999999), fontSize: 14),
controller: _keywordController, controller: _keywordController,
style: TextStyle(fontSize: 14, color: Color(0xff333333)), style: TextStyle(fontSize: 14, color: Color(0xff333333)),
textInputAction: TextInputAction.search,
onSubmitted: _search,
), ),
), ),
trailing: Container( trailing: Container(
@@ -83,9 +97,14 @@ class _OrderSearchPageState extends State<OrderSearchPage> {
), ),
onPressed: () { onPressed: () {
Logger.debug(_keywordController.text); Logger.debug(_keywordController.text);
_search(_keywordController.text);
}, },
), ),
), ),
); );
} }

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

Loading…
Cancel
Save