【问题标题】:How to pause the page in flutter before redirecting it如何在重定向之前暂停页面
【发布时间】:2022-07-06 12:07:13
【问题描述】:

当应用程序打开时,我希望徽标和应用程序名称弹出,并暂停几秒钟,然后重定向到下一个目录。任何人都可以帮助我,因为我是新来的颤振并且已经坚持了一段时间>_

    import 'package:flutter/material.dart';
    
    class wlcPage extends StatelessWidget {
      const wlcPage({Key? key}) : super(key: key);
    
    
      @override
      Widget build(BuildContext context) {
        return Scaffold(
          body: SafeArea(
            child: Container(
              height: double.infinity,
              width: double.infinity,
              decoration: const BoxDecoration(
                image: DecorationImage(
                    image: AssetImage('images/appBckgrd.jpg'),
                    fit: BoxFit.cover
                ),
              ),
              child: Column(
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  const CircleAvatar(
                    radius: 80,
                    backgroundImage: AssetImage("images/logo.png"),
                  ),
                  Text('signhouse',
                    style: TextStyle(
                      fontFamily: 'OpenSans',
                      fontSize: 30,
                      fontWeight: FontWeight.normal,
                      letterSpacing: 1,
                      color: Colors.teal[700],
    
                    ),
                  ),
                ],
              ),
            ),
    
          ),
        );
      }
    }

【问题讨论】:

    标签: flutter dart


    【解决方案1】:

    您可以使用Future.delayed 功能,使其等待几秒钟,然后使用Navigator.push() 显示您的其他页面。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-07-29
      • 2021-10-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多