我目前正在开发一个在 flutter 中使用 Google Maps Api 的应用程序。由于支持不完整,我只能使用静态地图,点击它会导致一个没有用的 Android 活动。我需要的是一张地图,我可以在其中搜索位置并向该位置添加标记。那么是否可以在原生 Java 代码中实现 Map View 并在顶部使用 Flutter 小部件显示它?
因此,我正试图为一家杂乱无章的餐厅制作送货上门的应用程序,而我的英雄动画似乎无法正常工作。首先,我创建了一个初始屏幕,其中显示徽标,然后导航到该徽标应该进行英雄转换的主页。初始屏幕和主页位于两个独立的dart文件中。这是我的初始屏幕的代码:
import 'package:flutter/material.dart';
import 'home_page.dart';
import 'dart:async';
class Splash extends StatefulWidget {
@override
_SplashState createState() => new _SplashState();
}
class _SplashState extends State<Splash> with SingleTickerProviderStateMixin
{
Animation<double> _mainLogoAnimation;
AnimationController _mainLogoAnimationController;
@override
void initState() {
super.initState();
goToHomePage();
_mainLogoAnimationController = new AnimationController(duration: new Duration(milliseconds: 2500) ,vsync: this);
_mainLogoAnimation = new CurvedAnimation(parent:
_mainLogoAnimationController, curve: Curves.easeIn);
_mainLogoAnimation.addListener(() => (this.setState(() {})));
_mainLogoAnimationController.forward();
}
Future goToHomePage() async {
await new Future.delayed(const Duration(milliseconds: 4000));
Navigator.of(context).push(new MaterialPageRoute(builder: (BuildContext context) => new HomePage()));
}
@override
Widget build(BuildContext context) { …Run Code Online (Sandbox Code Playgroud)