Is Call Stack / Stack Frame Debugging Available for Flutter Web? - flutter

When debugging the Android build, I can get the call stack / stack frames to show up in Flutter DevTools and Android Studio's debug tab.
However, if the target is Flutter Web, then the stack will not show up in either DevlTools or Android Studio - but Flutter Inspector still works in both.
In the attached pic: we see that the execution has paused at a break point in Android Studio because the "step over..." buttons are enabled. However, the "Frames" window is still empty and shows "frames not available". Same thing with DevTools.
My question is: Does Flutter Web support the ability to view the call stack via debuggers?
Documentation seems to suggest that it should be possible...not sure if I missed something.
Version: Flutter 2.10.4 (2022-03-25)

Found the answer:
https://github.com/flutter/flutter/issues/101224
Looks like this is an issue with the latest Chrome update (100.0.4896.75). Just so happens that this is the first time I tried to use debugger w/ Flutter Web, so I just assumed that it never worked to start with. I will either downgrade my Chrome or wait for an an official update.

Related

Android Studio: errors in Dart are not showing on the screen

I created a new project in Android Studio Bumble Bee. However when I enter some code that has errors in it the error is not showing up.
For example if I enter the following:
import './screens/authorization/auth_root_screen.dart';
When this directory or screen doesn't exist no error is shown.
Or even if I enter some code with a typo...
iiiiiiiiiiiiiiiiiiiiimport './screens/authorization/auth_root_screen.dart';
No error is shown in the IDE.
I guess I am missing a setting somewhere but I havent been able to find it. This always worked fine before I installed BumbleBee.
Any help would be gratefully received.
Thanks so much.
Hi thanks for looking at this. I have solved it myself. I'll post the solution here in case anyone has a similar question.
Do the following:
At the bottom of the Android Studio IDE is a tab called: Dart Analysis. Click on it to open the tab.
On the left hand side of the Dart Analysis screen that opens is a settings Icon. Click on this.
On the settings screen, make sure that "Scope Analysis to the Current Package" is ticked on.
Here is a screen print:
Have you installed the Flutter extension for your Android Studio? You can find it in the Extensions section of your IDE.
Come do these things
First, run this Flutter Doctor code in the terminal, be sure to check all the options
Specify the second SDK FLutter for Android Studio
Third, install the Dart and Flutter plugins

How to disable Android emulator console log debug message in Flutter?

When using Android ARM emulator in Flutter, a lot of no useful debug message are spewing out. (See screenshot below)
How to disable Android emulator console log debug message in Flutter?
I think your solution could be folding up lines with same substring you may go through below process. It may help you
In Android Studio
Go to Settings
Click Editor
Select Console
here you will find line saying
fold console line that contains :
Just add the line to this list and check whether it helped you or not.
Ref. Image

Flutter: MissingPluginException when calling plugin from isolate spawned by native code

I'm building a Flutter app that will have the capability to execute some actions when the device connects to another bluetooth device. This app should work on Android and iOS but for the sake of simplicity I'll focus on Android in this post. Also, this has to work whether the app is in the foreground, in the background or killed.
Here is the architecture of the app:
I have an Android native code that registers to bluetooth events through a BroadcastReceiver.
I followed this tutorial to set up the communication between the Android code and the Flutter code: https://medium.com/#chetan882777/initiating-calls-to-dart-from-the-native-side-in-the-background-with-flutter-plugin-7d46aed32c47.
When the Android BroadcastReceiver is triggered by a bluetooth event, the information is sent to the Flutter code (even if the app was in the background or killed). A Flutter isolate is created to handle the Flutter code.
Everything works perfectly well. The Flutter code is called and I can use print(data) to log the data that have been provided by the Android code.
Things are becoming more tricky when, from the isolate, I want to call any Flutter plugin (like sqflite, package_info_plus, ...). I get this error every time:
[ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception:
MissingPluginException(No implementation found for method xxx on
channel yyy)
I understand that spawned isolate can't natively run Flutter plugins. There are some posts (Unable to understand Flutter Isolate workaround for "'Window_sendPlatformMessage' (4 arguments) cannot be found" error, https://github.com/flutter/flutter/issues/13937) that explain how to create isolates that can run Flutter plugins by using a workaround or a plugin like https://pub.dev/packages/flutter_isolate.
However, I can't create the isolate with this package because the isolate is created from the Android code.
Can one of you tell me how I can achieve this? Is there a way to use Flutter plugins from an isolate that has been created by native code?
Thank you very much in advance
Sounds like the way you create the Flutter isolate may not be compatible with your goal. There are some solutions to integrate Flutter with native Android/iOS projects, such as flutter_boost (disclaimer: I have not tried it and not sure good or not; you may find many other alternatives as well, this is just an example). You can use that to create the Flutter environments. Since the solutions above allow some Android code to open a new normal Flutter page and Flutter code in that page is able to do anything (of course include calling native - otherwise things like flutter_boost is really useless), this should work.

Flutter printing invoice to usb printer in desktop app

I'm working on flutter desktop app and i need to print invoice to USB printer.
https://pub.flutter-io.cn/packages/printing
Currently i m using this plugin but not working, it only shows pdf view with loading indicator only. not loading the invoice view i created.
https://pub.dev/packages/flutter_usb_write. This is another plugin i've tried so far but when running the app is shows exception stated unable to find method implementation for detecting usb connected devices.
Please help me solving this issues or suggest me some another solution or plugin.
Thanx.
Flutter desktop has been launched as stable earlier this year. Perhaps you may want to try running a desktop build again using the latest Flutter version. Simply run flutter upgrade to update the Flutter version that you're running on. Currently, the printing plugin is one of the stable printer plugins on Flutter.
If the issue persists, please include the logs from the app. This should give indicators if the app is able to communicate with the printer or if there's any issues with the document that you're trying to print.

Chrome DevTools - SQL query not executed

I try to execute an SQL query with Chrome DevTools for an Android app, but it's not possible, because enter button moves the cursor to the next line instead of executing a commend. It worked some time ago.
I reinstalled Chrome, removed all Chrome data and reinstalled, used Chromium browser, but still no result.
All the other functions of DevTools are working correctly, e.g. networking, database preview.
It's happening with different apps and devices.
Could anyone help?
This is a bug in new versions of Chrome. So far, the only workaround I found is to download an earlier version, 71, for example from here:
https://www.slimjet.com/chrome/google-chrome-old-version.php
You can look here for a detailed discussion:
https://github.com/facebook/stetho/issues/634