Skip to content

Commit

Permalink
实现通知模块。
Browse files Browse the repository at this point in the history
  • Loading branch information
guofudong committed Apr 18, 2019
1 parent 0c6d58b commit 006d74a
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 7 deletions.
Binary file added images/2.0x/ic_action_focus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/2.0x/no_account_tip.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 41 additions & 4 deletions lib/notice/notice_interactive.dart
Original file line number Diff line number Diff line change
@@ -1,13 +1,50 @@
import 'package:flutter/material.dart';
import 'package:flutter_eyepetizer/personal/personal_login.dart';

/// 通知-互动
class NoticeInteractivePage extends StatelessWidget{
class NoticeInteractivePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
alignment: Alignment.center,
child: Text("互动"),
child: Column(
children: <Widget>[
Container(
margin: EdgeInsets.only(top: 100, bottom: 20),
child: Image.asset("images/no_account_tip.png"),
),
Text("被错误重要的信息",
style: TextStyle(
fontSize: 16,
color: Colors.black,
fontWeight: FontWeight.bold)),
Padding(
padding: EdgeInsets.only(top: 8, bottom: 60),
child: Text("登入后即可查看评论回复、点赞及关注等通知信息",
style: TextStyle(
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.normal)),
),
RaisedButton(
padding: EdgeInsets.only(top: 8, bottom: 8, left: 100, right: 100),
color: Colors.blue,
elevation: 0,
onPressed: () => {_toLoginPage(context)},
child: Text("登入",
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.white,
fontSize: 18)),
),
],
),
);
}

}
///跳转到登入页面
void _toLoginPage(BuildContext context) {
Navigator.of(context).push(MaterialPageRoute(builder: (context) {
return PersonalLogin();
}));
}
}
65 changes: 62 additions & 3 deletions lib/notice/notice_push.dart
Original file line number Diff line number Diff line change
@@ -1,13 +1,72 @@
import 'package:flutter/material.dart';

/// 通知-推送
class NoticePushPage extends StatelessWidget{
class NoticePushPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
alignment: Alignment.center,
child: Text("推送"),
child: ListView.separated(
itemCount: 12,
itemBuilder: _itemBuilder, //item分割线
separatorBuilder: (BuildContext context, int index) {
return Divider(
height: 2.0, color: Color.fromARGB(32, 6, 6, 6), indent: 40);
}),
);
}

}
Widget _itemBuilder(BuildContext context, int index) {
return Flex(
direction: Axis.horizontal,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.only(top: 14,left: 10),
width: 38,
height: 38,
child: Image.asset("images/ic_action_focus.png"),
decoration: BoxDecoration(
shape: BoxShape.circle,
border: Border.all(
color: Color.fromARGB(32, 0, 0, 0), width: 1.0))),
Expanded(
flex: 1,
child: Container(
padding:
EdgeInsets.only(left: 10, right: 10, top: 10, bottom: 10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text("开眼社区",
style: TextStyle(
color: Colors.black,
fontSize: 14,
fontWeight: FontWeight.bold)),
Padding(
padding: EdgeInsets.only(top: 2),
child: Text("2天前",
style: TextStyle(
color: Color.fromARGB(100, 0, 0, 0),
fontSize: 12,
fontWeight: FontWeight.normal)),
),
Padding(
padding: EdgeInsets.only(top: 4),
child: Text(
"拍摄你目光所及的赛博朋克瞬间,赢取开眼限量礼品福袋>>",
style: TextStyle(
color: Color.fromARGB(180, 0, 0, 0),
fontSize: 12,
fontWeight: FontWeight.normal),
))
],
),
)),
IconButton(
icon: Icon(Icons.chevron_right, size: 20, color: Colors.black),
onPressed: null)
],
);
}
}
2 changes: 2 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ flutter:
- images/ic_account_login_wechat.png
- images/ic_account_login_qq.png
- images/ic_account_login_weibo.png
- images/no_account_tip.png
- images/ic_action_focus.png

module:
androidPackage: com.gfd.flutter_eyepetizer
Expand Down

0 comments on commit 006d74a

Please sign in to comment.