Using brave browser to debug flutter web app - flutter

I just started-off with flutter web and I want to use brave browser to debug my flutter apps not chrome or edge.
When I use flutter devices command, it gives the following result.
No devices detected.
Run "flutter emulators" to list and start any available device emulators.
I'm using brave by using the link provided by web-server and it does not support hot reload.
So, how to configure browsers other than chrome or edge with flutter web for complete functionality.

I found this:
All you have to do, based on your Linux operating system (for Windows
and macOS the process is similar), is to modify your .bashrc file and
insert this line:
#Put your Brave installation location here
export CHROME_EXECUTABLE="/opt/brave.com/brave/brave-browser"
For MacOs,
export CHROME_EXECUTABLE="/Applications/Brave Browser.app/Contents/MacOS/Brave Browser"

You can use flutter run -d web-server to run your app like a server.
This means that you can just enter the URL on any browser of your choice to access your Flutter app !
Drawbacks:
Hot Restart/Reload from the terminal is not possible. You must refresh the page on your browser instead.
Advantages:
You can use any browser for developing flutter apps.
You can even use ngrok to forward your port to a HTTPS URL, and access your flutter app from anywhere (your phone, your desktop , someone else's device etc.)
PS: Credits to the Issue #77229 for helping me find this solution. I am aware that this workaround has already been suggested on this thread.
I just wanted to put out a simpler answer for the general viewer.

I've been diving in the same issue, it's known Brave it's Chromium-based, this will help u https://github.com/flutter/flutter/issues/77229

Related

Attempting to connect to browser instance.. (Flutter Web)

I'm trying to run my first flutter code on the web. I followed setup instructions provided in Building a web application with Flutter and created a very simple app, that's only supposed to display a navigation bar. Now as I'm running my application for the first time on "Chrome (web)" device, it won't connect to the browser. It's been almost 20 minutes and it's still telling me "Attempting to connect to browser instance".
> flutter run -d chrome
Launching lib\main.dart on Chrome in debug mode...
Building application for the web... 1215.1s
Attempting to connect to browser instance..
(This is taking an unexpectedly long time.)
Can anyone guide me on how to fix this?
In my case, I couldn't disable the virus guard. So I used the server mode.
flutter run -d web-server
Launching lib\main.dart on Web Server in debug mode...
Building application for the web... 8.8s
lib\main.dart is being served at http://localhost:57598/
Then go to the URL shown.
The same thing happened to me, I disabled the anti virus and it worked
It's mostly nothing to do with Flutter but, it's either because you have logged in your computer in safe mode. In my case the shift key was stuck and I had no idea I was in safe mode.
Or else You need to check your firewall, go to System Preferences > Security and Privacy > Firewall --click the lock below and enter your system password -- and then click firewall option -- In there add your editor to allow internet connection for android studio Or VS Code.
I experienced the something similar, chrome opens but never showed the web app (just white screen). In my case it had to do with the interaction of flutter and riverpod.
If you are using riverpod 1.0.0 and flutter 2.5.3 you need to update flutter to 2.8.0 or 2.8.1 (see this issue: https://github.com/rrousselGit/river_pod/issues/889)

Ionic 3, HTTP native vs. HttpClient

I am struggling to make HTTP native or HttpClient get to work for my app.
If I run ionic serve -c I get HttpClient working good on my browser at localhost:8100 and in Ionic Dev App. If I build for Android though, HttpClient fails thus I decided to give HTTP Native a try.
Then I don't understand how I could get some console log if that native plugin is not supported from Ionic Dev App (here says), neither I can see on my browser cause of Cordova is not present.
Is there a way to log on a device to debug HTTP Native?
You should debug your application connect your phone to your laptop and
Open your Google Chrome Browser
Go to Inspect (Ctrl + Shift +I)
Go To More Tools enter image description here
Open Remote devices and inspect your device
For more information click here
Thanks
You wont see native http calls log to the browser since they are called native from the device and never are called from the browser, but if you are debugging while connected to xcode, the xcode debugging output should give some information about your native HTTP calls success and failure.
Following #vd_virani answer, here is a quick link to inspect a device from Chrome
chrome://inspect/#devices
Plug your device via USB, then copy & paste this link in your Chrome address bar like a website.

How to use chrome remote debugging with ionic framework?

So I'm reading in this link and it says we can use chrome for remote debugging an app which seeems great but they don't explain how to do it. When I click in the link they provide which has some android documentation, I just see java code. As a non java-developer I wonder how can I use remote debugger in chrome for ionic framework?
To access remote debugging of a webview on your phone, plug your phone into your pc and go to chrome. then type: chrome://inspect into the url bar. open your app on your phone and it should show your device on the inspect dashboard.

Is there anyway to use on-screen keyboard with ionic serve?

I like to use ionic servecommand for quick changes I know nothing better than actual device for developing. But I would really like to use just the on-screen device keyboard instead of my computers hardware keyboard, is this possible? I searched in ionic forums and online with no success.
It is not possible, but other option is to use this command (change platform according to your requirement) : ionic run android -l -c
This will run application in you mobile but same like ionic serve, any change on your computer will refresh application in your device.For this your mobile and computer should be on same network. Plus keep mobile connected through usb port while you are running application on mobile. Because all resources are served from computer.
See this answer for more detailed version.
Here is documentation link to live reload app feature of ionic cli.

Running Instagram on AVD

I wanted to use Instagram on my computer, so I decided to use an Android Virtual Device for that task.
I downloaded the Android SDK and the newest apk for instagram for my computer.
Then I created a new AVD and ran it. After it was booted, I installed the instagram apk using adb install instagram.apk.
It installed smoothly and after clicking the app, it started.
Now here's my problem: From there on nothing works.
When I try to login and I press the login button, nothing happens like there would be no internet connection.
Browsers and other apps using an internet connection work just fine, just instagram doesn't work.
How can I fix this?
I think it has something to do that the android Emulator can't really handle a global proxy.
Therefore hostnames get resolved directly to their IP which violates HTTP 1.1 standarts and the request doesn't get send properly.
To fix this, it is needed to change it so the hostname gets send instead of the IP.
You should try creating an AVD with different settings. More RAM and allowing GPU emulation is a good idea. If you insist on using an AVD and you have an appropriate intel CPU then you can make the emulator run much faster by following these steps. They are a bit complicated, but worth it if you want the emulator to run quicker.
I typically try to avoid using the Android emulator while I am developing apps. It has its uses, but it tends to be slow and doesn't have all of the capabilities of actual devices.
As an alternative to using an AVD, I would recommend downloading and installing BlueStacks. BluesStacks was written from the ground up to allow running Android apps on your Windows PC or Mac. I have used it before and it does a great job. Much better than an AVD.
Try visual studio emulator for android. Instagram works on it with enabled and connected wifi. This emulator works better than BlueStacks.