what i want is to get the top bar when I launch URL inappwebview, where it shows Done Mobile.twitter.com aA and refresh icon
So I've tried
await launchUrl(
Uri.parse(url),
mode: LaunchMode.inAppWebView,
);
as well as downgraded url_launcher and tried this
launch(url,
forceWebView: true, forceSafariVC: true, enableJavaScript: true);
None seem to work,
I keep getting the website without the appbar with Done, refresh on top of it
I encountered the same problem when upgrading from using the deprecated launch(url) method to launchUrl(uri).
All it needs is to pass the LaunchMode as below.
launchUrl(Uri.parse(url), mode: LaunchMode.externalApplication )
Related
Can you show me the right way to solve my problem?
I want to run a webpage in the application and disable the screen response to user actions. (read only)
I run the page using the code:
String _url = 'https://google.com
await launch(
_url,
enableJavaScript: true,
forceWebView: true,
forceSafariVC: true,
)
But I can't cope with making this page insensitive to user actions (buttons, zooming, etc.). I've tried:
Enable "launch" in ignoring or absorbing. Did not work.
I tried to run a URL as a background and then put an inactive transparent button on it. I failed to.
I have no idea how to bite it.
use webview_flutter instead it gives you more control over the web screen
I am using the plugin url_launcher in my Flutter app. It is working fine, but it works different on Android and on iOS devices.
The used URL proposes the download of a PDF file on Android and shows the PDF on iOS.
This is the code:
_launchURL(String codigo) async {
String url = 'https://...pdftest.php?cod='+codigo;
if (await canLaunch(url)) {
await launch(url,forceWebView: true, enableJavaScript: true,enableDomStorage: true);
} else {
throw 'Could not launch $url';
}
}
Here you have the output on iOS:
On Android, the output without the parameters
forceWebView: true, enableJavaScript: true,enableDomStorage: true
the output is as follows:
Is there a way to force the PDF show on Android? Or should I download the file and then open it from the device?
You can open PDF in Google Docs Viewer to make both behave the same
http://docs.google.com/gview?embedded=true&url=<URL>
Here I want to download image which comes through APIs in Flutter. I set edit image functionality and download that edited image. I mean I want to download image with set different widgets on image.
How to accomplish this in flutter?
You can use a Network image to display image Urls that are returned from an API:
const Image(
image: NetworkImage('YOUR IMAGE URL HERE'),
)
You can check;
https://pub.dev/packages/flutter_downloader
Shortly:
final taskImage = await FlutterDownloader.enqueue(
url: 'your url',
savedDir: 'download path',
showNotification: true, // Show download progress
openFileFromNotification: true, // Click on notification to open file
);
How to go back to previous screen when no back button available on screen?
Additional Information: I am trying to automate integration testing for flutter app. There is no back button on screen which I can use to go back screen.
Additional information: I am writing integration tests, for same I need to go back to previous screen. And due to design there is no back button on screen, I need to do by scripts only.
This is what worked for me for OpenContainers from the animations package:
final NavigatorState navigator = tester.state(find.byType(Navigator));
navigator.pop();
await tester.pump();
It's used in the flutter package's tests:
https://github.com/flutter/packages/blob/63040337424f345452a5e07632774e6585329ac0/packages/animations/test/open_container_test.dart#L234
If the purpose of the test is to stress and verify the WillPopScope callbacks as well, the following approach can be used:
final dynamic widgetsAppState = _._tester.state(find.byType(WidgetsApp));
await widgetsAppState.didPopRoute();
This is used in the Flutter official repository for testing: https://github.com/flutter/flutter/blob/master/packages/flutter/test/material/will_pop_test.dart
Note that this approach also works to simulate a back button pressed on Android.
Well, it's maybe a little bit late, however there are two possible ways to achieve this:
final backButton = find.byTooltip('Back');
await driver.tap(backButton);
or:
await driver.tap(find.pageBack());
you can use like this as ios provided
theme: ThemeData(
pageTransitionsTheme: PageTransitionsTheme(
builders: {
TargetPlatform.android: CupertinoPageTransitionsBuilder(),
TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
}
)
),
My emulador defaulf locale is "en_US" so I use the word "Back" as tooltip and it is working.
final backButton = find.byTooltip("Back");
await tester.tap(backButton);
await tester.pumpAndSettle();
I want converse.js such that it should work properly in mobile browser.
converse.initialize({
websocket_url: webSocketUrl, // ConnectionUrl
keepalive: true,
message_carbons: true,
message_archiving: 'roster',
//play_sounds: true,
auto_login: true,
jid: user,
password: password,
show_controlbox_by_default: false,
auto_list_rooms:true,
allow_logout: false,
allow_registration: false,
});
Can we set in config?
I finally got the answer , i removed "this.chatboxviews.trimChats();" from $(window).on("resize") function in converse.js.The main issue was when we open the chat box it opens the android keyboard on focus which resizes the window and minimize the chat box ,where as in IOS it doesnt happen like that it doesnt open keyboard on focus. So, finding the main cause of the issue solved my problem.