From f1e1f1d7fa14c712d7233f6be1ff503de64a37d2 Mon Sep 17 00:00:00 2001 From: Shourya Shikhar Date: Tue, 28 Jun 2022 02:14:57 +0530 Subject: [PATCH] fix #5 --- lib/src/achievements/card.dart | 26 ++-- lib/src/contact_me/contact_me_button.dart | 7 +- lib/src/custom/custom_text.dart | 29 ++++ lib/src/custom/text_style.dart | 12 -- lib/src/education/card.dart | 161 ++++++++++++++++++++++ lib/src/education/card_desktop.dart | 129 ----------------- lib/src/education/card_mobile.dart | 124 ----------------- lib/src/experience/card.dart | 82 +++++------ lib/src/home/designation.dart | 11 +- lib/src/home/resume.dart | 7 +- lib/src/projects/card.dart | 154 ++++++++++++--------- lib/src/whatIDo/progress.dart | 16 ++- lib/tabs/achievements.dart | 4 - lib/tabs/contact_me.dart | 70 ++++++---- lib/tabs/education.dart | 11 +- lib/tabs/experience.dart | 4 - lib/tabs/projects.dart | 4 - lib/tabs/what_i_do.dart | 30 ++-- 18 files changed, 422 insertions(+), 459 deletions(-) create mode 100644 lib/src/custom/custom_text.dart delete mode 100644 lib/src/custom/text_style.dart create mode 100644 lib/src/education/card.dart delete mode 100644 lib/src/education/card_desktop.dart delete mode 100644 lib/src/education/card_mobile.dart diff --git a/lib/src/achievements/card.dart b/lib/src/achievements/card.dart index bdd1812..e4029f9 100644 --- a/lib/src/achievements/card.dart +++ b/lib/src/achievements/card.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; -import '../custom/text_style.dart'; +import '../custom/custom_text.dart'; import '../html_open_link.dart'; import '../theme/config.dart'; @@ -9,12 +9,9 @@ class AchievementsCard extends StatefulWidget { {Key? key, required this.desc, required this.isMobile, - required this.height, - required this.width, required this.link}) : super(key: key); - final double height, width; final String desc, link; final bool isMobile; @override @@ -26,6 +23,8 @@ class _AchievementsCardState extends State { @override Widget build(BuildContext context) { + final double height = MediaQuery.of(context).size.height; + final double width = MediaQuery.of(context).size.width; return AnimatedContainer( decoration: BoxDecoration( boxShadow: [ @@ -38,8 +37,8 @@ class _AchievementsCardState extends State { ), duration: const Duration(milliseconds: 200), padding: EdgeInsets.only( - top: isHover ? widget.height * 0.005 : widget.height * 0.01, - bottom: !isHover ? widget.height * 0.005 : widget.height * 0.01), + top: isHover ? height * 0.005 : height * 0.01, + bottom: !isHover ? height * 0.005 : height * 0.01), child: InkWell( onHover: (bool value) { setState(() { @@ -50,13 +49,11 @@ class _AchievementsCardState extends State { child: Container( alignment: Alignment.topCenter, padding: EdgeInsets.only( - top: widget.height * 0.04, - left: widget.width * 0.015, - right: widget.width * 0.015, - bottom: widget.height * 0.04), - width: !widget.isMobile ? widget.width * 0.28 : widget.width, - height: - !widget.isMobile ? widget.height * 0.35 : widget.height / 2.25, + top: height * 0.04, + left: width * 0.015, + right: width * 0.015, + bottom: height * 0.04), + width: !widget.isMobile ? width * 0.28 : width, decoration: BoxDecoration( boxShadow: [ BoxShadow( @@ -74,7 +71,8 @@ class _AchievementsCardState extends State { ), child: Center( child: SingleChildScrollView( - child: text(widget.desc, 18, Colors.white))), + child: CustomText( + text: widget.desc, fontSize: 18, color: Colors.white))), ), ), ); diff --git a/lib/src/contact_me/contact_me_button.dart b/lib/src/contact_me/contact_me_button.dart index 470e234..0b3a0b7 100644 --- a/lib/src/contact_me/contact_me_button.dart +++ b/lib/src/contact_me/contact_me_button.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import '../../tabs/contact_me.dart'; -import '../custom/text_style.dart'; +import '../custom/custom_text.dart'; import '../education/data.dart'; class ContactMeButton extends StatelessWidget { @@ -12,7 +12,10 @@ class ContactMeButton extends StatelessWidget { return Visibility( visible: data.isNotEmpty, child: TextButton( - child: text('CONTACT ME', 20, Theme.of(context).primaryColor), + child: CustomText( + text: 'CONTACT ME', + fontSize: 20, + color: Theme.of(context).primaryColor), onPressed: () => Navigator.push( context, MaterialPageRoute(builder: (context) => const ContactMe()), diff --git a/lib/src/custom/custom_text.dart b/lib/src/custom/custom_text.dart new file mode 100644 index 0000000..99e335b --- /dev/null +++ b/lib/src/custom/custom_text.dart @@ -0,0 +1,29 @@ +import 'package:flutter/material.dart'; + +class CustomText extends StatelessWidget { + const CustomText( + {Key? key, + required this.text, + required this.fontSize, + this.isTextAlignCenter = true, + required this.color}) + : super(key: key); + + final String text; + final Color color; + final double fontSize; + final bool isTextAlignCenter; + + @override + Widget build(BuildContext context) { + return Text(text, + textAlign: isTextAlignCenter ? TextAlign.center : TextAlign.left, + style: TextStyle( + fontFamily: 'Montserrat', + letterSpacing: 2, + fontSize: fontSize, + color: color, + fontWeight: FontWeight.w500, + )); + } +} diff --git a/lib/src/custom/text_style.dart b/lib/src/custom/text_style.dart deleted file mode 100644 index e249744..0000000 --- a/lib/src/custom/text_style.dart +++ /dev/null @@ -1,12 +0,0 @@ -import 'package:flutter/material.dart'; - -Widget text(String s, double fontSize, Color color) { - final TextStyle textStyle = TextStyle( - fontFamily: 'Montserrat', - letterSpacing: 2, - fontSize: fontSize, - color: color, - fontWeight: FontWeight.w500, - ); - return Text(s, style: textStyle); -} diff --git a/lib/src/education/card.dart b/lib/src/education/card.dart new file mode 100644 index 0000000..d72ba9c --- /dev/null +++ b/lib/src/education/card.dart @@ -0,0 +1,161 @@ +import 'package:flutter/material.dart'; + +import '../custom/custom_text.dart'; +import '../theme/config.dart'; + +class EducationDesktop extends StatefulWidget { + const EducationDesktop( + {Key? key, + required this.instiution, + required this.location, + required this.desc, + required this.grades, + required this.years, + required this.image}) + : super(key: key); + + final String instiution, location, years, grades, desc, image; + @override + _EducationDesktopState createState() => _EducationDesktopState(); +} + +class _EducationDesktopState extends State { + bool isHover = false; + + @override + Widget build(BuildContext context) { + final double height = MediaQuery.of(context).size.height; + final double width = MediaQuery.of(context).size.width; + return AnimatedContainer( + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: isHover ? Colors.black12 : Colors.black45, + blurRadius: 10.0, + offset: const Offset(8, 12), + ) + ], + ), + duration: const Duration(milliseconds: 200), + padding: EdgeInsets.only( + top: isHover ? height * 0.005 : height * 0.01, + bottom: !isHover ? height * 0.005 : height * 0.01), + child: InkWell( + onHover: (bool value) { + setState(() { + isHover = value; + }); + }, + onTap: () {}, + child: Container( + alignment: Alignment.topCenter, + padding: EdgeInsets.only( + top: height * 0.04, + left: width * 0.015, + right: width * 0.015, + bottom: height * 0.04), + width: width / 1.15, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: isHover ? Colors.black12 : Colors.black45, + blurRadius: 10.0, + offset: const Offset(8, 12), + ) + ], + color: currentTheme.currentTheme == ThemeMode.dark + ? Theme.of(context).cardColor + : Theme.of(context).primaryColor, + borderRadius: BorderRadius.circular( + 5.0, + ), + ), + child: Column( + children: [ + Visibility( + visible: width < 1000, + child: Container( + width: 50, + height: 50, + margin: const EdgeInsets.only(bottom: 5.0), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + image: DecorationImage( + image: AssetImage('assets/education/${widget.image}'), + fit: BoxFit.cover, + ), + ), + ), + ), + Row( + children: [ + Visibility( + visible: width >= 1000, + child: Container( + width: 100, + height: 100, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + image: DecorationImage( + image: AssetImage('assets/education/${widget.image}'), + fit: BoxFit.cover, + ), + ), + ), + ), + Expanded( + flex: 2, + child: Column( + children: [ + FittedBox( + fit: BoxFit.cover, + child: CustomText( + text: widget.instiution, + fontSize: 20, + color: Colors.white)), + Padding( + padding: const EdgeInsets.only(bottom: 5.0), + child: FittedBox( + fit: BoxFit.cover, + child: CustomText( + text: widget.location, + fontSize: 10, + color: Colors.white)), + ), + FittedBox( + fit: BoxFit.cover, + child: Padding( + padding: const EdgeInsets.only(bottom: 11.0), + child: CustomText( + text: widget.years != '' + ? 'Years of study: ${widget.years}' + : '', + fontSize: 12, + color: Colors.white), + )), + FittedBox( + fit: BoxFit.cover, + child: CustomText( + text: widget.desc, + fontSize: 13, + color: Colors.white)), + FittedBox( + fit: BoxFit.cover, + child: CustomText( + text: widget.grades != '' + ? 'Grades Achieved: ${widget.grades}' + : '', + fontSize: 12, + color: Colors.white)), + ], + ), + ), + ], + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/src/education/card_desktop.dart b/lib/src/education/card_desktop.dart deleted file mode 100644 index b564a09..0000000 --- a/lib/src/education/card_desktop.dart +++ /dev/null @@ -1,129 +0,0 @@ -import 'package:flutter/material.dart'; - -import '../custom/text_style.dart'; -import '../theme/config.dart'; - -class EducationDesktopCard extends StatefulWidget { - const EducationDesktopCard( - {Key? key, - required this.height, - required this.width, - required this.instiution, - required this.location, - required this.desc, - required this.grades, - required this.years, - required this.image}) - : super(key: key); - - final double height, width; - final String instiution, location, years, grades, desc, image; - @override - _EducationDesktopCardState createState() => _EducationDesktopCardState(); -} - -class _EducationDesktopCardState extends State { - bool isHover = false; - - @override - Widget build(BuildContext context) { - return AnimatedContainer( - decoration: BoxDecoration( - boxShadow: [ - BoxShadow( - color: isHover ? Colors.black12 : Colors.black45, - blurRadius: 10.0, - offset: const Offset(8, 12), - ) - ], - ), - duration: const Duration(milliseconds: 200), - padding: EdgeInsets.only( - top: isHover ? widget.height * 0.005 : widget.height * 0.01, - bottom: !isHover ? widget.height * 0.005 : widget.height * 0.01), - child: InkWell( - onHover: (bool value) { - setState(() { - isHover = value; - }); - }, - onTap: () {}, - child: Container( - alignment: Alignment.topCenter, - padding: EdgeInsets.only( - top: widget.height * 0.04, - left: widget.width * 0.015, - right: widget.width * 0.015, - bottom: widget.height * 0.04), - width: widget.width / 1.15, - decoration: BoxDecoration( - boxShadow: [ - BoxShadow( - color: isHover ? Colors.black12 : Colors.black45, - blurRadius: 10.0, - offset: const Offset(8, 12), - ) - ], - color: currentTheme.currentTheme == ThemeMode.dark - ? Theme.of(context).cardColor - : Theme.of(context).primaryColor, - borderRadius: BorderRadius.circular( - 5.0, - ), - ), - child: Row( - children: [ - Padding( - padding: const EdgeInsets.only(bottom: 5.0), - child: ClipRRect( - borderRadius: BorderRadius.circular(8.0), - child: Image.asset( - 'assets/education/${widget.image}', - scale: 1.2, - )), - ), - Expanded( - flex: 2, - child: Column( - children: [ - FittedBox( - fit: BoxFit.cover, - child: text(widget.instiution, 20, Colors.white)), - Padding( - padding: const EdgeInsets.only(bottom: 5.0), - child: FittedBox( - fit: BoxFit.cover, - child: text(widget.location, 10, Colors.white)), - ), - FittedBox( - fit: BoxFit.cover, - child: Padding( - padding: const EdgeInsets.only(bottom: 11.0), - child: text( - widget.years != '' - ? 'Years of study: ${widget.years}' - : '', - 12, - Colors.white), - )), - FittedBox( - fit: BoxFit.cover, - child: text(widget.desc, 13, Colors.white)), - FittedBox( - fit: BoxFit.cover, - child: text( - widget.grades != '' - ? 'Grades Achieved: ${widget.grades}' - : '', - 12, - Colors.white)), - ], - ), - ), - ], - ), - ), - ), - ); - } -} diff --git a/lib/src/education/card_mobile.dart b/lib/src/education/card_mobile.dart deleted file mode 100644 index 1e96706..0000000 --- a/lib/src/education/card_mobile.dart +++ /dev/null @@ -1,124 +0,0 @@ -import 'package:flutter/material.dart'; - -import '../custom/text_style.dart'; -import '../theme/config.dart'; - -class EducationMobileCard extends StatefulWidget { - const EducationMobileCard( - {Key? key, - required this.height, - required this.width, - required this.instiution, - required this.location, - required this.desc, - required this.grades, - required this.years, - required this.image}) - : super(key: key); - - final double height, width; - final String instiution, location, years, grades, desc, image; - @override - _EducationMobileCardState createState() => _EducationMobileCardState(); -} - -class _EducationMobileCardState extends State { - bool isHover = false; - - @override - Widget build(BuildContext context) { - return AnimatedContainer( - decoration: BoxDecoration( - boxShadow: [ - BoxShadow( - color: isHover ? Colors.black12 : Colors.black45, - blurRadius: 10.0, - offset: const Offset(8, 12), - ) - ], - ), - duration: const Duration(milliseconds: 200), - padding: EdgeInsets.only( - top: isHover ? widget.height * 0.005 : widget.height * 0.01, - bottom: !isHover ? widget.height * 0.005 : widget.height * 0.01), - child: InkWell( - onTap: () {}, - onHover: (bool value) { - setState(() { - isHover = value; - }); - }, - child: Container( - alignment: Alignment.topCenter, - padding: EdgeInsets.only( - top: widget.height * 0.04, - left: widget.width * 0.015, - right: widget.width * 0.015, - bottom: widget.height * 0.04), - width: widget.width, - decoration: BoxDecoration( - boxShadow: [ - BoxShadow( - color: isHover ? Colors.black12 : Colors.black45, - blurRadius: 10.0, - offset: const Offset(8, 12), - ) - ], - color: currentTheme.currentTheme == ThemeMode.dark - ? Theme.of(context).cardColor - : Theme.of(context).primaryColor, - borderRadius: BorderRadius.circular( - 5.0, - ), - ), - child: SingleChildScrollView( - child: Column( - children: [ - Padding( - padding: const EdgeInsets.only(bottom: 5.0), - child: ClipRRect( - borderRadius: BorderRadius.circular(8.0), - child: Image.asset( - 'assets/education/${widget.image}', - scale: 1.2, - )), - ), - FittedBox( - fit: BoxFit.cover, - child: text(widget.instiution, 20, Colors.white)), - Padding( - padding: const EdgeInsets.only(bottom: 5.0), - child: FittedBox( - fit: BoxFit.cover, - child: text(widget.location, 10, Colors.white)), - ), - FittedBox( - fit: BoxFit.cover, - child: Padding( - padding: const EdgeInsets.only(bottom: 11.0), - child: text( - widget.years != '' - ? 'Years of study: ${widget.years}' - : '', - 12, - Colors.white), - )), - FittedBox( - fit: BoxFit.cover, - child: text(widget.desc, 13, Colors.white)), - FittedBox( - fit: BoxFit.cover, - child: text( - widget.grades != '' - ? 'Grades Achieved: ${widget.grades}' - : '', - 12, - Colors.white)), - ], - ), - ), - ), - ), - ); - } -} diff --git a/lib/src/experience/card.dart b/lib/src/experience/card.dart index 21fda66..20bbf25 100644 --- a/lib/src/experience/card.dart +++ b/lib/src/experience/card.dart @@ -1,13 +1,11 @@ import 'package:flutter/material.dart'; -import '../custom/text_style.dart'; +import '../custom/custom_text.dart'; import '../theme/config.dart'; class ExperienceCard extends StatefulWidget { const ExperienceCard( {Key? key, - required this.height, - required this.width, required this.image, required this.title, required this.desc, @@ -16,7 +14,6 @@ class ExperienceCard extends StatefulWidget { required this.isMobile}) : super(key: key); - final double height, width; final String image, title, desc, period, role; final bool isMobile; @@ -29,6 +26,8 @@ class _ExperienceCardState extends State { @override Widget build(BuildContext context) { + final double width = MediaQuery.of(context).size.width; + final double height = MediaQuery.of(context).size.height; return AnimatedContainer( decoration: BoxDecoration( boxShadow: [ @@ -41,8 +40,8 @@ class _ExperienceCardState extends State { ), duration: const Duration(milliseconds: 200), padding: EdgeInsets.only( - top: isHover ? widget.height * 0.005 : widget.height * 0.01, - bottom: !isHover ? widget.height * 0.005 : widget.height * 0.01), + top: isHover ? height * 0.005 : height * 0.01, + bottom: !isHover ? height * 0.005 : height * 0.01), child: InkWell( onHover: (bool value) { setState(() { @@ -55,8 +54,7 @@ class _ExperienceCardState extends State { padding: const EdgeInsets.only( top: 5.0, ), - width: !widget.isMobile ? widget.width * 0.28 : widget.width, - height: widget.height * 0.55, + width: !widget.isMobile ? width * 0.28 : width, decoration: BoxDecoration( boxShadow: [ BoxShadow( @@ -78,21 +76,18 @@ class _ExperienceCardState extends State { ), child: Column( children: [ - Expanded( - child: Image.asset( - 'assets/experience/${widget.image}', - scale: 1.1, - ), + Image.asset( + 'assets/experience/${widget.image}', + scale: 1.1, ), Container( alignment: Alignment.topCenter, padding: EdgeInsets.only( - top: widget.height * 0.02, - left: widget.width * 0.015, - right: widget.width * 0.01, - bottom: widget.height * 0.02), - width: !widget.isMobile ? widget.width * 0.28 : widget.width, - height: widget.height * 0.35, + top: height * 0.02, + left: width * 0.015, + right: width * 0.01, + bottom: height * 0.02), + width: !widget.isMobile ? width * 0.28 : width, decoration: BoxDecoration( color: currentTheme.currentTheme == ThemeMode.dark ? Theme.of(context).cardColor @@ -103,28 +98,35 @@ class _ExperienceCardState extends State { ), ), child: Center( - child: SingleChildScrollView( - child: Column( - children: [ - FittedBox( + child: Column( + children: [ + FittedBox( + fit: BoxFit.cover, + child: CustomText( + text: widget.title, + fontSize: 25, + color: Colors.white)), + Padding( + padding: const EdgeInsets.only(top: 5.0, bottom: 16.0), + child: FittedBox( + fit: BoxFit.cover, + child: CustomText( + text: widget.role, + fontSize: 14, + color: Colors.white)), + ), + Padding( + padding: const EdgeInsets.only(bottom: 12.0), + child: FittedBox( fit: BoxFit.cover, - child: text(widget.title, 25, Colors.white)), - Padding( - padding: - const EdgeInsets.only(top: 5.0, bottom: 16.0), - child: FittedBox( - fit: BoxFit.cover, - child: text(widget.role, 14, Colors.white)), - ), - Padding( - padding: const EdgeInsets.only(bottom: 12.0), - child: FittedBox( - fit: BoxFit.cover, - child: text(widget.period, 15, Colors.white)), - ), - text(widget.desc, 15, Colors.white), - ], - ), + child: CustomText( + text: widget.period, + fontSize: 15, + color: Colors.white)), + ), + CustomText( + text: widget.desc, fontSize: 15, color: Colors.white), + ], ), ), ), diff --git a/lib/src/home/designation.dart b/lib/src/home/designation.dart index f9d9566..797eb34 100644 --- a/lib/src/home/designation.dart +++ b/lib/src/home/designation.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; -import '../custom/text_style.dart'; +import '../custom/custom_text.dart'; import 'data.dart'; class Designation extends StatelessWidget { @@ -70,11 +70,12 @@ class _TextSwapControllerState extends State { @override Widget build(BuildContext context) { if (widget.data.length == i) i = 0; - return text( - widget.isMobile + return CustomText( + text: widget.isMobile ? widget.data[i++].replaceAll(' ', '\n') : widget.data[i++], - widget.isMobile ? 40 : 60, - Theme.of(context).primaryColorLight); + isTextAlignCenter: false, + fontSize: widget.isMobile ? 40 : 60, + color: Theme.of(context).primaryColorLight); } } diff --git a/lib/src/home/resume.dart b/lib/src/home/resume.dart index 0c545b7..612d68e 100644 --- a/lib/src/home/resume.dart +++ b/lib/src/home/resume.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; -import '../custom/text_style.dart'; +import '../custom/custom_text.dart'; import '../html_open_link.dart'; import 'data.dart'; @@ -24,7 +24,10 @@ class Resume extends StatelessWidget { visible: data != '', child: TextButton( onPressed: () => htmlOpenLink(data), - child: text('MY RESUME', 20, Theme.of(context).primaryColor)), + child: CustomText( + text: 'MY RESUME', + fontSize: 20, + color: Theme.of(context).primaryColor)), )); } } diff --git a/lib/src/projects/card.dart b/lib/src/projects/card.dart index 9c2ba97..b80276b 100644 --- a/lib/src/projects/card.dart +++ b/lib/src/projects/card.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; -import '../custom/text_style.dart'; +import '../custom/custom_text.dart'; import '../html_open_link.dart'; import '../theme/config.dart'; import 'data.dart'; @@ -8,8 +8,6 @@ import 'data.dart'; class ProjectsCard extends StatefulWidget { const ProjectsCard( {Key? key, - required this.height, - required this.width, required this.title, required this.techStack, required this.desc, @@ -17,7 +15,6 @@ class ProjectsCard extends StatefulWidget { required this.isMobile}) : super(key: key); - final double height, width; final String title, techStack, desc, link; final bool isMobile; @override @@ -29,6 +26,8 @@ class _ProjectsCardState extends State { @override Widget build(BuildContext context) { + final double height = MediaQuery.of(context).size.height; + final double width = MediaQuery.of(context).size.width; return AnimatedContainer( decoration: BoxDecoration( boxShadow: [ @@ -41,8 +40,8 @@ class _ProjectsCardState extends State { ), duration: const Duration(milliseconds: 200), padding: EdgeInsets.only( - top: isHover ? widget.height * 0.005 : widget.height * 0.01, - bottom: !isHover ? widget.height * 0.005 : widget.height * 0.01), + top: isHover ? height * 0.005 : height * 0.01, + bottom: !isHover ? height * 0.005 : height * 0.01), child: InkWell( onHover: (bool value) { setState(() { @@ -53,12 +52,11 @@ class _ProjectsCardState extends State { child: Container( alignment: Alignment.topCenter, padding: EdgeInsets.only( - top: widget.height * 0.02, - left: widget.width * 0.015, - right: widget.width * 0.015, - bottom: widget.height * 0.02), - width: !widget.isMobile ? widget.width * 0.28 : widget.width, - height: !widget.isMobile ? widget.height * 0.35 : widget.height / 2, + top: height * 0.02, + left: width * 0.015, + right: width * 0.015, + bottom: height * 0.02), + width: !widget.isMobile ? width * 0.28 : width, decoration: BoxDecoration( boxShadow: [ BoxShadow( @@ -83,26 +81,30 @@ class _ProjectsCardState extends State { final List data = snapshot.data as List; return Column( children: [ - Expanded( - child: Center( - child: SingleChildScrollView( - child: Column( - children: [ - FittedBox( - fit: BoxFit.cover, - child: text(data[0], 25, Colors.white)), - Padding( - padding: const EdgeInsets.only( - top: 5.0, bottom: 16.0), - child: FittedBox( - fit: BoxFit.cover, - child: - text(data[1], 14, Colors.white)), - ), - text(data[2], 15, Colors.white), - ], + Center( + child: Column( + children: [ + FittedBox( + fit: BoxFit.cover, + child: CustomText( + text: data[0], + fontSize: 25, + color: Colors.white)), + Padding( + padding: const EdgeInsets.only( + top: 5.0, bottom: 16.0), + child: FittedBox( + fit: BoxFit.cover, + child: CustomText( + text: data[1], + fontSize: 14, + color: Colors.white)), ), - ), + CustomText( + text: data[2], + fontSize: 15, + color: Colors.white), + ], ), ), Row( @@ -111,11 +113,17 @@ class _ProjectsCardState extends State { scale: 2), Padding( padding: const EdgeInsets.only(right: 24.0), - child: text(' ${data[3]}', 12, Colors.white), + child: CustomText( + text: ' ${data[3]}', + fontSize: 12, + color: Colors.white), ), Image.asset('assets/projects/constant/forks.png', scale: 2), - text(' ${data[4]}', 12, Colors.white), + CustomText( + text: ' ${data[4]}', + fontSize: 12, + color: Colors.white), ], ), ], @@ -125,26 +133,30 @@ class _ProjectsCardState extends State { }) : Column( children: [ - Expanded( - child: Center( - child: SingleChildScrollView( - child: Column( - children: [ - FittedBox( - fit: BoxFit.cover, - child: text(widget.title, 25, Colors.white)), - Padding( - padding: const EdgeInsets.only( - top: 5.0, bottom: 16.0), - child: FittedBox( - fit: BoxFit.cover, - child: text( - widget.techStack, 14, Colors.white)), - ), - text(widget.desc, 15, Colors.white), - ], + Center( + child: Column( + children: [ + FittedBox( + fit: BoxFit.cover, + child: CustomText( + text: widget.title, + fontSize: 25, + color: Colors.white)), + Padding( + padding: + const EdgeInsets.only(top: 5.0, bottom: 16.0), + child: FittedBox( + fit: BoxFit.cover, + child: CustomText( + text: widget.techStack, + fontSize: 14, + color: Colors.white)), ), - ), + CustomText( + text: widget.desc, + fontSize: 15, + color: Colors.white), + ], ), ), FutureBuilder( @@ -156,20 +168,30 @@ class _ProjectsCardState extends State { snapshot.data as List; if (data[1] == 'null' && data[0] == 'null') return const Center(); - return Row( - children: [ - Image.asset( - 'assets/projects/constant/stars.png', - scale: 2), - Padding( - padding: const EdgeInsets.only(right: 24.0), - child: text(' ${data[0]}', 12, Colors.white), - ), - Image.asset( - 'assets/projects/constant/forks.png', - scale: 2), - text(' ${data[1]}', 12, Colors.white), - ], + return Padding( + padding: + const EdgeInsets.only(top: 8.0, left: 5.0), + child: Row( + children: [ + Image.asset( + 'assets/projects/constant/stars.png', + scale: 2), + Padding( + padding: const EdgeInsets.only(right: 24.0), + child: CustomText( + text: ' ${data[0]}', + fontSize: 12, + color: Colors.white), + ), + Image.asset( + 'assets/projects/constant/forks.png', + scale: 2), + CustomText( + text: ' ${data[1]}', + fontSize: 12, + color: Colors.white), + ], + ), ); } return const Center(); diff --git a/lib/src/whatIDo/progress.dart b/lib/src/whatIDo/progress.dart index 561219c..49e028a 100644 --- a/lib/src/whatIDo/progress.dart +++ b/lib/src/whatIDo/progress.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; -import '../custom/text_style.dart'; +import '../custom/custom_text.dart'; class Progress extends StatefulWidget { const Progress( @@ -58,12 +58,14 @@ class _ProgressState extends State child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - text(widget.title, widget.sizeProficiencyName, - Theme.of(context).primaryColorLight), - text( - '${percentage.toStringAsFixed(0)}%', - widget.sizePercentage, - Theme.of(context).primaryColorLight) + CustomText( + text: widget.title, + fontSize: widget.sizeProficiencyName, + color: Theme.of(context).primaryColorLight), + CustomText( + text: '${percentage.toStringAsFixed(0)}%', + fontSize: widget.sizePercentage, + color: Theme.of(context).primaryColorLight) ], ), ), diff --git a/lib/tabs/achievements.dart b/lib/tabs/achievements.dart index 93c43a1..cf37498 100644 --- a/lib/tabs/achievements.dart +++ b/lib/tabs/achievements.dart @@ -26,8 +26,6 @@ class Achievements extends StatelessWidget { return Container( padding: EdgeInsets.fromLTRB(30.0, 0.0, 30.0, height * 0.05), child: AchievementsCard( - height: height * 0.75, - width: width, desc: data[i][0], link: data[i][1], isMobile: true, @@ -50,8 +48,6 @@ class Achievements extends StatelessWidget { : data.length - storage - 1, (int index) { storage = index + i * 3; return AchievementsCard( - height: height * 0.9, - width: width, desc: data[index + i * 3][0], link: data[index + i * 3][1], isMobile: false, diff --git a/lib/tabs/contact_me.dart b/lib/tabs/contact_me.dart index 462182c..02db5d3 100644 --- a/lib/tabs/contact_me.dart +++ b/lib/tabs/contact_me.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import '../src/contact_me/data.dart'; import '../src/contact_me/my_bio.dart'; -import '../src/custom/text_style.dart'; +import '../src/custom/custom_text.dart'; import '../src/home/social_media_bar.dart'; import '../src/html_open_link.dart'; import '../src/theme/config.dart'; @@ -61,8 +61,10 @@ class _ContactMeState extends State { padding: const EdgeInsets.symmetric(horizontal: 10.0), child: Column( children: [ - text('Reach Out to me!', 28, - Theme.of(context).primaryColorLight), + CustomText( + text: 'Reach Out to me!', + fontSize: 28, + color: Theme.of(context).primaryColorLight), Padding( padding: const EdgeInsets.symmetric(vertical: 5.0), child: Container( @@ -76,10 +78,13 @@ class _ContactMeState extends State { ), Padding( padding: const EdgeInsets.symmetric(vertical: 5.0), - child: text( - 'DISCUSS A PROJECT OR JUST WANT TO SAY HI? MY INBOX IS OPEN FOR ALL.', - 18, - Theme.of(context).primaryColorLight.withOpacity(0.7)), + child: CustomText( + text: + 'DISCUSS A PROJECT OR JUST WANT TO SAY HI? MY INBOX IS OPEN FOR ALL.', + fontSize: 18, + color: Theme.of(context) + .primaryColorLight + .withOpacity(0.7)), ), MyBio(fontSize: 15), Padding( @@ -98,8 +103,10 @@ class _ContactMeState extends State { scale: 4) else const Center(), - text(' ${data[0]}', 18, - Theme.of(context).primaryColorLight), + CustomText( + text: ' ${data[0]}', + fontSize: 18, + color: Theme.of(context).primaryColorLight), ], ), ), @@ -109,8 +116,10 @@ class _ContactMeState extends State { top: 5.0, ), child: data[1] != '' - ? text('Open for opportunities: ${data[1]}', 18, - Theme.of(context).primaryColorLight) + ? CustomText( + text: 'Open for opportunities: ${data[1]}', + fontSize: 18, + color: Theme.of(context).primaryColorLight) : const Center(), ), Padding( @@ -135,14 +144,17 @@ class _ContactMeState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - text('Reach Out to me!', 35, - Theme.of(context).primaryColorLight), + CustomText( + text: 'Reach Out to me!', + fontSize: 35, + color: Theme.of(context).primaryColorLight), Padding( padding: const EdgeInsets.symmetric(vertical: 8.0), - child: text( - 'DISCUSS A PROJECT OR JUST WANT TO SAY HI? MY INBOX IS OPEN FOR ALL.', - 18, - Theme.of(context) + child: CustomText( + text: + 'DISCUSS A PROJECT OR JUST WANT TO SAY HI? MY INBOX IS OPEN FOR ALL.', + fontSize: 18, + color: Theme.of(context) .primaryColorLight .withOpacity(0.7)), ), @@ -160,14 +172,18 @@ class _ContactMeState extends State { scale: 4) else const Center(), - text(' ${data[0]}', 18, - Theme.of(context).primaryColorLight), + CustomText( + text: ' ${data[0]}', + fontSize: 18, + color: Theme.of(context).primaryColorLight), ], ), ), if (data[1] != '') - text('Open for opportunities: ${data[1]}', 18, - Theme.of(context).primaryColorLight) + CustomText( + text: 'Open for opportunities: ${data[1]}', + fontSize: 18, + color: Theme.of(context).primaryColorLight) else const Center(), ], @@ -201,14 +217,18 @@ class _ContactMeState extends State { children: [ TextButton( onPressed: () => htmlOpenLink(getNameAndLink[1]), - child: text('Made with ❤️ by ${getNameAndLink[0]}', 10, - Theme.of(context).primaryColorLight), + child: CustomText( + text: 'Made with ❤️ by ${getNameAndLink[0]}', + fontSize: 10, + color: Theme.of(context).primaryColorLight), ), TextButton( onPressed: () => htmlOpenLink( 'https://github.com/danger-ahead/flutter_dev_folio'), - child: text('Theme by flutter_dev_folio', 10, - Theme.of(context).primaryColorLight), + child: CustomText( + text: 'Theme by flutter_dev_folio', + fontSize: 10, + color: Theme.of(context).primaryColorLight), ) ], ), diff --git a/lib/tabs/education.dart b/lib/tabs/education.dart index 9073a72..e80c2b1 100644 --- a/lib/tabs/education.dart +++ b/lib/tabs/education.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; -import '../src/education/card_desktop.dart'; -import '../src/education/card_mobile.dart'; +import '../src/education/card.dart'; import '../src/education/data.dart'; import '../src/nav_bar/title_bar.dart'; @@ -28,9 +27,7 @@ class Education extends StatelessWidget { (int i) => Padding( padding: EdgeInsets.only( left: 30.0, right: 30.0, bottom: height * 0.05), - child: EducationMobileCard( - height: height, - width: width, + child: EducationDesktop( instiution: data[i][0], location: data[i][1], desc: data[i][3], @@ -52,9 +49,7 @@ class Education extends StatelessWidget { data.length, (int i) => Padding( padding: EdgeInsets.only(bottom: height * 0.025), - child: EducationDesktopCard( - height: height * 0.9, - width: width, + child: EducationDesktop( instiution: data[i][0], location: data[i][1], desc: data[i][3], diff --git a/lib/tabs/experience.dart b/lib/tabs/experience.dart index f1ae111..33d4896 100644 --- a/lib/tabs/experience.dart +++ b/lib/tabs/experience.dart @@ -26,8 +26,6 @@ class Experience extends StatelessWidget { padding: EdgeInsets.only( left: 30.0, right: 30.0, bottom: height * 0.05), child: ExperienceCard( - height: height * 0.75, - width: width, image: data[i][4], title: data[i][0], role: data[i][1], @@ -53,8 +51,6 @@ class Experience extends StatelessWidget { : data.length - storage - 1, (int index) { storage = index + i * 3; return ExperienceCard( - height: height * 0.85, - width: width, image: data[index + i * 3][4], title: data[index + i * 3][0], role: data[index + i * 3][1], diff --git a/lib/tabs/projects.dart b/lib/tabs/projects.dart index e760239..7c71e30 100644 --- a/lib/tabs/projects.dart +++ b/lib/tabs/projects.dart @@ -25,8 +25,6 @@ class Projects extends StatelessWidget { return Container( padding: EdgeInsets.fromLTRB(30.0, 0.0, 30.0, height * 0.05), child: ProjectsCard( - height: height * 0.75, - width: width, title: data[i][0], techStack: data[i][1], desc: data[i][2], @@ -51,8 +49,6 @@ class Projects extends StatelessWidget { : data.length - storage - 1, (int index) { storage = index + i * 3; return ProjectsCard( - height: height, - width: width, title: data[index + i * 3][0], techStack: data[index + i * 3][1], desc: data[index + i * 3][2], diff --git a/lib/tabs/what_i_do.dart b/lib/tabs/what_i_do.dart index e5b5cd5..4e9d747 100644 --- a/lib/tabs/what_i_do.dart +++ b/lib/tabs/what_i_do.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; -import '../src/custom/text_style.dart'; +import '../src/custom/custom_text.dart'; import '../src/nav_bar/title_bar.dart'; import '../src/theme/config.dart'; import '../src/whatIDo/data.dart'; @@ -31,8 +31,10 @@ class WhatIdo extends StatelessWidget { children: [ Padding( padding: const EdgeInsets.fromLTRB(15, 10, 15, 20), - child: text('⚡ I have a good proficiency in:', 15, - Theme.of(context).primaryColorLight), + child: CustomText( + text: '⚡ I have a good proficiency in:', + fontSize: 15, + color: Theme.of(context).primaryColorLight), ), Padding( padding: const EdgeInsets.only( @@ -67,12 +69,12 @@ class WhatIdo extends StatelessWidget { ), Padding( padding: const EdgeInsets.fromLTRB(15, 30, 15, 20), - child: text( - data[1].isNotEmpty + child: CustomText( + text: data[1].isNotEmpty ? '⚡ Some languages & tools I use:' : '', - 15, - Theme.of(context).primaryColorLight), + fontSize: 15, + color: Theme.of(context).primaryColorLight), ), Padding( padding: const EdgeInsets.fromLTRB(15, 25, 15, 20), @@ -109,8 +111,10 @@ class WhatIdo extends StatelessWidget { children: [ Padding( padding: const EdgeInsets.fromLTRB(70, 10, 70, 20), - child: text('⚡ I have a good proficiency in:', 35, - Theme.of(context).primaryColorLight), + child: CustomText( + text: '⚡ I have a good proficiency in:', + fontSize: 35, + color: Theme.of(context).primaryColorLight), ), Padding( padding: const EdgeInsets.only(bottom: 25.0), @@ -140,12 +144,12 @@ class WhatIdo extends StatelessWidget { ), Padding( padding: const EdgeInsets.fromLTRB(70, 30, 70, 20), - child: text( - data[1].isNotEmpty + child: CustomText( + text: data[1].isNotEmpty ? '⚡ Some languages & tools I use:' : '', - 35, - Theme.of(context).primaryColorLight), + fontSize: 35, + color: Theme.of(context).primaryColorLight), ), Padding( padding: const EdgeInsets.only(