Xav*_* VZ 2 android android-animation ios flutter flutter-animation
我遇到了这个 tematic 的问题,我想在一段时间后更改一个小部件。例如,我有这个 animationFlutter 屏幕(屏幕 1),然后在动画结束后,我想将屏幕更改为我拥有的任何屏幕。登录();
有小费吗?谢谢。
import 'package:flutter/material.dart';
import 'dart:async';
void main() => runApp(AnimatedFlutterLogo());
class AnimatedFlutterLogo extends StatefulWidget {
@override
State<StatefulWidget> createState() => new _AnimatedFlutterLogoState();
}
class _AnimatedFlutterLogoState extends State<AnimatedFlutterLogo> {
Timer _timer;
FlutterLogoStyle _logoStyle = FlutterLogoStyle.markOnly;
_AnimatedFlutterLogoState() {
_timer = new Timer(const Duration(milliseconds: 800), () {
setState(() {
_logoStyle = FlutterLogoStyle.horizontal;
});
});
}
@override
void dispose() {
super.dispose();
_timer.cancel();
}
@override
Widget build(BuildContext context) {
return new FlutterLogo(
size: 200.0,
textColor: Colors.white,
style: _logoStyle,
);
}
}
Run Code Online (Sandbox Code Playgroud)
尝试这个,
_Act_NotificationScreenState() {
_timer = new Timer(const Duration(milliseconds: 800), () {
setState(() {
_logoStyle = FlutterLogoStyle.horizontal;
});
_timer = new Timer(const Duration(seconds: 1), () {
Navigator.push(context, MaterialPageRoute(builder: (context) => Act_Login()));
});
});
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3346 次 |
| 最近记录: |