Skip to content

Commit ef5d346

Browse files
drawer added
1 parent a019700 commit ef5d346

File tree

1 file changed

+49
-2
lines changed

1 file changed

+49
-2
lines changed

lib/main.dart

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import 'package:flutter/foundation.dart';
33
import 'package:flutter/material.dart';
44
import 'package:flutter/services.dart';
55
import 'package:lottie/lottie.dart';
6+
import 'package:url_launcher/url_launcher.dart';
67

78
/// The [main] function is the entry point of the application
89
void main() {
@@ -64,12 +65,53 @@ class _HomePageState extends State<HomePage> {
6465
return Scaffold(
6566
backgroundColor: Colors.deepPurple.shade50,
6667
appBar: AppBar(
68+
iconTheme: IconThemeData(color: Colors.deepPurple.shade400),
6769
backgroundColor: Colors.transparent,
6870
title: Text('Imagination Generator',
6971
style: TextStyle(color: Colors.deepPurple.shade400)),
7072
elevation: 0,
7173
centerTitle: true,
7274
),
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+
),
73115
body: Center(
74116
child: SingleChildScrollView(
75117
physics: const BouncingScrollPhysics(),
@@ -123,7 +165,8 @@ class _HomePageState extends State<HomePage> {
123165
);
124166
} else if (snapshot.hasError) {
125167
// 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}'));
127170
} else if (snapshot.hasData) {
128171
// If the image data is available, display the image using Image.memory().
129172
return Image.memory(snapshot.data!);
@@ -212,7 +255,11 @@ class _HomePageState extends State<HomePage> {
212255
),
213256
bottomNavigationBar: const Padding(
214257
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+
),
216263
),
217264
);
218265
}

0 commit comments

Comments
 (0)