Answers for "flutter open link in browser"

1

open link with button flutter

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';
  }
}
Posted by: Guest on November-22-2020
0

how to launch url in flutter web

import 'dart:html' as html;
void htmlOpenLink() {
  String url = 'https://flutter.dev'; 
  html.window.open(url, '_blank');
}
Posted by: Guest on October-30-2020

Code answers related to "flutter open link in browser"

Code answers related to "Dart"

Browse Popular Code Answers by Language