Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit db334b5

Browse files
committed
Added twitter and wordpress links in the drawer
1 parent 52952d4 commit db334b5

File tree

3 files changed

+78
-6
lines changed

3 files changed

+78
-6
lines changed

‎sample_app/lib/home_old.dart

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import 'package:flutter/material.dart';
22
import 'package:provider/provider.dart';
3+
import 'package:url_launcher/url_launcher.dart';
4+
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
35
import 'package:sample_app/app_themes.dart';
46
import 'package:sample_app/theme_manager.dart';
57

@@ -21,10 +23,15 @@ class HomeState extends State<Home> {
2123
title: Text("Welcome to Flutter App")
2224
),
2325
body: Align(
24-
alignment: Alignment.topCenter,
26+
alignment: Alignment.center,
2527
child: Text(
26-
'Hello World',
27-
)
28+
'Know me?',
29+
style: TextStyle(
30+
color: Colors.grey[800],
31+
fontWeight: FontWeight.bold,
32+
fontSize: 40
33+
)
34+
)
2835
),
2936
drawer: Drawer(
3037
child: ListView(
@@ -38,10 +45,31 @@ class HomeState extends State<Home> {
3845
),
3946
ListTile(
4047
leading: Icon(
41-
Icons.bookmark
48+
MdiIcons.postOutline//Icons.bookmark
49+
),
50+
title: Text("Blog"),
51+
onTap: () async{
52+
const url = 'https://karanrn.wordpress.com';
53+
if (await canLaunch(url)) {
54+
await launch(url, forceWebView: true, enableJavaScript: true);
55+
}else {
56+
throw 'Could not launch $url';
57+
}
58+
}
59+
),
60+
ListTile(
61+
leading: Icon(
62+
MdiIcons.twitter
4263
),
43-
title: Text("Item 1"),
44-
//onTap:
64+
title: Text("Tweet me"),
65+
onTap: () async{
66+
const url = 'https://twitter.com/knadagoudar';
67+
if (await canLaunch(url)) {
68+
await launch(url, forceWebView: true, enableJavaScript: true);
69+
}else {
70+
throw 'Could not launch $url';
71+
}
72+
}
4573
),
4674
Divider(),
4775
ListTile(

‎sample_app/pubspec.lock

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,13 @@ packages:
9393
url: "https://pub.dartlang.org"
9494
source: hosted
9595
version: "0.12.6"
96+
material_design_icons_flutter:
97+
dependency: "direct main"
98+
description:
99+
name: material_design_icons_flutter
100+
url: "https://pub.dartlang.org"
101+
source: hosted
102+
version: "4.0.5045"
96103
meta:
97104
dependency: transitive
98105
description:
@@ -121,6 +128,13 @@ packages:
121128
url: "https://pub.dartlang.org"
122129
source: hosted
123130
version: "2.4.0"
131+
plugin_platform_interface:
132+
dependency: transitive
133+
description:
134+
name: plugin_platform_interface
135+
url: "https://pub.dartlang.org"
136+
source: hosted
137+
version: "1.0.2"
124138
provider:
125139
dependency: "direct main"
126140
description:
@@ -217,6 +231,34 @@ packages:
217231
url: "https://pub.dartlang.org"
218232
source: hosted
219233
version: "1.1.6"
234+
url_launcher:
235+
dependency: "direct main"
236+
description:
237+
name: url_launcher
238+
url: "https://pub.dartlang.org"
239+
source: hosted
240+
version: "5.4.2"
241+
url_launcher_macos:
242+
dependency: transitive
243+
description:
244+
name: url_launcher_macos
245+
url: "https://pub.dartlang.org"
246+
source: hosted
247+
version: "0.0.1+4"
248+
url_launcher_platform_interface:
249+
dependency: transitive
250+
description:
251+
name: url_launcher_platform_interface
252+
url: "https://pub.dartlang.org"
253+
source: hosted
254+
version: "1.0.6"
255+
url_launcher_web:
256+
dependency: transitive
257+
description:
258+
name: url_launcher_web
259+
url: "https://pub.dartlang.org"
260+
source: hosted
261+
version: "0.1.1+1"
220262
vector_math:
221263
dependency: transitive
222264
description:

‎sample_app/pubspec.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ dependencies:
2525
cupertino_icons: ^0.1.2
2626
provider: ^3.1.0
2727
shared_preferences: ^0.5.3+4
28+
url_launcher: ^5.4.2
29+
material_design_icons_flutter: ^4.0.5045
2830

2931
dev_dependencies:
3032
flutter_test:

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /