APP启动引导图

maogu8个月前Flutter130
import 'package:flutter/material.dart';
import 'package:intro_views_flutter/Models/page_view_model.dart';
import 'package:intro_views_flutter/intro_views_flutter.dart';

class OnBoardingPage extends StatelessWidget {
  final _pages = [
    PageViewModel(
        pageColor: const Color(0XFFFAB4AA),
        bubbleBackgroundColor: Colors.,
        titleTextStyle: TextStyle(fontWeight: FontWeight., fontSize: 25),
        bodyTextStyle: TextStyle(fontSize: 18, color: Colors.),
        title: Text('第一页'),
        body: Text('无暇精彩\n尽在这里'),
        mainImage: Image.asset('asset/01.jpg')),
    PageViewModel(
        pageColor: const Color(0xFFe9d569),
        bubbleBackgroundColor: Colors.,
        titleTextStyle: TextStyle(fontWeight: FontWeight., fontSize: 25),
        bodyTextStyle: TextStyle(fontSize: 20, fontWeight: FontWeight.),
        title: Text('第一页'),
        body: Text('无暇精彩\n尽在这里'),
        mainImage: Image.asset('asset/02.jpg')),
    PageViewModel(
        pageColor: const Color(0xFF82bead),
        bubbleBackgroundColor: Colors.,
        titleTextStyle: TextStyle(fontWeight: FontWeight., fontSize: 25),
        bodyTextStyle: TextStyle(fontSize: 20, fontWeight: FontWeight.),
        title: Text('第一页'),
        body: Text('无暇精彩\n尽在这里'),
        mainImage: Image.asset('asset/03.jpg')),
  ];

  @override
  Widget build(BuildContext context) {
    return IntroViewsFlutter(
      _pages,
      skipText: Text(
        '跳过 ',
        style: TextStyle(color: Colors.),
      ),
      doneText: Text(
        '完成',
        style: TextStyle(color: Colors.),
      ),
      onTapDoneButton: () {
        Navigator.(context, 'choose');
      },
    );
  }
}
import 'dart:async';

import 'package:flutter/material.dart';

class SplashScreenPage extends StatefulWidget {
  @override
  _SplashScreenPageState createState() => _SplashScreenPageState();
}

class _SplashScreenPageState extends State<SplashScreenPage> {
  setTime() {
    Timer(Duration(milliseconds: 2000), () {
      Navigator.pushReplacementNamed(context, 'onBoarding');
    });
  }

  @override
  void initState() {
    setTime();
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(
        decoration: BoxDecoration(
          image: DecorationImage(
              image: AssetImage('asset/main.jpg'), fit: BoxFit.cover),
        ),
        child: Container(
          decoration: BoxDecoration(
              gradient: LinearGradient(
                  colors: [
                Color.fromRGBO(0, 0, 0, 0.3),
                Color.fromRGBO(0, 0, 0, 0.4)
              ],
                  begin: FractionalOffset.topCenter,
                  end: FractionalOffset.bottomCenter)),
          child: Center(
            child: SingleChildScrollView(
              child: Column(
                children: [
                  Text(
                    'demo',
                    style: TextStyle(
                        fontSize: 30,
                        fontWeight: FontWeight.bold,
                        color: Colors.white),
                  ),
                  SizedBox(
                    height: 10,
                  ),
                  Text('更懂你的动漫APP,更多漫画尽在这里',
                      style: TextStyle(
                          fontSize: 20,
                          fontWeight: FontWeight.bold,
                          color: Colors.white)),
                ],
              ),
            ),
          ),
        ),
      ),
    );
  }
}


相关文章

Flutter provider使用案例

main.dartimport 'package:demo_provider/WeatherInfo.dart'; import 'package:flu...

[Flutter]md5加密

dart有内置的md5加密包,先引入头文件: import 'dart:convert'; import 'package:convert/convert.dart'...

Flutter Api 数据调用

class BannerItem {   final String title;   final Stri...

世界时间api

void getData() async{  Response response= await get('http://world...

表单提交

import 'package:flutter/material.dart'; class PersonPage extends Stat...

Flutter开发环境搭建Mac版

这里我们可能会遇到一个问题,就是提示zsh: command not found: flutter这说明我们上面配置flutter命令没有成功,检测一下路径是否有问题,可以cd到/Users/用户名/...

发表评论    

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。