How to check if Flutter app in running in webview - flutter

I have built a web app in Flutter and I want to check where the app is running.
My app runs in the normal browser, in Microsoft Teams and in a WebView within another Flutter app.
In all cases the kIsWeb bool is true.
With the device_info_plus package I only get errors...
And with the web_browser_detect (on iOS) only safari back as the browser (even if it is in the webview)
Does anyone know a solution?

I think you are needing to look at userAgent. See this answer:
https://stackoverflow.com/a/67644049/233382
or this answer
How to get device user agent information in Flutter

Related

Ionic capacitor hybrid mobile application

I want to create a hybrid mobile app using ionic capacitor. When user logs in the app should open the main angular app in a hidden webview to initialize the angular app. The webview should be hidden for this time. After this when a user clicks on any links in mobile app, it should open in the webview and this time the webview should be displayed. The webview should open in the app container and not in the browser window (like InApp browser). Please help me if anybody have explored this kind of solutions.
My existing app is built using Xamarin and its built on the above concept.
I have tried the InApp browser but it does not give a good impression to the end user expecting a complete mobile app.
What you want to do is more or less possible if I've understood you well. I've done it in my job. We have a ionic app, but then there are some native screens developed natively for Android (with Java) and iOS (with Swift). With ionic you can call native code from Javascript. For that you need to make your own local Capacitor plugin: https://capacitorjs.com/docs/plugins/creating-plugins
In a plugin, the ionic Javascript function will trigger a native function (Java/Kotlin for Android - Swift/ObjectiveC for iOS). Once there, you can freely create native screens (Android = Activity, iOS = Storyboard/Controller) and then launch your native screens in the app. In our project most of the app is ionic, but we developed our own native screens such as a PDF Viewer, a Web browser, a QR scanner, etc.
But an app is not like a website, an app is a stack of screens. Which means that everytime you access a new screen, it's added to the top of the stack and the user can go back to the previous one. So, ionic will launch first. Inmediately after starting the app (or whenever you want) you can move the user to a native (android/ios) screen. However, if the user presses the native android back button, he will come back to ionic. If you want to prevent that, you need to code that behavior yourself (google android prevent back button). Likewise, you "can't" make the user go from the native screen to ionic, you can bring him back to ionic by navigating back programmatically.
Perhaps you can also change the launch activity to use a different one, and then later launch the ionic activity with native code. But I haven't done this myself and it could break ionic, so I can't advice you through this path.
I hope my answer helps, but I'm not sure I understood what you want to accomplish.

I'm using flutter : is there a way with a mobile flutter app to launch another flutter app on another device

I want, with my flutter app installed on my device, to launch an app on another device.
And share information if possible. Thanks.
from what I understood from you I can tell that you can't, the system restricts background possess you can read about it here

Flutter web apps containing tracker from UNPKG

I have just build a flutter web app - when running it in a safari browser I can see it has blocked one tracker UNPKG
Do you know why? I have not added any tracker my self. To recreate this, just create a standard flutter app: flutter create and build it to release for web.
Could it be some local to the app itself, loading some content?
Flutter downloads some fonts and CanvasKit on launch. It's the same reason sometimes you'll load the app and nothing will show until you refresh and the same reason Amazon's logo seems to vanish. The difference being Amazon is hosting their own stuff and if you're like me you don't want to rely on everyone and their brother to print hello world. The solution's here if you haven't already googled it: https://github.com/flutter/flutter/issues/70101

Flutter Web App Weird Beahvior in Desktop View on Mobile Phone

I am making a website with flutter
codingfries.com
Can someone check what the hell is happening when I click on Desktop View on chrome browser in mobile phone. The website starts to behave weirdly.
This is supposed to happen as the layout changes. Width of screen changes when you emulate Desktop view on mobile phone. For handling such cases, flutter has media queries which can be used to change layouts based on screen size changes.
For more info refer the official documentation.
https://flutter.dev/docs/development/ui/layout/adaptive-responsive

Device/Browser Details when running Flutter Web

There is a package/plugin for Flutter Mobile (Android, iOS) for retrieving the device details, in which the the flutter application is running, device_info. What i need is a package/plugin to get the Details of the Device/Browser in which the Flutter Web application is running. If anyone can steer me in the right direction, that would be great.
Get current device information from within the Flutter application, and it works for WEB as well as desktop apps
device_info_plus
you can get following details of a browser
'browserName': describeEnum(data.browserName),
More details are there in this example https://github.com/fluttercommunity/plus_plugins/blob/main/packages/device_info_plus/example/lib/main.dart#L138