Skip to content

Commit

Permalink
doc: update readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinGong2013 committed Nov 27, 2020
1 parent 605766c commit 2e5a55f
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 62 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ _Flutter **stable channel** 发布后 **一周内**适配发布对应的`g_farad
- [x] 支持自定义页面切换动画
- [x] 完整的文档(7/10)

## Show Cases

![Example](doc/images/faraday_demo.png)

## Requirements

- Flutter 1.24.0-10.2.pre • channel beta
Expand Down
Binary file added doc/images/faraday_demo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
74 changes: 39 additions & 35 deletions example/lib/src/pages/features/notification/notification.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,43 +22,47 @@ class _GlobalNotificationState extends State<GlobalNotification> {
_localMessage = value.arguments.toString();
});
},
child: Section(
title: '通知(GlobalNotification)',
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
FaradayAction(
icon: Icon(
_localMessage == null
? Icons.notifications
: Icons.notifications_active,
color: Colors.white,
child: Padding(
padding: EdgeInsets.only(right: 16),
child: Section(
title: '通知(GlobalNotification)',
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
FaradayAction(
icon: Icon(
_localMessage == null
? Icons.notifications
: Icons.notifications_active,
color: Colors.white,
),
color: Colors.deepPurpleAccent,
onTap: () {
setState(() {
_localMessage = null;
FaradayNotification('GlobalNotification')
.dispatchToGlobal();
});
},
description: 'Post Notification To Native',
),
color: Colors.deepPurpleAccent,
onTap: () {
setState(() {
_localMessage = null;
FaradayNotification('GlobalNotification').dispatchToGlobal();
});
},
description: 'Post Notification To Native',
),
if (_localMessage != null)
TweenAnimationBuilder(
duration: Duration(milliseconds: 300),
tween: Tween(begin: 5.0, end: 1.0),
builder: (context, value, child) =>
Transform.scale(scale: value, child: child),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
_localMessage,
style: TextStyle(color: Colors.purple[900]),
overflow: TextOverflow.fade,
if (_localMessage != null)
TweenAnimationBuilder(
duration: Duration(milliseconds: 300),
tween: Tween(begin: 5.0, end: 1.0),
builder: (context, value, child) =>
Transform.scale(scale: value, child: child),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
_localMessage,
style: TextStyle(color: Colors.purple[900]),
overflow: TextOverflow.fade,
),
),
),
)
],
)
],
),
),
),
);
Expand Down
55 changes: 29 additions & 26 deletions example/lib/src/pages/features/other/other.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,37 @@ class Others extends StatefulWidget {
class _OthersState extends State<Others> {
@override
Widget build(BuildContext context) {
return Section(
title: '其他(Others)',
subTitle: '其他一些有趣的小功能',
child: Row(
children: [
Expanded(
child: FaradayAction(
color: Colors.teal,
icon: Icon(Icons.wrap_text, color: Colors.white),
description: '拦截返回',
onTap: () => Navigator.of(context)
.push(CupertinoPageRoute(builder: (_) => _WillPopPage())),
return Padding(
padding: EdgeInsets.only(right: 16),
child: Section(
title: '其他(Others)',
subTitle: '其他一些有趣的小功能',
child: Row(
children: [
Expanded(
child: FaradayAction(
color: Colors.teal,
icon: Icon(Icons.wrap_text, color: Colors.white),
description: '拦截返回',
onTap: () => Navigator.of(context)
.push(CupertinoPageRoute(builder: (_) => _WillPopPage())),
),
),
),
SizedBox(width: 8.0),
Expanded(
child: FaradayAction(
color: Colors.blueAccent,
icon: Icon(Icons.view_stream, color: Colors.white),
description: 'iOS 自动处理导航条',
onTap: () {
if (Platform.isIOS) {
Navigator.of(context).nativePushNamed('navigationBar');
}
},
SizedBox(width: 8.0),
Expanded(
child: FaradayAction(
color: Colors.blueAccent,
icon: Icon(Icons.view_stream, color: Colors.white),
description: 'iOS 自动处理导航条',
onTap: () {
if (Platform.isIOS) {
Navigator.of(context).nativePushNamed('navigationBar');
}
},
),
),
),
],
],
),
),
);
}
Expand Down
2 changes: 1 addition & 1 deletion example/lib/src/pages/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class HomePageBannerDelegate extends SliverPersistentHeaderDelegate {
}

@override
double get maxExtent => 110;
double get maxExtent => 130;

@override
double get minExtent => 110;
Expand Down

0 comments on commit 2e5a55f

Please sign in to comment.