Search
 
SCRIPT & CODE EXAMPLE
 

DART

add a clickable link in flutter

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:url_launcher/url_launcher.dart';


void main() {
  runApp(new MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new Scaffold(
        appBar: new AppBar(
          title: new Text('UrlLauchner'),
        ),
        body: new Center(
          child: new InkWell(
              child: new Text('Open Browser'),
              onTap: () => launch('https://docs.flutter.io/flutter/services/UrlLauncher-class.html')
          ),
        ),
      ),
    );
  }
}
Comment

add a clickable link in flutter

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:url_launcher/url_launcher.dart';

void main() {
  runApp(new MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new Scaffold(
        appBar: new AppBar(
          title: new Text('UrlLauchner'),
        ),
        body: new Center(
          child: new RichText(
            text: new TextSpan(
              children: [
                new TextSpan(
                  text: 'This is no Link, ',
                  style: new TextStyle(color: Colors.black),
                ),
                new TextSpan(
                  text: 'but this is',
                  style: new TextStyle(color: Colors.blue),
                  recognizer: new TapGestureRecognizer()
                    ..onTap = () { launch('https://docs.flutter.io/flutter/services/UrlLauncher-class.html');
                  },
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}
Comment

PREVIOUS NEXT
Code Example
Dart :: sizedbox flutter 
Dart :: flutter flat button size 
Dart :: chip widget flutter 
Dart :: flutter getit reset 
Dart :: flutter widget for space 
Dart :: flutter get package command 
Dart :: flutter column min height screen sixe 
Dart :: flutter check type of object 
Dart :: singleton in dart 
Dart :: convert string to double flutter 
Dart :: card radius flutter 
Dart :: android studio emulator blue screen windows 10 
Dart :: flutter date input field 
Dart :: listview space between items flutter 
Dart :: flutter only portrait 
Dart :: set minus padding in flutter 
Dart :: aws ec2 upload file 
Dart :: dart time 
Dart :: dart list add 
Dart :: array 2d dart 
Dart :: flutter leading 
Dart :: 2d list in dart 
Dart :: flutter Scaffold.of() called with a context that does not contain a Scaffold 
Dart :: convert datetime to TZDateTimeflutter 
Dart :: most used extentions for flutter 
Dart :: pass by reference in dart 
Dart :: flutter build async 
Dart :: how to define format snippet of class name as file name in dart : flutter 
Dart :: nullable conditional assignment dart 
Dart :: rectangualr fab in flutter 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =