Skip to content

Commit 881f48a

Browse files
Merge pull request #8 from Yacine2731/second_branch
Second branch
2 parents 9ed9d8d + 8fc95b9 commit 881f48a

28 files changed

+370
-102
lines changed

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@ TexFusion AI app created by flutter framework and it is a new AI art generation
1414
- Added 12 Styles including 3D render.
1515
- Download Image
1616
- Different Theme And Modes
17+
- Multi Languages
1718
- Custom Font
1819
- Lightweight & user-friendly
19-
- Cross Platform (Android , Linux , Windows and MacOs)
2020

2121
## How it work !
2222
- Make sure you enter more descriptive prompt. As this is kind of new api, it produces HD image with less descriptive prompt. So, make sure you describe the image correctly that you want as output.
23+
- The prompt in English only
2324

2425
Fork the repo 🔥 and don't forget to star the repo 🌟
2526

@@ -48,10 +49,20 @@ TexFusion AI app created by flutter framework and it is a new AI art generation
4849
<tr>
4950
<th>Dark Mode in Desktop</th>
5051
<th>Different Style</th>
52+
<th>Arabic Language</th>
5153
</tr>
5254
<tr>
5355
<td><img src="screenshots/02.png" width=600/></td>
5456
<td><img src="screenshots/06.png" width=300/></td>
57+
<td><img src="screenshots/11.png" width=300/></td>
58+
</tr>
59+
<tr>
60+
<th>Cross Platform</th>
61+
<th>Different Theme</th>
62+
</tr>
63+
<tr>
64+
<td><img src="screenshots/10.png" width=700/></td>
65+
<td><img src="screenshots/09.png" width=300/></td>
5566
</tr>
5667
</Table>
5768

