Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 8351142
Showing
38 changed files
with
1,321 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
.DS_Store | ||
.dart_tool/ | ||
|
||
.packages | ||
.pub/ | ||
|
||
.idea/ | ||
.vagrant/ | ||
.sconsign.dblite | ||
.svn/ | ||
|
||
*.swp | ||
profile | ||
|
||
DerivedData/ | ||
|
||
.generated/ | ||
|
||
*.pbxuser | ||
*.mode1v3 | ||
*.mode2v3 | ||
*.perspectivev3 | ||
|
||
!default.pbxuser | ||
!default.mode1v3 | ||
!default.mode2v3 | ||
!default.perspectivev3 | ||
|
||
xcuserdata | ||
|
||
*.moved-aside | ||
|
||
*.pyc | ||
*sync/ | ||
Icon? | ||
.tags* | ||
|
||
build/ | ||
.android/ | ||
.ios/ | ||
.flutter-plugins |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# This file tracks properties of this Flutter project. | ||
# Used by Flutter tool to assess capabilities and perform upgrades etc. | ||
# | ||
# This file should be version controlled and should not be manually edited. | ||
|
||
version: | ||
revision: cccf44faa64af2b9e0e9436f36960852b50532c4 | ||
channel: master | ||
|
||
project_type: module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# flutter_eyepetizer | ||
|
||
A new Flutter module. | ||
|
||
## Getting Started | ||
|
||
For help getting started with Flutter, view our online | ||
[documentation](https://flutter.io/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module type="JAVA_MODULE" version="4"> | ||
<component name="NewModuleRootManager" inherit-compiler-output="true"> | ||
<exclude-output /> | ||
<content url="file://$MODULE_DIR$"> | ||
<sourceFolder url="file://$MODULE_DIR$/lib" isTestSource="false" /> | ||
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" /> | ||
<excludeFolder url="file://$MODULE_DIR$/.dart_tool" /> | ||
<excludeFolder url="file://$MODULE_DIR$/.idea" /> | ||
<excludeFolder url="file://$MODULE_DIR$/.pub" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build" /> | ||
</content> | ||
<orderEntry type="sourceFolder" forTests="false" /> | ||
<orderEntry type="library" name="Dart SDK" level="project" /> | ||
<orderEntry type="library" name="Flutter Plugins" level="project" /> | ||
<orderEntry type="library" name="Dart Packages" level="project" /> | ||
</component> | ||
</module> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module type="JAVA_MODULE" version="4"> | ||
<component name="FacetManager"> | ||
<facet type="android" name="Android"> | ||
<configuration> | ||
<option name="ALLOW_USER_CONFIGURATION" value="false" /> | ||
<option name="GEN_FOLDER_RELATIVE_PATH_APT" value="/.android/gen" /> | ||
<option name="GEN_FOLDER_RELATIVE_PATH_AIDL" value="/.android/gen" /> | ||
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/.android/AndroidManifest.xml" /> | ||
<option name="RES_FOLDER_RELATIVE_PATH" value="/.android/res" /> | ||
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/.android/assets" /> | ||
<option name="LIBS_FOLDER_RELATIVE_PATH" value="/.android/libs" /> | ||
<option name="PROGUARD_LOGS_FOLDER_RELATIVE_PATH" value="/.android/proguard_logs" /> | ||
</configuration> | ||
</facet> | ||
</component> | ||
<component name="NewModuleRootManager" inherit-compiler-output="true"> | ||
<exclude-output /> | ||
<content url="file://$MODULE_DIR$/.android"> | ||
<sourceFolder url="file://$MODULE_DIR$/.android/Flutter/src/main/java" isTestSource="false" /> | ||
<sourceFolder url="file://$MODULE_DIR$/.android/gen" isTestSource="false" generated="true" /> | ||
</content> | ||
<orderEntry type="jdk" jdkName="Android API 25 Platform" jdkType="Android SDK" /> | ||
<orderEntry type="sourceFolder" forTests="false" /> | ||
<orderEntry type="library" name="Flutter for Android" level="project" /> | ||
</component> | ||
</module> |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_eyepetizer/feed/feed_page.dart'; | ||
import 'package:flutter_eyepetizer/home/home_page.dart'; | ||
import 'package:flutter_eyepetizer/notice/notice_page.dart'; | ||
import 'package:flutter_eyepetizer/personal/personal_page.dart'; | ||
import 'package:flutter_eyepetizer/publish/publish_page.dart'; | ||
|
||
/// 应用程序主页面 | ||
class App extends StatefulWidget { | ||
@override | ||
State<StatefulWidget> createState() => _MyAppState(); | ||
} | ||
|
||
class _MyAppState extends State<App> { | ||
/// tab选中的文本颜色 | ||
Color _colorTabSelect = Colors.black; | ||
|
||
/// tab未选中的文本颜色 | ||
Color _colorTabNormal = Colors.black38; | ||
|
||
int _currentIndex = 0; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
backgroundColor: Colors.white, | ||
//底部导航tab | ||
bottomNavigationBar: BottomNavigationBar( | ||
backgroundColor: Colors.white, | ||
type: BottomNavigationBarType.fixed, | ||
//设置tab选中和未选中的属性 | ||
selectedItemColor: _colorTabSelect, | ||
unselectedItemColor: _colorTabNormal, | ||
selectedFontSize: 14, | ||
unselectedFontSize: 14, | ||
//tab点击事件 | ||
onTap: (index) => { | ||
setState(() { | ||
_currentIndex = index; | ||
}) | ||
}, | ||
items: [ | ||
BottomNavigationBarItem( | ||
title: Text("首页"), | ||
icon: _currentIndex == 0 | ||
? Image.asset("images/ic_tab_strip_icon_feed_selected.png") | ||
: Image.asset("images/ic_tab_strip_icon_feed.png")), | ||
BottomNavigationBarItem( | ||
title: Text("社区"), | ||
icon: _currentIndex == 1 | ||
? Image.asset( | ||
"images/ic_tab_strip_icon_follow_selected.png") | ||
: Image.asset("images/ic_tab_strip_icon_follow.png")), | ||
BottomNavigationBarItem( | ||
title: Text( | ||
"", | ||
style: TextStyle(fontSize: 0), | ||
), | ||
icon: Image.asset("images/ic_home_public.png")), | ||
BottomNavigationBarItem( | ||
title: Text("通知"), | ||
icon: _currentIndex == 3 | ||
? Image.asset( | ||
"images/ic_tab_strip_icon_category_selected.png") | ||
: Image.asset("images/ic_tab_strip_icon_category.png")), | ||
BottomNavigationBarItem( | ||
title: Text("我的"), | ||
icon: _currentIndex == 4 | ||
? Image.asset( | ||
"images/ic_tab_strip_icon_profile_selected.png") | ||
: Image.asset("images/ic_tab_strip_icon_profile.png")) | ||
]), | ||
//页面展示的内容 | ||
body: _currentPage(), | ||
); | ||
} | ||
|
||
/// 根据选中的tab显示对应的内容 | ||
Widget _currentPage() { | ||
Widget page; | ||
switch (_currentIndex) { | ||
case 0: | ||
page = HomePage(); | ||
break; | ||
case 1: | ||
page = FeedPage(); | ||
break; | ||
case 2: | ||
page = PublishPage(); | ||
break; | ||
case 3: | ||
page = NoticePage(); | ||
break; | ||
case 4: | ||
page = PersonalPage(); | ||
break; | ||
} | ||
return page; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
///社区-关注 | ||
class FeedAttentionPage extends StatelessWidget { | ||
@override | ||
Widget build(BuildContext context) { | ||
return Container( | ||
alignment: Alignment.center, | ||
child: Text("关注"), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_eyepetizer/feed/feed_attention.dart'; | ||
import 'package:flutter_eyepetizer/feed/feed_recommend.dart'; | ||
import 'package:flutter_eyepetizer/search/search_page.dart'; | ||
|
||
/// 社区页面 | ||
class FeedPage extends StatelessWidget { | ||
@override | ||
Widget build(BuildContext context) { | ||
return DefaultTabController( | ||
//tab数量 | ||
length: 2, | ||
child: Scaffold( | ||
backgroundColor: Colors.white, | ||
appBar: AppBar( | ||
backgroundColor: Colors.white, | ||
elevation: 0, | ||
title: Stack( | ||
children: <Widget>[ | ||
Align( | ||
child: Container( | ||
width: MediaQuery.of(context).size.width / 2.5, | ||
child: TabBar( | ||
//设置tab选中和未选中的属性 | ||
indicatorSize: TabBarIndicatorSize.label, | ||
indicatorWeight: 2, | ||
labelColor: Colors.black, | ||
labelStyle: TextStyle( | ||
fontSize: 14.2, fontWeight: FontWeight.bold), | ||
unselectedLabelColor: Colors.black54, | ||
unselectedLabelStyle: TextStyle( | ||
fontSize: 14.0, fontWeight: FontWeight.bold), | ||
indicatorColor: Colors.black, | ||
indicatorPadding: new EdgeInsets.only(bottom: -8.0), | ||
//tab点击事件 | ||
onTap: (index) => {}, | ||
tabs: [Text("发现"), Text("关注")]), | ||
), | ||
alignment: FractionalOffset.center, | ||
), | ||
Align( | ||
child: IconButton( | ||
icon: Icon(Icons.search, color: Colors.black), | ||
onPressed: () => { | ||
Navigator.of(context).push(MaterialPageRoute( | ||
builder: (BuildContext context) { | ||
return SearchPage(); | ||
})) | ||
}), | ||
alignment: FractionalOffset.centerRight, | ||
) | ||
], | ||
), | ||
), | ||
body: TabBarView(children: [FeedRecommendPage(), FeedAttentionPage()]), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
/// 社区-推荐 | ||
class FeedRecommendPage extends StatelessWidget { | ||
@override | ||
Widget build(BuildContext context) { | ||
return Container( | ||
alignment: Alignment.center, | ||
child: Text("推荐"), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
/// 首页-关注 | ||
class HomeAttentionPage extends StatelessWidget{ | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Container( | ||
alignment: Alignment.center, | ||
child: Text("关注"), | ||
); | ||
} | ||
|
||
} |
Oops, something went wrong.