Merge pull request #148 from alibaba/dev/yisheng

Dev/yisheng
This commit is contained in:
ryan730
2019-02-19 18:37:12 +08:00
committed by GitHub
4 changed files with 65 additions and 55 deletions

View File

@ -27,7 +27,6 @@
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
333E5DAE7FC10AC69FEC26C0 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DDA792F029EDD7A11295D192 /* libPods-Runner.a */; }; 333E5DAE7FC10AC69FEC26C0 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DDA792F029EDD7A11295D192 /* libPods-Runner.a */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */ = {isa = PBXBuildFile; fileRef = 2D5378251FAA1A9400D5DBA9 /* flutter_assets */; };
3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
@ -75,7 +74,6 @@
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; }; 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; };
3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; }; 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; }; 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
@ -148,7 +146,6 @@
children = ( children = (
3B80C3931E831B6300D905FE /* App.framework */, 3B80C3931E831B6300D905FE /* App.framework */,
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
2D5378251FAA1A9400D5DBA9 /* flutter_assets */,
9740EEBA1CF902C7004384FC /* Flutter.framework */, 9740EEBA1CF902C7004384FC /* Flutter.framework */,
9740EEB21CF90195004384FC /* Debug.xcconfig */, 9740EEB21CF90195004384FC /* Debug.xcconfig */,
7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
@ -274,7 +271,6 @@
0828E4A2220692B500A59437 /* iPhone Portrait-Retina HD 5.5.png in Resources */, 0828E4A2220692B500A59437 /* iPhone Portrait-Retina HD 5.5.png in Resources */,
0828E49A220692B500A59437 /* iPhone X_XS Portrait.png in Resources */, 0828E49A220692B500A59437 /* iPhone X_XS Portrait.png in Resources */,
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */,
0828E49E220692B500A59437 /* iPad Portrait@2x.png in Resources */, 0828E49E220692B500A59437 /* iPad Portrait@2x.png in Resources */,
0828E49D220692B500A59437 /* iPhone Portrait@2x.png in Resources */, 0828E49D220692B500A59437 /* iPhone Portrait@2x.png in Resources */,
0828E499220692B500A59437 /* iPhone Portrait-Retina HD 4.7.png in Resources */, 0828E499220692B500A59437 /* iPhone Portrait-Retina HD 4.7.png in Resources */,

View File

@ -166,24 +166,24 @@ class DisclaimerMsgState extends State<DisclaimerMsg> {
} }
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new GestureDetector( return GestureDetector(
onTap: () { onTap: () {
showAlertDialog(context); showAlertDialog(context);
}, },
child: Stack( child: Stack(
//alignment: const Alignment(1.6, 1.6), //alignment: const Alignment(1.6, 1.6),
children: [ children: [
new Container( Container(
width: 90.0, width: 90.0,
alignment: Alignment.center, alignment: Alignment.center,
decoration: new BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius:
new BorderRadius.horizontal(right: Radius.circular(10)), BorderRadius.horizontal(right: Radius.circular(10)),
color: Colors.black45, color: Colors.black45,
), ),
child: new Text( child: Text(
'🔔 免责声明', '🔔 免责声明',
style: new TextStyle( style: TextStyle(
fontSize: 14.0, fontSize: 14.0,
//fontWeight: FontWeight.bold, //fontWeight: FontWeight.bold,
color: Colors.white, color: Colors.white,

View File

@ -10,7 +10,7 @@ import 'package:flutter_go/views/first_page/first_page_item.dart';
import 'package:flutter_go/components/disclaimer_msg.dart'; import 'package:flutter_go/components/disclaimer_msg.dart';
import 'package:flutter_go/utils/net_utils.dart'; import 'package:flutter_go/utils/net_utils.dart';
GlobalKey<DisclaimerMsgState> key; // ValueKey<String> key;
class FirstPage extends StatefulWidget { class FirstPage extends StatefulWidget {
@override @override
@ -20,6 +20,7 @@ class FirstPage extends StatefulWidget {
class FirstPageState extends State<FirstPage> with AutomaticKeepAliveClientMixin{ class FirstPageState extends State<FirstPage> with AutomaticKeepAliveClientMixin{
Future<SharedPreferences> _prefs = SharedPreferences.getInstance(); Future<SharedPreferences> _prefs = SharedPreferences.getInstance();
Future<bool> _unKnow; Future<bool> _unKnow;
GlobalKey<DisclaimerMsgState> key;
@override @override
bool get wantKeepAlive => true; bool get wantKeepAlive => true;
@ -30,6 +31,7 @@ class FirstPageState extends State<FirstPage> with AutomaticKeepAliveClientMixin
super.initState(); super.initState();
if (key == null) { if (key == null) {
key = GlobalKey<DisclaimerMsgState>(); key = GlobalKey<DisclaimerMsgState>();
// key = const Key('__RIKEY1__');
//获取sharePre //获取sharePre
_unKnow = _prefs.then((SharedPreferences prefs) { _unKnow = _prefs.then((SharedPreferences prefs) {
return (prefs.getBool('disclaimer::Boolean') ?? false); return (prefs.getBool('disclaimer::Boolean') ?? false);

View File

@ -5,21 +5,21 @@ import '../../routers/routers.dart';
import '../../utils/shared_preferences.dart'; import '../../utils/shared_preferences.dart';
final pages = [ final pages = [
new PageViewModel( PageViewModel(
const Color(0xFFcd344f), const Color(0xFFcd344f),
//'assets/mountain.png', //'assets/mountain.png',
'assets/images/p2.png', 'assets/images/p2.png',
'FlutterGo是什么', 'FlutterGo是什么',
'【FlutterGo】 是由"阿里拍卖"前端团队几位 Flutter 粉丝,用业余时间开发的一款,用于 Flutter 教学帮助的App这里没有高大尚的概念只有一个一个亲历的尝试用最直观的方式展示的 Flutter 官方demo', '【FlutterGo】 是由"阿里拍卖"前端团队几位 Flutter 粉丝,用业余时间开发的一款,用于 Flutter 教学帮助的App这里没有高大尚的概念只有一个一个亲历的尝试用最直观的方式展示的 Flutter 官方demo',
'assets/images/plane.png'), 'assets/images/plane.png'),
new PageViewModel( PageViewModel(
const Color(0xFF638de3), const Color(0xFF638de3),
//'assets/world.png', //'assets/world.png',
'assets/images/p1.png', 'assets/images/p1.png',
'FLutterGo的背景', 'FLutterGo的背景',
'🐢 官网文档示例较不够健全,不够直观\n🐞 运行widget demo要到处翻阅资料\n🐌 英文文档翻译生涩难懂,学习资料太少\n🚀 需要的效果不知道用哪个widget\n', '🐢 官网文档示例较不够健全,不够直观\n🐞 运行widget demo要到处翻阅资料\n🐌 英文文档翻译生涩难懂,学习资料太少\n🚀 需要的效果不知道用哪个widget\n',
'assets/images/calendar.png'), 'assets/images/calendar.png'),
new PageViewModel( PageViewModel(
const Color(0xFFFF682D), const Color(0xFFFF682D),
//'assets/home.png', //'assets/home.png',
'assets/images/p3.png', 'assets/images/p3.png',
@ -57,56 +57,68 @@ class Page extends StatelessWidget {
}, },
elevation: 10.0, elevation: 10.0,
color: Colors.black26, color: Colors.black26,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)), // shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.horizontal(left: Radius.circular(20.0))),
//如果不手动设置icon和text颜色,则默认使用foregroundColor颜色 //如果不手动设置icon和text颜色,则默认使用foregroundColor颜色
icon: new Icon(iconName, color: Colors.white, size: 20.0), icon: Icon(iconName, color: Colors.white, size: 14.0),
label: new Text( label: Text(
txt, txt,
maxLines: 1, maxLines: 1,
style: TextStyle( style: TextStyle(
color: Colors.white, fontSize: 16, fontWeight: FontWeight.w700), color: Colors.white, fontSize: 14, fontWeight: FontWeight.w700),
)); ));
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new Container( return Stack(
width: double.infinity, //alignment: const Alignment(1.2, 0.6),
/// height:MediaQuery.of(context).size.height-200.0, children: [
color: viewModel.color, Container(
padding: const EdgeInsets.fromLTRB(0, 0, 0, 0), width: double.infinity,
child: Opacity( /// height:MediaQuery.of(context).size.height-200.0,
opacity: percentVisible, color: viewModel.color,
child:ListView( padding: const EdgeInsets.fromLTRB(0, 0, 0, 0),
children: <Widget>[ child: Opacity(
layout(context) opacity: percentVisible,
], child: ListView(
children: <Widget>[
layout(context),
],
),
)
), ),
)); Positioned(
right: -5.0,
top: 2.0,
child: creatButton(context, 'GitHub', Icons.arrow_forward, 'goGithub')
),
]
);
} }
Column layout(BuildContext context) { Column layout(BuildContext context) {
return new Column( return Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
new Transform( Transform(
transform: new Matrix4.translationValues( transform: Matrix4.translationValues(
0.0, 50.0 * (1.0 - percentVisible), 0.0), 0.0, 50.0 * (1.0 - percentVisible), 0.0),
child: new Padding( child: Padding(
padding: new EdgeInsets.only(top: 20.0, bottom: 10.0), padding: EdgeInsets.only(top: 20.0, bottom: 10.0),
child: new Image.asset(viewModel.heroAssetPath, child: Image.asset(viewModel.heroAssetPath,
width: 160.0, height: 160.0), width: 160.0, height: 160.0),
), ),
), ),
new Transform( Transform(
transform: new Matrix4.translationValues( transform: Matrix4.translationValues(
0.0, 30.0 * (1.0 - percentVisible), 0.0), 0.0, 30.0 * (1.0 - percentVisible), 0.0),
child: new Padding( child: Padding(
padding: new EdgeInsets.only(top: 10.0, bottom: 10.0), padding: EdgeInsets.only(top: 10.0, bottom: 10.0),
child: new Text( child: Text(
viewModel.title, viewModel.title,
style: new TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontFamily: 'FlamanteRoma', fontFamily: 'FlamanteRoma',
fontSize: 28.0, fontSize: 28.0,
@ -114,15 +126,15 @@ class Page extends StatelessWidget {
), ),
), ),
), ),
new Transform( Transform(
transform: new Matrix4.translationValues( transform: Matrix4.translationValues(
0.0, 30.0 * (1.0 - percentVisible), 0.0), 0.0, 30.0 * (1.0 - percentVisible), 0.0),
child: new Padding( child: Padding(
padding: new EdgeInsets.only(bottom: 10.0), padding: EdgeInsets.only(bottom: 10.0),
child: new Text( child: Text(
viewModel.body, viewModel.body,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: new TextStyle( style: TextStyle(
height: 1.2, height: 1.2,
color: Colors.white, color: Colors.white,
fontFamily: 'FlamanteRomaItalic', fontFamily: 'FlamanteRomaItalic',
@ -131,13 +143,13 @@ class Page extends StatelessWidget {
), ),
), ),
), ),
ButtonBar( // ButtonBar(
alignment: MainAxisAlignment.center, // alignment: MainAxisAlignment.center,
children: <Widget>[ // children: <Widget>[
creatButton(context, '开始使用', Icons.add_circle_outline, 'start'), // creatButton(context, '开始使用', Icons.add_circle_outline, 'start'),
creatButton(context, 'GitHub', Icons.arrow_forward, 'goGithub'), // creatButton(context, 'GitHub', Icons.arrow_forward, 'goGithub'),
], // ],
) // )
]); ]);
} }
} }