python欢迎界面_欢迎页 - CrossPython - 博客园

import 'package:flutter/material.dart';

import 'package:intro_slider/intro_slider.dart';

import 'package:shared_preferences/shared_preferences.dart';

main()=> runApp(MaterialApp(

home: SplashScreen(),

));

class SplashScreen extends StatefulWidget {

@override

State createState() {

return new SplashScreenState() ;

}

}

class SplashScreenState extends State {

List slides = new List();

@override

void initState() {

super.initState();

slides.add(

new Slide(

title: "Flutter",

description:

"Flutter是谷歌的移动UI框架,可以快速在iOS和Android上构建高质量的原生用户界面。 Flutter可以与现有的代码一起工作。在全世界,Flutter正在被越来越多的开发者和组织使用,并且Flutter是完全免费、开源的。",

styleDescription: TextStyle(

color: Colors.white,

fontSize: 20.0,

fontFamily: 'Raleway'),

marginDescription: EdgeInsets.only(left: 20.0, right: 20.0, top: 20.0, bottom: 70.0),

colorBegin: Color(0xffFFDAB9),

colorEnd: Color(0xff40E0D0),

directionColorBegin: Alignment.topLeft,

directionColorEnd: Alignment.bottomRight,

),

);

slides.add(

new Slide(

title: "Wanandroid",

description:

"这是一款使用Flutter写的WanAndroid客户端应用,在Android和IOS都完美运行,可以用来入门Flutter,简单明了,适合初学者,项目完全开源,如果本项目确实能够帮助到你学习Flutter,谢谢start,有问题请提交Issues,我会及时回复。",

styleDescription: TextStyle(

color: Colors.white,

fontSize: 20.0,

fontFamily: 'Raleway'),

marginDescription: EdgeInsets.only(left: 20.0, right: 20.0, top: 20.0, bottom: 70.0),

colorBegin: Color(0xffFFFACD),

colorEnd: Color(0xffFF6347),

directionColorBegin: Alignment.topLeft,

directionColorEnd: Alignment.bottomRight,

),

);

slides.add(

new Slide(

title: "Welcome",

description:

"赠人玫瑰,手有余香;\n分享技术,传递快乐。",

styleDescription: TextStyle(

color: Colors.white,

fontSize: 20.0,

fontFamily: 'Raleway'),

marginDescription: EdgeInsets.only(left: 20.0, right: 20.0, top: 20.0, bottom: 70.0),

colorBegin: Color(0xffFFA500),

colorEnd: Color(0xff7FFFD4),

directionColorBegin: Alignment.topLeft,

directionColorEnd: Alignment.bottomRight,

),

);

}

void onDonePress() {

_setHasSkip();

Navigator.of(context).pushAndRemoveUntil(

new MaterialPageRoute(

builder: (context) => App()),

(route) => route == null);

}

void _setHasSkip ()async {

SharedPreferences prefs = await SharedPreferences.getInstance();

await prefs.setBool("hasSkip", true);

}

@override

Widget build(BuildContext context) {

return IntroSlider(

slides: this.slides,

onDonePress: this.onDonePress,

nameSkipBtn: "跳过",

nameNextBtn: "下一页",

nameDoneBtn: "进入",

);

}

}

class App extends StatelessWidget {

@override

Widget build(BuildContext context) {

// TODO: implement build

return Scaffold(

appBar: AppBar(title: Text('sss'),),

body: Text('sss'),

);

}

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值