-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.dart
61 lines (55 loc) · 1.62 KB
/
main.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_linkify/flutter_linkify.dart';
import 'package:selectabletext_fix/fixed_selectable_linkify.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Broken selectable linkify Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(),
);
}
}
//
//
// This is all about https://github.com/flutter/flutter/issues/43494
//
//
class MyHomePage extends StatefulWidget {
MyHomePage({Key key}) : super(key: key);
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
FixedSelectableLinkify(
text: 'Hello!\n'
'We have a link here: https://google.com ! :D',
onOpen: (link) => print('tapped $link'),
),
SelectableLinkify(
text: 'Hello!\n'
'We have a link here: https://google.com ! :D but you cannot open me!',
onOpen: (link) => print('tapped $link'),
),
],
),
),
),
);
}
}