flutter


How do I open a web browser (URL) from my Flutter code?


I am building a Flutter app, and I'd like to open a URL into a web browser or browser window (in response to a button tap). How can I do this?
Thanks!
This is now implemented as Plugin
https://pub.dartlang.org/packages/url_launcher
Example:
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
void main() {
runApp(new Scaffold(
body: new Center(
child: new RaisedButton(
onPressed: _launchURL,
child: new Text('Show Flutter homepage'),
),
),
));
}
_launchURL() async {
const url = 'https://flutter.io';
if (await canLaunch(url)) {
await launch(url);
} else {
throw 'Could not launch $url';
}
}
You can use the UrlLauncher to do something like this:
new FlatButton(
textColor: style.mainTheme.accentColor,
child: new Text(signInLabel, style: style.largeText),
onPressed: () {
UrlLauncher.launch('http://www.webpage.com');
}
);
After some search, this issue can be solved via instructions listed here: https://groups.google.com/forum/#!topic/flutter-dev/J3ujgdOuG98
The above UrlLauncher is no longer usable.

Related Links

PageView with horizontal, non-filled children
How to navigate between flutter screen to native(android/ios) screens
Creating raw image from Widget or Canvas
The equivalent of wrap_content and match_parent in flutter?
Is there an AdMob or other ad service SDK for Flutter apps
How can I access the contents of a StatefulWidget's State during a unit test?
How can I tightly wrap a Column of widgets inside a Card?
What's the reason for “async” in testWidgets methods?
How can I inherit a StatefulWidget's State?
Why is this icon being clipped?
IconButton calling setState during onPressed shows no ripple effect
How can I test a TextPainter?
Passing command line arguments to a flutter app
How can I save to local storage using Flutter?
Life cycle in flutter
What would be a good way for a widget to take 1/3 of the screen?

Categories

HOME
regex
printing
ffmpeg
google-search
opencl
runnable
auth0
google-cloud-dataproc
streaming
svg.js
visual-studio-2012
gluon
jfreechart
wget
range
plotly
eloqua
doorkeeper
lighttpd
googletest
python-2.5
afnetworking-2
api-design
ssrs-2008
freetype
contains
software-distribution
csom
text-parsing
nested-loops
arduino-esp8266
solarwindslem
nest-thermostat
panel-data
svgpanzoom
phing
draggable
joe-editor
uistoryboardsegue
signing
protobuf-3
ibm-wcm
dxgi
textangular
using
jquery-ui-dialog
appdynamics
ms-jet-ace
azure-cdn
master-data-management
column-oriented
assembly-references
vistadb
facebook-audience-network
xnamespace
ckcontainer
activity-diagram
rras
isapi-rewrite
okuma
xlform
cucumber-java
win32com
jni4net
sqlj
kinto
python-dragonfly
many-to-one
kindlegen
chunk-templates
nbug
odoo
wso2as
gcovr
information-schema
cvs2git
formhelper
imaging
knockout-mvc
bessel-functions
team-explorer-everywhere
ituneslibrary
azimuth
delphi-2009
tlb
dfsort
scala-pickling
sqlprofiler
blueprint
ioerror
apache-commons-dbcp
mips64
xcode4.2
word-2010
memento
guvnor
android-actionmode
graphiti-js
nsinvocation
stumbleupon
magento-1.5
program-files
apache-config
spquery
contracts
clipboard-pictures
large-teams
metaphone
corporate-policy

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App