我有一个main.dart文件,我正在其中构建一个HomePage()带有抽屉、列表图块和地图的文件。我已经在另一个 dart 文件中实现了谷歌地图插件(参见下面的代码),我只是MapPage()在HomePage().
现在,当我通过调用函数按下抽屉中的列表图块之一时,我需要为相机设置动画goToLoyola(),所以我的问题是,如何从 访问此函数HomePage()?
抱歉,我觉得我的问题很糟糕,但我是新人,仍在学习颤振。谢谢。
class MapPage extends StatefulWidget {
@override
_MapPageState createState() => _MapPageState();
}
class _MapPageState extends State<MapPage> {
GoogleMapController _controller;
LatLng _currentLocation;
CameraPosition _initialCameraLocation;
StreamSubscription _locationSubscription;
Location _location = new Location();
String error;
goToLoyola() {
_controller.animateCamera(CameraUpdate.newCameraPosition(_loyolaCampus));
}
@override
void initState() {
super.initState();
initPlatformState();
_locationSubscription =
_location.onLocationChanged().listen((newLocalData) {
setState(() {
_currentLocation =
LatLng(newLocalData.latitude, newLocalData.longitude);
_initialCameraLocation = CameraPosition(
target: _currentLocation,
zoom: CAMERA_ZOOM,
tilt: CAMERA_TILT,
bearing: CAMERA_BEARING, …Run Code Online (Sandbox Code Playgroud) 

Windows 防火墙允许使用 Android Studio。
试着 :
这些都不起作用。请帮我。
我错过了什么?
android intellij-plugin android-studio flutter-plugin android-studio-3.5.1
最近我打开了我的旧项目,现在有一个警告说以前没有发生过这样的事情
警告看起来像
Warning
??????????????????????????????????????????????????????????????????????????????
Your Flutter application is created using an older version of the Android
embedding. It's being deprecated in favor of Android embedding v2. Follow the
steps at
https://flutter.dev/go/android-project-migration
to migrate your project.
Run Code Online (Sandbox Code Playgroud)
颤振医生 -v 总结
[?] Flutter (Channel stable, 1.22.2, on Mac OS X 10.15.3 19D76, locale en-GB)
• Flutter version 1.22.2 at /Users/pkimac/Development/flutter
• Framework revision 84f3d28555 (6 weeks ago), 2020-10-15 16:26:19 -0700
• Engine revision b8752bbfff
• Dart version 2.10.2
[?] Android toolchain - develop …Run Code Online (Sandbox Code Playgroud) 当您尝试在发布模式下构建 apk 时,许多插件无法正常工作,但这些插件在调试模式下工作正常
有些人建议将 gradle 版本更改为 3.5 ,但有时使用的插件可能与相同的不兼容 file_picker_cross
其他人建议--no-shrink在构建 apk 时使用选项,即flutter build apk --release --no-shrink
这些解决方案都不适合我,我发现这个解决方案隐藏在 github 问题对话中
检查下面的解决方案
dart flutter flutter-dependencies flutter-plugin flutter-platform-channel
由于 Flutter 中没有实现 AdSense 的包,所以我决定创建一个本地插件。这非常简单,小部件是一个IFrameElement. 我确保在创建插件时指定它仅支持 Web,因为IFrameElement需要import 'dart:html',但每当我尝试编译/构建移动版本时,它都会失败,因为它尝试将插件与dart:html. 我怎样才能解决这个问题?
插入:
import 'dart:html' as html show window;
import 'dart:html';
import 'dart:ui' as ui;
import 'package:flutter/material.dart';
import 'package:flutter_web_plugins/flutter_web_plugins.dart';
import 'adsense_platform_interface.dart';
/// A web implementation of the AdsensePlatform of the Adsense plugin.
class AdsenseWeb extends AdsensePlatform {
/// Constructs a AdsenseWeb
AdsenseWeb();
static void registerWith(Registrar registrar) {
AdsensePlatform.instance = AdsenseWeb();
}
Widget adsenseAdsView(double width, double height) {
ui.platformViewRegistry.registerViewFactory(
'adViewBlock',
(int viewID) => IFrameElement()
..width = …Run Code Online (Sandbox Code Playgroud) dart-html flutter flutter-plugin flutter-platform-channel flutter-html
升级到版本 2022.3.1 (Giraffe) 后,我在 Mac Intel 上的 Android Studio 停止生成 Flutter 项目。我尝试完全清除 Android Studio 并重新安装 - 相同的结果。Flutter 和 Dart 插件均已安装。Flutter 已安装(3.10.6),并flutter doctor给了它一个奇怪的东西:Android Studio 插件(它们是),它说:
Android Studio (version 2022.3)\n \xe2\x80\xa2 Android Studio at /Applications/Android Studio.app/Contents\n \xe2\x80\xa2 Flutter plugin can be installed from:\n https://plugins.jetbrains.com/plugin/9212-flutter\n \xe2\x80\xa2 Dart plugin can be installed from:\n https://plugins.jetbrains.com/plugin/6351-dart\n \xe2\x80\xa2 Java version OpenJDK Runtime Environment (build\n 17.0.6+0-17.0.6b829.9-10027231)\nRun Code Online (Sandbox Code Playgroud)\n通过创建项目flutter create按预期
症状如下:
\n我已经有这个问题几个月了。
Android Studio 3.2(最新版本)
Flutter 0.8.2 • channel beta • https://github.com/flutter/flutter.git
Framework • revision 5ab9e70727 (4 weeks ago) • 2018-09-07 12:33:05 -0700
Engine • revision 58a1894a1c
Tools • Dart 2.1.0-dev.3.1.flutter-760a9690c2
Running flutter doctor...
Doctor summary (to see all details, run flutter doctor -v):
[?] Flutter (Channel beta, v0.8.2, on Mac OS X 10.13.6 17G65, locale en-US)
[?] Android toolchain - develop for Android devices (Android SDK 28.0.2)
[?] iOS toolchain - develop for iOS devices (Xcode 10.0)
[?] Android Studio …Run Code Online (Sandbox Code Playgroud) 在 flutter 应用程序中,我使用 Url_launcher 依赖项打开电话应用程序,并使用以下函数 Url_launcher.launch("tel:\*5*250#" ) 拨号。它确实打开了应用程序,但没有拨打 # 符号,其他一切正常......任何解决方法都包括 # ???
该multi_image_picker: 2.4.11插件返回 a List<Asset>,每个Asset都有一个imageData属性是 a ByteData。
我如何在 Flutter 中显示这些?
我想在我的应用程序中使用 flutter-web 插件。但是,当我将其添加到 YAML 文件时,我收到以下 SDK 错误。我刚刚升级到1.20.4
\n我该如何修复这个错误?
\n当前的 Flutter SDK 版本是 1.20.4。
\n由于应用程序依赖于 webview_flutter >=1.0.0,需要 Flutter SDK 版本 >=1.22.0 <2.0.0,版本解析失败。\npub 失败 (1; 因为应用程序依赖于 webview_flutter >=1.0.0,需要 Flutter SDK version >=1.22.0 <2.0.0,版本解析失败。)
\nDoctor 摘要(要查看所有详细信息,请运行 flutter doctor -v):\n[\xe2\x9c\x93] Flutter(频道稳定,1.20.4,在 Mac OS X 10.15.6 19G2021 上,区域设置 en-US)
\n[\xe2\x9c\x93] Android 工具链 - 为 Android 设备开发(Android SDK 版本 28.0.3)\n[\xe2\x9c\x93] Xcode - 为 iOS 和 macOS 开发 (Xcode 12.0)\n[\xe2\ x9c\x93] Android Studio(版本 3.6)\n[\xe2\x9c\x93] VS Code(版本 1.49.2)\n[\xe2\x9c\x93] 连接的设备(1 个可用)
\n\xe2\x80\xa2 未发现问题! …