From 2464c39a7a24990fd8321c1b4d8d65106e51b83a Mon Sep 17 00:00:00 2001 From: "sanfan.hx" Date: Mon, 14 Jan 2019 14:36:04 +0800 Subject: [PATCH] temp --- lib/components/pagination.dart | 2 +- lib/components/search_input.dart | 36 +++++++++++++++++++++++++++++++- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/lib/components/pagination.dart b/lib/components/pagination.dart index 2793882d..474d239e 100644 --- a/lib/components/pagination.dart +++ b/lib/components/pagination.dart @@ -24,7 +24,7 @@ class Pagination extends StatelessWidget { {'image': 'https://img.alicdn.com/tfs/TB1W4hMAwHqK1RjSZJnXXbNLpXa-519-260.jpg', 'type': 0, 'id': 9695909, 'url': 'https://www.zhihu.com/question/294145797/answer/551162834', 'title': '为什么阿里巴巴、腾讯和 Google 之类的企业都在使用 Flutter 开发 App?'}, {'image': 'https://img.alicdn.com/tfs/TB1XmFIApzqK1RjSZSgXXcpAVXa-720-338.jpg', 'type': 0, 'id': 9695859, 'url': 'https://zhuanlan.zhihu.com/p/51696594', 'title': 'Flutter 1.0 正式发布: Google 的便携 UI 工具包'}, {'image': 'https://img.alicdn.com/tfs/TB1mClCABLoK1RjSZFuXXXn0XXa-600-362.jpg', 'type': 0, 'id': 96956491409, 'url':'https://zhuanlan.zhihu.com/p/53497167','title': 'Flutter 示范应用现已开源 — 万物起源(The History of Everything)'}, - {'image': 'https://img.alicdn.com/tfs/TB1fXxIAAvoK1RjSZFNXXcxMVXa-600-362.jpg', 'type': 0, 'id': 9695816, 'url': 'https://mp.weixin.qq.com/s?__biz=MzAwODY4OTk2Mg==&mid=2652048101&idx=1&sn=20296088e4bd8ca33c5c9991167d9f7d&chksm=808caaa0b7fb23b65c0e5806209f8d86da6732f3a00a70353f3606018339518b0a8656f14dc5&mpshare=1&scene=2&srcid=0106SZapVysZdIS6Oc5AhNH6&from=timeline&ascene=2&devicetype=android-27&version=27000038&nettype=WIFI&abtest_cookie=BQABAAgACgALABMAFAAFAJ2GHgAjlx4AV5keAJuZHgCcmR4AAAA%3D&lang=zh_CN&pass_ticket=4K1%2FUpsxP4suPj2iubR17wbAP7r9LW9iYrPAC2dppTqv7j7JO5FWMXtcKeBRxueV&wx_header=1', 'title': 'Flutter 与 Material Design 双剑合璧,助您构建精美应用'} + {'image': 'https://img.alicdn.com/tfs/TB1fXxIAAvoK1RjSZFNXXcxMVXa-600-362.jpg', 'type': 0, 'id': 9695816, 'url': 'https://mp.weixin.qq.com/s?__biz=MzAwODY4OTk2Mg==&mid=2652048101&idx=1&sn=20296088e4bd8ca33c5c9991167d9f7d&chksm=808caaa0b7fb23b65c0e5806209f8d86da6732f3a00a70353f3606018339518b0a8656f14dc5&mpsshare=1&scene=2&srcid=0106SZapVysZdIS6Oc5AhNH6&from=timeline&ascene=2&devicetype=android-27&version=27000038&nettype=WIFI&abtest_cookie=BQABAAgACgALABMAFAAFAJ2GHgAjlx4AV5keAJuZHgCcmR4AAAA%3D&lang=zh_CN&pass_ticket=4K1%2FUpsxP4suPj2iubR17wbAP7r9LW9iYrPAC2dppTqv7j7JO5FWMXtcKeBRxueV&wx_header=1', 'title': 'Flutter 与 Material Design 双剑合璧,助您构建精美应用'} ]; void _launchURL(String url) async { diff --git a/lib/components/search_input.dart b/lib/components/search_input.dart index 36155575..a62bce1e 100644 --- a/lib/components/search_input.dart +++ b/lib/components/search_input.dart @@ -159,7 +159,9 @@ class _MaterialSearchState extends State { _resultsTimer?.cancel(); } Widget buildBody(List results) { - if (_loading) { + if (_criteria.isEmpty) { + return History(); + } else if (_loading) { return new Center( child: new Padding( padding: const EdgeInsets.only(top: 50.0), @@ -396,3 +398,35 @@ class SearchInput extends StatelessWidget { } } // wigdet干掉.=> componets + + +class History extends StatefulWidget { + const History() : super(); + + @override + _History createState() => _History(); +} + +/* +* AppBar 默认的实例,有状态 +* */ +class _History extends State { + + + @override + void initState() { + super.initState(); + } + + @override + void dispose() { + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return new Center( + child: Text('这是一个即将完善的历史记录的面板'), + ); + } +} \ No newline at end of file