mirror of
https://github.com/alibaba/flutter-go.git
synced 2025-06-23 23:47:45 +08:00
@ -31,7 +31,7 @@ class DisclaimerMsgState extends State<DisclaimerMsg> {
|
|||||||
var _readed = false;
|
var _readed = false;
|
||||||
|
|
||||||
//SharedPreferences 存储结果
|
//SharedPreferences 存储结果
|
||||||
Future<bool> refs(bool value) async {
|
void refs(bool value) async {
|
||||||
final SharedPreferences prefs = await _prefs;
|
final SharedPreferences prefs = await _prefs;
|
||||||
final bool unKnow = value;
|
final bool unKnow = value;
|
||||||
setState(() {
|
setState(() {
|
||||||
|
@ -46,14 +46,14 @@ class PagerIndicator extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
final BUBBLE_WIDHT = 55.0 ;
|
final bubbleWidth = 55.0 ;
|
||||||
final baseTranslation = ((viewModel.pages.length * BUBBLE_WIDHT) / 2) - (BUBBLE_WIDHT / 2) ;
|
final baseTranslation = ((viewModel.pages.length * bubbleWidth) / 2) - (bubbleWidth / 2) ;
|
||||||
var translation = baseTranslation - (viewModel.activeIndex * BUBBLE_WIDHT);
|
var translation = baseTranslation - (viewModel.activeIndex * bubbleWidth);
|
||||||
|
|
||||||
if (viewModel.slideDirection == SlideDirection.leftToRight){
|
if (viewModel.slideDirection == SlideDirection.leftToRight){
|
||||||
translation += BUBBLE_WIDHT * viewModel.slidePercent;
|
translation = bubbleWidth * viewModel.slidePercent + translation;
|
||||||
}else if (viewModel.slideDirection == SlideDirection.rightToLeft){
|
}else if (viewModel.slideDirection == SlideDirection.rightToLeft){
|
||||||
translation -= BUBBLE_WIDHT * viewModel.slidePercent;
|
translation = bubbleWidth * viewModel.slidePercent - translation;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Column(
|
return new Column(
|
||||||
|
@ -38,7 +38,6 @@ class FirstPageState extends State<FirstPage> with AutomaticKeepAliveClientMixin
|
|||||||
* 判断是否需要弹出免责声明,已经勾选过不在显示,就不会主动弹
|
* 判断是否需要弹出免责声明,已经勾选过不在显示,就不会主动弹
|
||||||
*/
|
*/
|
||||||
_unKnow.then((bool value) {
|
_unKnow.then((bool value) {
|
||||||
print("==========FirstPageState========_unKnow========${value}");
|
|
||||||
new Future.delayed(const Duration(seconds: 1),(){
|
new Future.delayed(const Duration(seconds: 1),(){
|
||||||
if (!value) {
|
if (!value) {
|
||||||
key.currentState.showAlertDialog(context);
|
key.currentState.showAlertDialog(context);
|
||||||
|
@ -73,6 +73,12 @@ class FourthPageState extends State<FourthPage> with TickerProviderStateMixin {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
super.dispose();
|
||||||
|
slideUpdateStream.close();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return new Stack(
|
return new Stack(
|
||||||
|
@ -26,7 +26,7 @@ class CupertinoAppFullDefault extends StatefulWidget {
|
|||||||
* */
|
* */
|
||||||
class _CupertinoAppFullDefault extends State {
|
class _CupertinoAppFullDefault extends State {
|
||||||
|
|
||||||
RouterHandler(setting){
|
routerHandler(setting){
|
||||||
//setting.isInitialRoute; bool类型 是否初始路由
|
//setting.isInitialRoute; bool类型 是否初始路由
|
||||||
//setting.name; 要跳转的路由名key
|
//setting.name; 要跳转的路由名key
|
||||||
return PageRouteBuilder(
|
return PageRouteBuilder(
|
||||||
@ -94,7 +94,7 @@ class _CupertinoAppFullDefault extends State {
|
|||||||
MyObserver(),
|
MyObserver(),
|
||||||
],
|
],
|
||||||
onGenerateRoute: (setting){ // 当通过Navigation.of(context).pushNamed跳转路由时,在routes查找不到时,会调用该方法
|
onGenerateRoute: (setting){ // 当通过Navigation.of(context).pushNamed跳转路由时,在routes查找不到时,会调用该方法
|
||||||
RouterHandler(setting);
|
routerHandler(setting);
|
||||||
},
|
},
|
||||||
onGenerateTitle: (context){ // 跟上面的tiitle一样,但含有一个context参数用于做本地化
|
onGenerateTitle: (context){ // 跟上面的tiitle一样,但含有一个context参数用于做本地化
|
||||||
return 'Flutter应用';
|
return 'Flutter应用';
|
||||||
|
@ -40,6 +40,7 @@ class _CupertinoIconsFullDefault extends State {
|
|||||||
flex:1,
|
flex:1,
|
||||||
child: CupertinoButton(
|
child: CupertinoButton(
|
||||||
padding: EdgeInsets.only(left: 0),
|
padding: EdgeInsets.only(left: 0),
|
||||||
|
onPressed: () { },
|
||||||
child:FlatButton.icon(
|
child:FlatButton.icon(
|
||||||
label: Text('默认按钮', semanticsLabel: 'Add'),
|
label: Text('默认按钮', semanticsLabel: 'Add'),
|
||||||
icon:Icon(itA,
|
icon:Icon(itA,
|
||||||
@ -51,6 +52,7 @@ class _CupertinoIconsFullDefault extends State {
|
|||||||
flex:1,
|
flex:1,
|
||||||
child: CupertinoButton(
|
child: CupertinoButton(
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
|
onPressed: () { },
|
||||||
child:FlatButton.icon(
|
child:FlatButton.icon(
|
||||||
label: Text('默认按钮', semanticsLabel: 'Add'),
|
label: Text('默认按钮', semanticsLabel: 'Add'),
|
||||||
icon:Icon(itB,
|
icon:Icon(itB,
|
||||||
|
@ -28,11 +28,11 @@ class _CupertinoPopupSurfaceFullDefault extends State {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
height: MediaQuery.of(context).size.height/5,
|
height: MediaQuery.of(context).size.height/5,
|
||||||
child: CupertinoPopupSurfaceBar(context)
|
child: cupertinoPopupSurfaceBar(context)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget CupertinoPopupSurfaceBar(BuildContext context) {
|
Widget cupertinoPopupSurfaceBar(BuildContext context) {
|
||||||
return CupertinoPopupSurface(
|
return CupertinoPopupSurface(
|
||||||
isSurfacePainted:false,
|
isSurfacePainted:false,
|
||||||
child: Container(
|
child: Container(
|
||||||
|
Reference in New Issue
Block a user