lib/Pages/about_page.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ class AboutPage extends StatelessWidget {
143143
ElevatedButton(
144144
onPressed: () async {
145145
final Uri url =
146-
Uri.parse('https://github.com/VikramadityaDev/');
146+
Uri.parse('https://github.com/VikramadityaDev/');
147147
if (!await launchUrl(url,
148148
mode: LaunchMode.externalApplication)) {
149149
throw Exception('Could not launch $url');
@@ -157,7 +157,7 @@ class AboutPage extends StatelessWidget {
157157
ElevatedButton(
158158
onPressed: () async {
159159
final Uri url =
160-
Uri.parse('https://telegram.me/Aditya@1190/');
160+
Uri.parse('https://telegram.me/Aditya@1190/');
161161
if (!await launchUrl(url,
162162
mode: LaunchMode.externalApplication)) {
163163
throw Exception('Could not launch $url');

lib/Pages/home_page.dart

Lines changed: 74 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import 'package:lottie/lottie.dart';
99
import 'package:text_to_image_gen/Pages/settings_page.dart';
1010
import 'package:text_to_image_gen/bloc/image_cubit.dart';
1111
import 'package:path/path.dart' as xp;
12+
import 'package:text_to_image_gen/utils/app_language.dart';
1213

1314
import '../bloc/app_directory_cubit.dart';
1415
import '../utils/strings.dart';
@@ -61,7 +62,8 @@ class _HomePageState extends State<HomePage> {
6162
await file.writeAsBytes(canvas).whenComplete(() {
6263
ScaffoldMessenger.of(context).showSnackBar(
6364
SnackBar(
64-
content: Text('Image was Downloaded in $filePath'),
65+
content:
66+
Text('${translation(context).imageWasSaved} : $filePath'),
6567
elevation: 10,
6668
),
6769
);
@@ -127,6 +129,9 @@ class _HomePageState extends State<HomePage> {
127129
FocusScope.of(context).unfocus();
128130
}
129131
scaffoldKey.currentState?.openDrawer();
132+
if (FocusScope.of(context).hasFocus) {
133+
FocusScope.of(context).unfocus();
134+
}
130135
},
131136
child: Icon(
132137
Iconsax.element_plus,
@@ -173,8 +178,10 @@ class _HomePageState extends State<HomePage> {
173178
autofocus: false,
174179
controller: _textEditingController,
175180
decoration: InputDecoration(
176-
hintText: "Enter Anything in Your Mind",
177-
labelText: "Enter Anything in Your Mind",
181+
hintText:
182+
translation(context).putAnythingInYourMind,
183+
labelText:
184+
translation(context).putAnythingInYourMind,
178185
border: const OutlineInputBorder(),
179186
suffixIcon: IconButton(
180187
onPressed: () {
@@ -237,7 +244,7 @@ class _HomePageState extends State<HomePage> {
237244
padding: EdgeInsets.symmetric(vertical: 14.0),
238245
child: Icon(
239246
Icons.gesture,
240-
size: 30,
247+
size: 32,
241248
),
242249
),
243250
),
@@ -250,18 +257,28 @@ class _HomePageState extends State<HomePage> {
250257
builder: (context, state) {
251258
if (state is ImageLoading) {
252259
return Center(
253-
child: SizedBox(
254-
height: 300,
255-
width: 300,
256-
child: Padding(
257-
padding: const EdgeInsets.all(100),
258-
child: Lottie.asset(
259-
'assets/animations/loading.json',
260-
frameRate: FrameRate(120),
261-
repeat: true,
262-
animate: true,
260+
child: Column(
261+
mainAxisAlignment: MainAxisAlignment.center,
262+
crossAxisAlignment: CrossAxisAlignment.center,
263+
children: [
264+
SizedBox(
265+
height: 300,
266+
width: 300,
267+
child: Padding(
268+
padding: const EdgeInsets.all(100),
269+
child: Lottie.asset(
270+
'assets/animations/loading.json',
271+
frameRate: FrameRate(120),
272+
repeat: true,
273+
animate: true,
274+
),
275+
),
263276
),
264-
),
277+
Text(
278+
translation(context).loading,
279+
style: const TextStyle(fontSize: 18),
280+
)
281+
],
265282
),
266283
);
267284
}
@@ -329,7 +346,7 @@ class _HomePageState extends State<HomePage> {
329346
),
330347
child: Center(
331348
child: Text(
332-
'Download',
349+
translation(context).download,
333350
style: TextStyle(
334351
color: Theme.of(context)
335352
.colorScheme
@@ -356,16 +373,6 @@ class _HomePageState extends State<HomePage> {
356373
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
357374
crossAxisAlignment: CrossAxisAlignment.center,
358375
children: [
359-
SizedBox(
360-
width:
361-
MediaQuery.of(context).size.height * 0.7,
362-
child: FadeInImage(
363-
placeholder: const AssetImage(
364-
'assets/images/Ai.webp'),
365-
image: MemoryImage(image),
366-
fit: BoxFit.contain,
367-
),
368-
),
369376
Padding(
370377
padding: const EdgeInsets.all(10),
371378
child: InkWell(
@@ -407,7 +414,7 @@ class _HomePageState extends State<HomePage> {
407414
),
408415
child: Center(
409416
child: Text(
410-
'Download',
417+
translation(context).download,
411418
style: TextStyle(
412419
color: Theme.of(context)
413420
.colorScheme
@@ -424,6 +431,16 @@ class _HomePageState extends State<HomePage> {
424431
),
425432
),
426433
),
434+
SizedBox(
435+
width:
436+
MediaQuery.of(context).size.height * 0.7,
437+
child: FadeInImage(
438+
placeholder: const AssetImage(
439+
'assets/images/Ai.webp'),
440+
image: MemoryImage(image),
441+
fit: BoxFit.contain,
442+
),
443+
),
427444
],
428445
),
429446
);
@@ -437,16 +454,6 @@ class _HomePageState extends State<HomePage> {
437454
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
438455
crossAxisAlignment: CrossAxisAlignment.center,
439456
children: [
440-
SizedBox(
441-
width:
442-
MediaQuery.of(context).size.height * 0.7,
443-
child: FadeInImage(
444-
placeholder: const AssetImage(
445-
'assets/images/Ai.webp'),
446-
image: MemoryImage(image),
447-
fit: BoxFit.contain,
448-
),
449-
),
450457
Padding(
451458
padding: const EdgeInsets.all(10),
452459
child: InkWell(
@@ -488,7 +495,7 @@ class _HomePageState extends State<HomePage> {
488495
),
489496
child: Center(
490497
child: Text(
491-
'Download',
498+
translation(context).download,
492499
style: TextStyle(
493500
color: Theme.of(context)
494501
.colorScheme
@@ -505,6 +512,16 @@ class _HomePageState extends State<HomePage> {
505512
),
506513
),
507514
),
515+
SizedBox(
516+
width:
517+
MediaQuery.of(context).size.height * 0.7,
518+
child: FadeInImage(
519+
placeholder: const AssetImage(
520+
'assets/images/Ai.webp'),
521+
image: MemoryImage(image),
522+
fit: BoxFit.contain,
523+
),
524+
),
508525
],
509526
),
510527
);
@@ -568,7 +585,7 @@ class _HomePageState extends State<HomePage> {
568585
),
569586
child: Center(
570587
child: Text(
571-
'Download',
588+
translation(context).download,
572589
style: TextStyle(
573590
color: Theme.of(context)
574591
.colorScheme
@@ -593,8 +610,20 @@ class _HomePageState extends State<HomePage> {
593610
}
594611
if (state is ImageError) {
595612
final error = state.error;
613+
if (kDebugMode) {
614+
print(error);
615+
}
596616
return Center(
597-
child: Text(error),
617+
child: Padding(
618+
padding: const EdgeInsets.all(50.0),
619+
child: Text(
620+
"${translation(context).failed} .${translation(context).noResultFound}",
621+
style: const TextStyle(
622+
fontWeight: FontWeight.bold,
623+
fontSize: 20,
624+
),
625+
),
626+
),
598627
);
599628
}
600629
return Container();
@@ -613,7 +642,7 @@ class _HomePageState extends State<HomePage> {
613642
context: context,
614643
builder: (BuildContext context) {
615644
return SimpleDialog(
616-
title: const Text('Choose style for the image :'),
645+
title: Text('${translation(context).chooseStyle} :'),
617646
children: <Widget>[
618647
Padding(
619648
padding: const EdgeInsets.all(10.0),
@@ -655,13 +684,12 @@ class _HomePageState extends State<HomePage> {
655684
context: context,
656685
builder: (BuildContext context) {
657686
return AlertDialog(
658-
title: const Text('Choose Directory :'),
659-
content: const Text(
660-
'Do you want to Choose Directory to make the app can save images in your Device?'),
687+
title: Text('${translation(context).chooseDirectory} :'),
688+
content: Text(translation(context).confirmDirectory),
661689
actions: <Widget>[
662690
TextButton(
663691
onPressed: () => Navigator.of(context).pop(),
664-
child: const Text('No'),
692+
child: Text(translation(context).no),
665693
),
666694
TextButton(
667695
onPressed: () {
@@ -673,7 +701,7 @@ class _HomePageState extends State<HomePage> {
673701
),
674702
);
675703
},
676-
child: const Text('Yes'),
704+
child: Text(translation(context).yes),
677705
),
678706
],
679707
);

0 commit comments

Comments
 (0)