@@ -3,6 +3,7 @@ import 'package:flutter/foundation.dart';
3
3
import 'package:flutter/material.dart' ;
4
4
import 'package:flutter/services.dart' ;
5
5
import 'package:lottie/lottie.dart' ;
6
+ import 'package:url_launcher/url_launcher.dart' ;
6
7
7
8
/// The [main] function is the entry point of the application
8
9
void main () {
@@ -64,12 +65,53 @@ class _HomePageState extends State<HomePage> {
64
65
return Scaffold (
65
66
backgroundColor: Colors .deepPurple.shade50,
66
67
appBar: AppBar (
68
+ iconTheme: IconThemeData (color: Colors .deepPurple.shade400),
67
69
backgroundColor: Colors .transparent,
68
70
title: Text ('Imagination Generator' ,
69
71
style: TextStyle (color: Colors .deepPurple.shade400)),
70
72
elevation: 0 ,
71
73
centerTitle: true ,
72
74
),
75
+ drawer: Drawer (
76
+ child: Container (
77
+ color: Colors .deepPurple.shade50,
78
+ child: ListView (
79
+ children: [
80
+ Container (
81
+ color: Colors .deepPurple.shade50,
82
+ child: DrawerHeader (
83
+ child: Center (
84
+ child: Text (
85
+ "TexFusion AI App" ,
86
+ style: TextStyle (
87
+ fontSize: 18 , color: Colors .deepPurple.shade400),
88
+ )),
89
+ ),
90
+ ),
91
+ ListTile (
92
+ leading: Icon (
93
+ Icons .source_rounded,
94
+ color: Colors .deepPurple.shade800,
95
+ ),
96
+ title: Text (
97
+ "Source Code" ,
98
+ style: TextStyle (
99
+ fontSize: 16 , color: Colors .deepPurple.shade400),
100
+ ),
101
+ onTap: () async {
102
+ final Uri url =
103
+ Uri .parse ('https://github.com/VikramadityaDev/text_to_image_gen/' );
104
+
105
+ if (! await launchUrl (url,
106
+ mode: LaunchMode .externalApplication)) {
107
+ throw Exception ('Could not launch $url ' );
108
+ }
109
+ },
110
+ ),
111
+ ],
112
+ ),
113
+ ),
114
+ ),
73
115
body: Center (
74
116
child: SingleChildScrollView (
75
117
physics: const BouncingScrollPhysics (),
@@ -123,7 +165,8 @@ class _HomePageState extends State<HomePage> {
123
165
);
124
166
} else if (snapshot.hasError) {
125
167
// If an error occurred while getting the image data, display an error message.
126
- return Center (child: Text ('Error: ${snapshot .error }' ));
168
+ return Center (
169
+ child: Text ('Error: ${snapshot .error }' ));
127
170
} else if (snapshot.hasData) {
128
171
// If the image data is available, display the image using Image.memory().
129
172
return Image .memory (snapshot.data! );
@@ -212,7 +255,11 @@ class _HomePageState extends State<HomePage> {
212
255
),
213
256
bottomNavigationBar: const Padding (
214
257
padding: EdgeInsets .only (bottom: 8 ),
215
- child: Text ("Made With Love ❤️ Vikramaditya" , textAlign: TextAlign .center, style: TextStyle (fontSize: 12 ),),
258
+ child: Text (
259
+ "Made With Love ❤️ Vikramaditya" ,
260
+ textAlign: TextAlign .center,
261
+ style: TextStyle (fontSize: 12 ),
262
+ ),
216
263
),
217
264
);
218
265
}
0 commit comments