-
-
Notifications
You must be signed in to change notification settings - Fork 647
Expand file tree
/
Copy pathmain.dart
More file actions
120 lines (114 loc) · 4.14 KB
/
main.dart
File metadata and controls
120 lines (114 loc) · 4.14 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:getwidget/getwidget.dart';
import 'package:url_launcher/url_launcher.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) => MaterialApp(
title: 'GetWidget',
debugShowCheckedModeBanner: false,
home: MyHomePage(),
);
}
class MyHomePage extends StatefulWidget {
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
final String _playStoreLink =
'https://play.google.com/store/apps/details?id=dev.getflutter.appkit';
// final String _appStoreLink = 'Coming Soon';
final String _githuAppRepoLink =
'https://github.com/ionicfirebaseapp/getwidget-app-kit';
final String _githubLibraryRepoLink =
'https://github.com/ionicfirebaseapp/getwidget';
Future _launchUrl(url) async {
if (await canLaunch(url)) {
return await launch(url);
}
return Future.value(false);
}
@override
Widget build(BuildContext context) => Scaffold(
backgroundColor: GFColors.DARK,
body: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
InkWell(
onTap: () {
_launchUrl(_githubLibraryRepoLink);
},
child: SvgPicture.asset('assets/logo.svg'),
),
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
const Padding(
padding: EdgeInsets.only(bottom: 25),
child: Center(
child: Text(
'To keep library size small and code clean we manage example on different repository. which includes clear usage of each and every component that we provide in GetWidget library. Please have a look there.',
style: TextStyle(
fontSize: 16,
color: GFColors.WHITE,
),
textAlign: TextAlign.center,
),
),
),
GFButton(
size: GFSize.LARGE,
text: 'View on Github',
textStyle: const TextStyle(
fontSize: 16,
color: GFColors.WHITE,
),
icon: SvgPicture.asset(
'assets/github.svg',
height: 22,
),
color: GFColors.SUCCESS,
blockButton: true,
onPressed: () {
_launchUrl(_githuAppRepoLink);
}),
],
),
Column(
children: <Widget>[
const Padding(
padding: EdgeInsets.only(bottom: 25),
child: Center(
child: Text(
'We also have same app on playstore. It shows various possibilities that you can achieve using GetWidget library.',
style: TextStyle(
fontSize: 16,
color: GFColors.WHITE,
),
textAlign: TextAlign.center,
),
),
),
GFButton(
size: GFSize.LARGE,
text: 'View on Playstore',
textStyle:
const TextStyle(fontSize: 16, color: GFColors.WHITE),
icon: SvgPicture.asset(
'assets/playstore.svg',
height: 20,
),
color: GFColors.SUCCESS,
blockButton: true,
onPressed: () {
_launchUrl(_playStoreLink);
}),
],
),
],
),
);
}