From 433a49be1c4f4dcc5f7fac0bfcf073a5294fb52d Mon Sep 17 00:00:00 2001
From: Elon Chan
Date: Thu, 18 Jul 2019 23:03:19 +0700
Subject: [PATCH 01/14] [update][flutter]update pull_request_template.
---
.github/pull_request_template.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
index 8a56705..01f5218 100644
--- a/.github/pull_request_template.md
+++ b/.github/pull_request_template.md
@@ -9,7 +9,7 @@
Thanks for considering to this repository. Before you submit your issue, please confirm these boxes are checked.
- [ ] I have read [《[EN]Style guide for Flutter repo [CN]Flutter项目代码规范、规约选型》](https://github.com/iteatimeteam/tap_water/issues/1).
-- [ ] 我遵守一下 Merge 规则:邀请群组中任意一人进行review,即可合并。让 reviewer 在 PR 所在页面写下review意见表示通过,即可合并。最简单写一句 LGTM 也可以。不按照本规则执行,自己 PR 自己 Merge 并引入问题,会被收回 Merge 权限。
+- [ ] 我遵守以下 Merge 规则:PR提交后,邀请群组中任意一人进行 review,即可合并。让 reviewer 在 PR 所在页面写下 review 意见表示通过,即可合并。最简单写一句 LGTM 也可以。不按照本规则执行,自己 PR 自己 Merge 并引入问题,会被收回 Merge 权限。
From 1df9a1c252c0634c90d91ae65c306f11470647f7 Mon Sep 17 00:00:00 2001
From: Elon Chan
Date: Tue, 23 Jul 2019 10:17:47 +0700
Subject: [PATCH 02/14] [update][README]update README to add contributor info
#8
---
README.md | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index f30a0fd..982e065 100644
--- a/README.md
+++ b/README.md
@@ -42,5 +42,6 @@ updated
演示 | 主要代码贡献方及介绍
:-------------:|:-------------:
-| ![](http://ww2.sinaimg.cn/large/006tNc79gy1g544k1fcdjg30b20kzn2q.gif) | ![https://github.com/ChenYilong](https://avatars1.githubusercontent.com/u/13093607?s=400&v=4)
[**@DargonLee**]( https://github.com/DargonLee ) [issue#11 TabBar基础版本,不带加号按钮]( https://github.com/iteatimeteam/tap_water/issues/11 )
+| ![](http://ww2.sinaimg.cn/large/006tNc79gy1g544k1fcdjg30b20kzn2q.gif) |
[**@DargonLee**]( https://github.com/DargonLee ) [《TabBar基础版本,不带加号按钮 issue#11》]( https://github.com/iteatimeteam/tap_water/issues/11 )
+![](http://ww4.sinaimg.cn/large/006tNc79gy1g59kad16rdg30b20kzn29.gif) |
[@苏筱雅]( https://github.com/SuXiaoya ) [《TabBar 加号按钮未封装版本,带加号按钮 #8》]( https://github.com/iteatimeteam/tap_water/issues/8 )
From cb8913f76095761ff28d5674b0d5f5fb2e1b6365 Mon Sep 17 00:00:00 2001
From: X-Liang <1129584401@qq.com>
Date: Tue, 23 Jul 2019 14:17:49 +0800
Subject: [PATCH 03/14] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=96=87=E4=BB=B6?=
=?UTF-8?q?=E7=BB=93=E6=9E=84=EF=BC=8C=E5=B0=86Tabbar=EF=BC=8CTabbarItem?=
=?UTF-8?q?=20=E5=B0=81=E8=A3=85=E5=88=B0=E5=8D=95=E7=8B=AC=E7=9A=84?=
=?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=AD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
lib/TapWaterTabbar.dart | 99 ++++++++++++++++----------------------
lib/main.dart | 59 +----------------------
lib/tab_item.dart | 58 ++++++++++++++++++++++
lib/tap_water_tab_bar.dart | 58 ++++++++++++++++++++++
4 files changed, 158 insertions(+), 116 deletions(-)
create mode 100644 lib/tab_item.dart
create mode 100644 lib/tap_water_tab_bar.dart
diff --git a/lib/TapWaterTabbar.dart b/lib/TapWaterTabbar.dart
index 6f85dd2..a09e2d6 100644
--- a/lib/TapWaterTabbar.dart
+++ b/lib/TapWaterTabbar.dart
@@ -1,4 +1,6 @@
import 'package:flutter/material.dart';
+import 'package:tap_water_tab_bar/tap_water_tab_bar.dart';
+
import 'firstvc.dart';
//enum ActionsItems {
@@ -40,28 +42,15 @@ class _TapWaterTabbarState extends State {
void initState() {
super.initState();
_navgationViews = [
- NavigationIconView(
- title: '微信',
- icon: Icon(Icons.ac_unit),
- avtiveIcon: Icon(Icons.backspace)),
- NavigationIconView(
- title: '通讯录',
- icon: Icon(Icons.backup),
- avtiveIcon: Icon(Icons.cached)),
- NavigationIconView(
- title: '',
- icon: Icon(Icons.publish),
- avtiveIcon: Icon(Icons.public)),
- NavigationIconView(
- title: '发现',
- icon: Icon(Icons.dashboard),
- avtiveIcon: Icon(Icons.edit)),
+ NavigationIconView(title: '微信', icon: Icon(Icons.ac_unit), avtiveIcon: Icon(Icons.backspace)),
+ NavigationIconView(title: '通讯录', icon: Icon(Icons.backup), avtiveIcon: Icon(Icons.cached)),
+ NavigationIconView(title: '', icon: Icon(Icons.publish), avtiveIcon: Icon(Icons.public)),
+ NavigationIconView(title: '发现', icon: Icon(Icons.dashboard), avtiveIcon: Icon(Icons.edit)),
NavigationIconView(
title: '我的',
icon: Icon(Icons.memory),
avtiveIcon: Icon(Icons.drive_eta),
)
-
];
_pageController = PageController(initialPage: _currentIndex);
@@ -93,24 +82,14 @@ class _TapWaterTabbarState extends State {
@override
Widget build(BuildContext context) {
-
-
-
final botNavbar = new BottomNavigationBar(
fixedColor: Colors.green,
- items: _navgationViews
- .map((NavigationIconView navigationView) => navigationView.item)
- .toList(),
+ items: _navgationViews.map((NavigationIconView navigationView) => navigationView.item).toList(),
currentIndex: _currentIndex,
type: BottomNavigationBarType.fixed,
onTap: onTap,
);
-return MaterialApp(
- theme: ThemeData(primaryColor: Colors.blue),
- home: Scaffold(
- body: Stack(
- children: [
- Scaffold(
+ return Scaffold(
appBar: AppBar(
elevation: 0.0,
title: Text('微信'),
@@ -171,43 +150,48 @@ return MaterialApp(
Container(width: 5.0)
],
),
- body: PageView.builder(
- itemBuilder: (BuildContext context, int index) {
- return _pages[index];
- },
- controller: _pageController,
- itemCount: _pages.length,
- onPageChanged: (int index) {
- setState(() {
- _currentIndex = index;
- });
- },
- ),
- bottomNavigationBar: botNavbar,
-
- ),
- Align(
- child: Padding(
- padding: const EdgeInsets.only(bottom:50.0),
- child: FloatingActionButton(
- child: new Image.asset(bigImg),
- onPressed: onBigImgTap,
+ body: Stack(
+ children: [
+ Padding(
+ padding: const EdgeInsets.only(bottom: 50),
+ child: PageView.builder(
+ itemBuilder: (BuildContext context, int index) {
+ return _pages[index];
+ },
+ controller: _pageController,
+ itemCount: _pages.length,
+ onPageChanged: (int index) {
+ setState(() {
+ _currentIndex = index;
+ });
+ },
),
),
- alignment: Alignment.bottomCenter,
- ),
- ],
- )
- )
+ Align(
+ alignment: Alignment.bottomCenter,
+ child: WaterTabBar(),
+ ),
+// Align(
+// child: Padding(
+// padding: const EdgeInsets.only(bottom: 50.0),
+// child: FloatingActionButton(
+// child: new Image.asset(bigImg),
+// onPressed: onBigImgTap,
+// ),
+// ),
+// alignment: Alignment.bottomCenter,
+// ),
+ ],
+ ),
);
-
}
+
void onTap(int index) {
if (index != 2) {
setState(() {
this.bigImg = 'images/post_normal.png';
});
- }else{
+ } else {
setState(() {
this.bigImg = 'images/post_highlight.png';
});
@@ -230,5 +214,4 @@ return MaterialApp(
this.page = page;
});
}
-
}
diff --git a/lib/main.dart b/lib/main.dart
index a36d2a9..bbc8494 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
+
import 'TapWaterTabbar.dart';
void main() => runApp(MyApp());
@@ -16,61 +17,3 @@ class MyApp extends StatelessWidget {
);
}
}
-
-//class MyHomePage extends StatefulWidget {
-// MyHomePage({Key key, this.title}) : super(key: key);
-//
-// final String title;
-//
-// @override
-// _MyHomePageState createState() => _MyHomePageState();
-//}
-//
-//const Color ContentColor = Color.fromARGB(255, 170, 170, 170);
-//
-//Widget contentWidget({double height}) {
-// return Container(
-// margin: const EdgeInsets.all(10),
-// color: Color.fromARGB(255, 170, 170, 170),
-// width: 25,
-// height: height,
-// );
-//}
-//
-//class _MyHomePageState extends State {
-// @override
-// Widget build(BuildContext context) {
-// return Scaffold(
-// appBar: AppBar(
-// title: Text(widget.title),
-// ),
-// body: Listener(
-// onPointerDown: (PointerDownEvent event) {
-// print('Gesture3');
-// },
-// child: SizedBox(
-// width: 200,
-// height: 200,
-// child: GestureDetector(
-// onTap: () {
-// print('Gesture2');
-// },
-// child: SizedBox(
-// width: 100,
-// height: 100,
-// child: Listener(
-// onPointerDown: (PointerDownEvent event) {
-// print('Gesture1');
-// },
-// child: SizedBox(
-// width: 50,
-// height: 50,
-// ),
-// ),
-// ),
-// ),
-// ),
-// ),
-// );
-// }
-//}
diff --git a/lib/tab_item.dart b/lib/tab_item.dart
new file mode 100644
index 0000000..e77a2ea
--- /dev/null
+++ b/lib/tab_item.dart
@@ -0,0 +1,58 @@
+import 'package:flutter/material.dart';
+
+class TabItem extends StatefulWidget {
+ final String title;
+ final Icon icon;
+ final double width;
+ TabItem({this.title, this.icon, this.width});
+ @override
+ State createState() => _TabItem();
+}
+
+class _TabItem extends State {
+ @override
+ Widget build(BuildContext context) {
+ return Expanded(
+ child: Stack(
+ fit: StackFit.expand,
+ children: [
+ Column(
+ crossAxisAlignment: CrossAxisAlignment.center,
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ Flexible(
+ child: widget.icon != null
+ ? Container(
+ child: Padding(
+ padding: const EdgeInsets.only(top: 5),
+ child: IconButton(icon: widget.icon, color: Color(0xFF8c77ec), onPressed: null),
+ ),
+ )
+ : Container(
+ width: widget.width,
+ ),
+ ),
+ Flexible(
+ child: Container(
+ child: Align(
+ alignment: Alignment(0, 0),
+ child: Padding(
+ padding: const EdgeInsets.all(0),
+ child: widget.title != null
+ ? Text(
+ widget.title,
+ style: TextStyle(fontWeight: FontWeight.w600, fontSize: 10),
+ )
+ : Container(),
+ ),
+ ),
+ ),
+ )
+ ],
+ )
+ ],
+ ),
+ );
+ }
+}
diff --git a/lib/tap_water_tab_bar.dart b/lib/tap_water_tab_bar.dart
new file mode 100644
index 0000000..d9a58b8
--- /dev/null
+++ b/lib/tap_water_tab_bar.dart
@@ -0,0 +1,58 @@
+import 'package:flutter/material.dart';
+import 'package:tap_water_tab_bar/tab_item.dart';
+
+const String bigImg = 'images/post_normal.png';
+
+class WaterTabBar extends StatefulWidget {
+ @override
+ State createState() => _WaterTabBarState();
+}
+
+class _WaterTabBarState extends State {
+ @override
+ Widget build(BuildContext context) {
+ return Stack(
+ overflow: Overflow.visible,
+ alignment: Alignment.bottomCenter,
+ children: [
+ Container(
+ height: 60,
+ decoration: BoxDecoration(
+ color: Colors.white,
+ boxShadow: [BoxShadow(color: Colors.black12, offset: Offset(0, -1), blurRadius: 8)],
+ ),
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ mainAxisSize: MainAxisSize.max,
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ TabItem(title: '微信', icon: Icon(Icons.ac_unit)),
+ TabItem(title: '微信', icon: Icon(Icons.ac_unit)),
+ TabItem(),
+ TabItem(title: '微信', icon: Icon(Icons.ac_unit)),
+ TabItem(title: '微信', icon: Icon(Icons.ac_unit))
+ ],
+ ),
+ ),
+ Positioned(
+ child: Container(
+ margin: const EdgeInsets.only(bottom: 10),
+ width: 60,
+ child: Image.asset(bigImg),
+ ),
+ )
+// IgnorePointer(
+// child: Container(
+// decoration: const BoxDecoration(color: Colors.transparent),
+// child: Align(
+// heightFactor: 1,
+// child: OverflowBox(
+// child: ,
+// ),
+// ),
+// ),
+// )
+ ],
+ );
+ }
+}
From 21980fd36efdaeafd10b4ad8e11271a758060ea6 Mon Sep 17 00:00:00 2001
From: wjun94
Date: Tue, 23 Jul 2019 14:37:42 +0800
Subject: [PATCH 04/14] =?UTF-8?q?=E6=B7=BB=E5=8A=A0isButton=E5=88=A4?=
=?UTF-8?q?=E6=96=AD=E6=98=AF=E5=90=A6=E5=B8=A6=E6=8C=89=E9=92=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
lib/TapWaterTabbar.dart | 7 +++++--
lib/main.dart | 2 +-
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/lib/TapWaterTabbar.dart b/lib/TapWaterTabbar.dart
index 6f85dd2..bd74afc 100644
--- a/lib/TapWaterTabbar.dart
+++ b/lib/TapWaterTabbar.dart
@@ -24,6 +24,9 @@ class NavigationIconView {
}
class TapWaterTabbar extends StatefulWidget {
+ final bool hasButton;
+ TapWaterTabbar({Key key, this.hasButton = false}) : super(key: key);
+
@override
_TapWaterTabbarState createState() => _TapWaterTabbarState();
}
@@ -186,7 +189,7 @@ return MaterialApp(
bottomNavigationBar: botNavbar,
),
- Align(
+ widget.hasButton ? Align(
child: Padding(
padding: const EdgeInsets.only(bottom:50.0),
child: FloatingActionButton(
@@ -195,7 +198,7 @@ return MaterialApp(
),
),
alignment: Alignment.bottomCenter,
- ),
+ ) : Text(''),
],
)
)
diff --git a/lib/main.dart b/lib/main.dart
index a36d2a9..aba4b32 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -12,7 +12,7 @@ class MyApp extends StatelessWidget {
theme: ThemeData(
primarySwatch: Colors.blue,
),
- home: TapWaterTabbar(),
+ home: TapWaterTabbar(hasButton: true),
);
}
}
From 3f95ac0eed964b05a5536920f9cb15f121e82e80 Mon Sep 17 00:00:00 2001
From: wjun94
Date: Tue, 23 Jul 2019 16:43:15 +0800
Subject: [PATCH 05/14] =?UTF-8?q?[+]=20tab=E9=85=8D=E7=BD=AE=E9=80=9A?=
=?UTF-8?q?=E8=BF=87=E4=BC=A0btmNavbar=E8=BF=9B=E8=A1=8C=E9=85=8D=E7=BD=AE?=
=?UTF-8?q?=EF=BC=8C=E4=BC=98=E5=8C=96=E6=8C=89=E9=92=AE=E6=B7=BB=E5=8A=A0?=
=?UTF-8?q?=E9=9A=90=E8=97=8F=E6=93=8D=E4=BD=9C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
lib/TapWaterTabbar.dart | 41 ++++++++++++++++++++++++++++++--------
lib/main.dart | 7 ++++++-
lib/tap_water_tab_bar.dart | 27 ++++++++++++++++---------
3 files changed, 57 insertions(+), 18 deletions(-)
diff --git a/lib/TapWaterTabbar.dart b/lib/TapWaterTabbar.dart
index 93345f5..39de6cb 100644
--- a/lib/TapWaterTabbar.dart
+++ b/lib/TapWaterTabbar.dart
@@ -27,8 +27,20 @@ class NavigationIconView {
class TapWaterTabbar extends StatefulWidget {
final bool isButton;
- TapWaterTabbar({Key key, this.isButton = false}) : super(key: key);
-
+ final List