-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- added some text styles - added home rich text
- Loading branch information
1 parent
dbf376c
commit 19cd6fb
Showing
10 changed files
with
284 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
|
||
SizedBox verticalSpace(double height) { | ||
return SizedBox(height: height.h); | ||
} | ||
|
||
SizedBox horizontalSpace(double width) { | ||
return SizedBox(width: width.w); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
import 'package:google_fonts/google_fonts.dart'; | ||
|
||
abstract class AppTextStyles { | ||
static TextStyle font32BlackW700 = GoogleFonts.poppins( | ||
textStyle: TextStyle( | ||
fontSize: 32.sp, | ||
fontWeight: FontWeight.w700, | ||
color: Colors.black, | ||
), | ||
); | ||
|
||
static TextStyle font32PinkW700 = GoogleFonts.poppins( | ||
textStyle: TextStyle( | ||
fontSize: 32.sp, | ||
fontWeight: FontWeight.w700, | ||
color: Colors.pink.withOpacity(0.3), | ||
), | ||
); | ||
|
||
static TextStyle font14BlakW300 = GoogleFonts.poppins( | ||
textStyle: TextStyle( | ||
fontSize: 14.sp, | ||
fontWeight: FontWeight.w300, | ||
color: Colors.black, | ||
), | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,15 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
import '../widgets/home/home_screen_body.dart'; | ||
|
||
class HomeScreen extends StatelessWidget { | ||
const HomeScreen({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: AppBar( | ||
title: const Text('Home Screen'), | ||
), | ||
body: const Center( | ||
child: Text('Home Screen'), | ||
), | ||
return const Scaffold( | ||
backgroundColor: Color(0xFFffffff), | ||
body: HomeScreenBody(), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:google_fonts/google_fonts.dart'; | ||
import 'package:translator_app/core/helper/spacing.dart'; | ||
import 'package:translator_app/core/theme/app_text_styles.dart'; | ||
|
||
class HomeRichText extends StatelessWidget { | ||
const HomeRichText({ | ||
super.key, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Text.rich( | ||
TextSpan( | ||
children: [ | ||
TextSpan( | ||
text: 'Translate', | ||
style: AppTextStyles.font32BlackW700, | ||
), | ||
TextSpan( | ||
text: ' Every \n', | ||
style: AppTextStyles.font32PinkW700, | ||
), | ||
TextSpan( | ||
text: 'Type Word \n', | ||
style: AppTextStyles.font32BlackW700, | ||
), | ||
WidgetSpan(child: verticalSpace(35)), | ||
TextSpan( | ||
text: 'Help you communicate in \n', | ||
style: AppTextStyles.font14BlakW300, | ||
), | ||
TextSpan( | ||
text: 'Different Language \n', | ||
style: AppTextStyles.font14BlakW300, | ||
), | ||
], | ||
), | ||
textAlign: TextAlign.center, | ||
style: GoogleFonts.poppins( | ||
height: 1.5, | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
import 'package:translator_app/core/helper/spacing.dart'; | ||
import 'package:translator_app/core/utils/app_images.dart'; | ||
import 'package:translator_app/ui/widgets/home/home_rich_text.dart'; | ||
|
||
class HomeScreenBody extends StatelessWidget { | ||
const HomeScreenBody({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Container( | ||
decoration: const BoxDecoration( | ||
image: DecorationImage( | ||
image: AssetImage(AppImages.imagesWorldmap), | ||
fit: BoxFit.cover, | ||
), | ||
), | ||
child: Padding( | ||
padding: EdgeInsets.only( | ||
top: 80.h, | ||
left: 16.w, | ||
right: 16.w, | ||
), | ||
child: SizedBox( | ||
width: double.infinity, | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.center, | ||
children: [ | ||
// Rich Text | ||
const HomeRichText(), | ||
verticalSpace(35) | ||
], | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters