Flutter

unable to create new flutter project on android studio getting error => Could not find a file named “pubspec.yaml” at project location drive

帅比萌擦擦* 提交于 2021-02-11 12:26:39
问题 I installed flutter by following flutter documentation. This is the error I'm getting=> Could not find a file named "pubspec.yaml" in "E:". pub get failed (66; Could not find a file named "pubspec.yaml" in "E:". when I checked my project directory(E:\Fapplication) there was an empty folder with the project name(flutter_appp) but the android studio also created the same folder(flutter_appp) directly in the project location's drive(E:) with all contents of the project. flutter doctor -v checked

unable to create new flutter project on android studio getting error => Could not find a file named “pubspec.yaml” at project location drive

北城余情 提交于 2021-02-11 12:26:38
问题 I installed flutter by following flutter documentation. This is the error I'm getting=> Could not find a file named "pubspec.yaml" in "E:". pub get failed (66; Could not find a file named "pubspec.yaml" in "E:". when I checked my project directory(E:\Fapplication) there was an empty folder with the project name(flutter_appp) but the android studio also created the same folder(flutter_appp) directly in the project location's drive(E:) with all contents of the project. flutter doctor -v checked

Flutter Driver hangs at splash screen

只愿长相守 提交于 2021-02-11 12:26:35
问题 I am trying to setup Flutter Driver tests for my application and the app runs async so I found https://github.com/flutter/flutter/issues/41029 which says all you need to do is add await driver.waitUntilFirstFrameRasterized(); and it should work, while this does stop the test from failing it nos simply does not run. The app just hangs at the splash screen never even getting into the application itself. As far as I am understanding, this is all I would need to have setup in order for the test

Get updated State outside a Widget tree with Redux

耗尽温柔 提交于 2021-02-11 12:23:13
问题 Is it possible to get an up-to-date state from the Store outside the Widget tree? In Provider, you can easily do that by calling Provider like this and the state will update if there is any change. Provider.of<WelcomeBloc>(context) But when I call: StoreProvider.of<AppState>(context).state.currentPage; I just get the current state but it doesn't update on changes (or I am doing something wrong there) In that case, I need to use that call in a block which updates on changes... what in my

flutter desktop build fails with `com.apple.xcode.tools.swift.compiler`

蓝咒 提交于 2021-02-11 12:22:59
问题 I try to build and run flutter for desktop and I get the bellow error when I use ~/dev/flutter/bin/flutter run -v Objects-normal/x86_64/GeneratedPluginRegistrant~partial.swiftmodule -emit-dependencies-path /Users/myuser/tmp/flutter-desktop-embedding/example/build/macos/Build/Intermediates.noindex/Runner.build/Debug/Runner.build/ Objects-normal/x86_64/GeneratedPluginRegistrant.d -emit-reference-dependencies-path /Users/myuser/tmp/flutter-desktop-embedding/example/build/macos/Build

How to access flutter assets from Java

浪子不回头ぞ 提交于 2021-02-11 12:22:35
问题 This code can be used to access flutter assets from Java: String assetName = call.argument("asset"); String assetLookupKey = registrar.lookupKeyForAsset(assetName); AssetFileDescriptor fd = registrar.context().getAssets().openFd(assetLookupKey); player = new VideoPlayer(eventChannel, handle, fd, result); However, how do I get registrar ? I know FlutterActivity has this method: registrarFor(String pluginKey) But which key should I use? I'm not using any plugin, I'm trying to load the assets

How to pass and play specific queue position media item from playlist in audio_service flutter?

眉间皱痕 提交于 2021-02-11 12:22:25
问题 I am using flutter audio_service and just_audio package for music player. I want to play specific queue position media item from playlist when I initialize the music player. It is always playing first item of the playlist when I called AudioService.start() method. How can I pass and play specific queue position media item from playlist when I start the audio service? AudioService start AudioService.start( backgroundTaskEntrypoint: _audioPlayerTaskEntrypoint, androidNotificationChannelName:

VSCode not able to recognize the code (Flutter/Dart)

可紊 提交于 2021-02-11 12:22:21
问题 Till yesterday, VSCode was running fine, but after dart updated itself, VSCode has stopped recognizing my code as a language. When I type CTRL+F5, it pops up asking to select a compiler. The code runs fine, but it is not able to recognize it. Side note, it works in Android Studio. Updating the pubspec.yaml file just removes errors but the code is still not recognized. Popup: https://i.stack.imgur.com/c2WZR.png No syntax highlighting/nothing: https://i.stack.imgur.com/EmtiU.png P.S: It

How to confirm app exit when appbar back button is pressed

大兔子大兔子 提交于 2021-02-11 12:22:01
问题 I want to confirm exiting the app when the back button on the appbar is pressed. appBar: AppBar( leading: IconButton( icon: Icon( Icons.arrow_back_ios, color: Colors.white, ), onPressed: () { showDialog( context: context, builder: (context) { return AlertDialog( title: Text('Save and Exit?'), content: Text('are you sure you want to save and exit?'), actions: [ FlatButton( onPressed: () => Navigator.pop(context, false), child: Text('No'), ), FlatButton( onPressed: () => Navigator.pop(context,

Template file evaluation in flutter

旧街凉风 提交于 2021-02-11 12:12:27
问题 I am loading some text from a file in a String variable in my code. This text has certain values that must be filled-in dynamically from a Map. When I use a String directly in my code, it works fine as desired. But when the same string is loaded from the file, it does not perform the required string interpolation. Consider this for string interpolation - String parseText(Map<String, dynamic> ctx){ return "My name is ${ctx['employee'].name} and I joined today, ${ctx['today']}"; } This works