Skip to content

Commit 828f765

Browse files
committed
drawer ui
1 parent ee5f54b commit 828f765

File tree

5 files changed

+16
-12
lines changed

5 files changed

+16
-12
lines changed

VERSION.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
### 1.0.6(进行中)
2020
* 增加本地阅读历史
21+
* drawer 状态栏样式处理
2122

2223
### 1.0.5
2324
* 增加本地数据库

lib/common/utils/CommonUtils.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ class CommonUtils {
3131

3232
static double sStaticBarHeight = 0.0;
3333

34-
static void initStatusBarHeight() async {
35-
sStaticBarHeight = await FlutterStatusbar.height;
34+
static void initStatusBarHeight(context) async {
35+
sStaticBarHeight = await FlutterStatusbar.height / MediaQuery.of(context).devicePixelRatio;
3636
}
3737

3838
static String getDateStr(DateTime date) {

lib/page/WelcomePage.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class WelcomePage extends StatelessWidget {
1919
@override
2020
Widget build(BuildContext context) {
2121
Store<GSYState> store = StoreProvider.of(context);
22-
CommonUtils.initStatusBarHeight();
22+
CommonUtils.initStatusBarHeight(context);
2323
new Future.delayed(const Duration(seconds: 2), () {
2424
UserDao.initUserInfo(store).then((res) {
2525
if (res != null && res.result) {

lib/widget/GSYSearchDrawer.dart

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import 'package:flutter/material.dart';
22
import 'package:gsy_github_app_flutter/common/style/GSYStyle.dart';
3+
import 'package:gsy_github_app_flutter/common/utils/CommonUtils.dart';
34

45
/**
56
* 搜索drawer
67
* Created by guoshuyu
78
* Date: 2018-07-18
89
*/
910

10-
1111
typedef void SearchSelectItemChanged<String>(String value);
1212

1313
class GSYSearchDrawer extends StatefulWidget {
@@ -33,10 +33,14 @@ class _GSYSearchDrawerState extends State<GSYSearchDrawer> {
3333
@override
3434
Widget build(BuildContext context) {
3535
return new Container(
36-
color: Colors.white,
37-
child: new SingleChildScrollView(
38-
child: new Column(
39-
children: _renderList(),
36+
color: Color(GSYColors.primaryValue),
37+
padding: EdgeInsets.only(top: CommonUtils.sStaticBarHeight),
38+
child: Container(
39+
color: Color(GSYColors.white),
40+
child: new SingleChildScrollView(
41+
child: new Column(
42+
children: _renderList(),
43+
),
4044
),
4145
),
4246
);
@@ -45,7 +49,6 @@ class _GSYSearchDrawerState extends State<GSYSearchDrawer> {
4549
_renderList() {
4650
List<Widget> list = new List();
4751
list.add(new Container(
48-
height: 50.0,
4952
width: itemWidth,
5053
));
5154
list.add(_renderTitle("类型"));

lib/widget/HomeDrawer.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import 'dart:io';
2-
31
import 'package:get_version/get_version.dart';
42
import 'package:flutter/material.dart';
53
import 'package:flutter_redux/flutter_redux.dart';
@@ -38,10 +36,12 @@ class HomeDrawer extends StatelessWidget {
3836
builder: (context, store) {
3937
User user = store.state.userInfo;
4038
return new Drawer(
41-
//侧边栏按钮Drawer
39+
///侧边栏按钮Drawer
4240
child: new Container(
41+
///默认背景
4342
color: Color(GSYColors.primaryValue),
4443
child: new SingleChildScrollView(
44+
///item 背景
4545
child: new Container(
4646
height: MediaQuery.of(context).size.height,
4747
color: Color(GSYColors.white),

0 commit comments

Comments
 (0)