From 1f215aa12e0862b349b85af195643a209aaff7ee Mon Sep 17 00:00:00 2001 From: Shashi Kumar Date: Thu, 22 Apr 2021 13:50:00 +0530 Subject: [PATCH] :robot: added bootstrap to minimize code --- lib/app/colors.dart | 22 +- lib/app/configs.dart | 22 +- lib/app/icons.dart | 7 + lib/app/snackbar_config.dart | 35 -- lib/core/models/skill_display.dart | 9 + lib/core/utils/ScreenUiHelper.dart | 37 +- lib/main.dart | 2 - .../views/about me/about_view_all_size.dart | 1 + .../contact me/contact_desktop_view.dart | 7 +- .../views/contact me/contact_mobile_view.dart | 244 ++++++------ .../views/contact me/contact_tablet_view.dart | 335 ---------------- lib/ui/views/contact me/contact_view.dart | 3 +- .../experience/experience_tablet_view.dart | 23 +- .../experience/experience_view_mobile.dart | 25 +- lib/ui/views/home/home_view.dart | 2 +- lib/ui/views/home/home_view_desktop.dart | 14 +- lib/ui/views/home/home_view_mobile.dart | 49 ++- lib/ui/views/home/home_view_model.dart | 50 +-- lib/ui/views/home/home_view_tablet.dart | 78 ---- lib/ui/views/main/main_view.dart | 73 ++-- lib/ui/views/main/main_view_model.dart | 9 + lib/ui/views/projects/project_view.dart | 12 +- .../views/projects/project_view_desktop.dart | 92 ----- .../views/projects/project_view_mobile.dart | 59 --- lib/ui/views/projects/project_view_model.dart | 8 + .../projects/project_view_responsive.dart | 132 +++++++ .../views/projects/project_view_tablet.dart | 59 --- lib/ui/widgets/chipWidget.dart | 30 -- lib/ui/widgets/custom_toast.dart | 43 -- lib/ui/widgets/eductaion_timeline_widget.dart | 4 +- lib/ui/widgets/experience_chip_widget.dart | 45 --- lib/ui/widgets/projectWidget.dart | 368 +++++------------- lib/ui/widgets/timeline_widget.dart | 155 ++++++-- pubspec.lock | 15 +- pubspec.yaml | 6 +- 35 files changed, 720 insertions(+), 1355 deletions(-) delete mode 100644 lib/app/snackbar_config.dart create mode 100644 lib/core/models/skill_display.dart delete mode 100644 lib/ui/views/contact me/contact_tablet_view.dart delete mode 100644 lib/ui/views/home/home_view_tablet.dart delete mode 100644 lib/ui/views/projects/project_view_desktop.dart delete mode 100644 lib/ui/views/projects/project_view_mobile.dart create mode 100644 lib/ui/views/projects/project_view_responsive.dart delete mode 100644 lib/ui/views/projects/project_view_tablet.dart delete mode 100644 lib/ui/widgets/chipWidget.dart delete mode 100644 lib/ui/widgets/custom_toast.dart delete mode 100644 lib/ui/widgets/experience_chip_widget.dart diff --git a/lib/app/colors.dart b/lib/app/colors.dart index acc46c7..f4eb24f 100644 --- a/lib/app/colors.dart +++ b/lib/app/colors.dart @@ -1,18 +1,18 @@ import 'package:flutter/material.dart'; -//** Theme Colors -const primaryColor = Color(0xFF2D4CC8); -const backgroundColor = Color(0xFFe6e7ee); -const surfaceColor = Color(0xFFe5e6ed); +// //** Theme Colors +// const primaryColor = Color(0xFF2D4CC8); +// const backgroundColor = Color(0xFFe6e7ee); +// const surfaceColor = Color(0xFFe5e6ed); -//** Text Colors -const Color textPrimaryColor = Color(0xFF31344b); -const Color textSecondaryColor = Color(0xFF53577b); +// //** Text Colors +// const Color textPrimaryColor = Color(0xFF31344b); +// const Color textSecondaryColor = Color(0xFF53577b); -const Color dividerColor = Colors.black54; +// const Color dividerColor = Colors.black54; -const Color successColor = Colors.green; -const Color failureColor = Colors.red; +// const Color successColor = Colors.green; +// const Color failureColor = Colors.red; mixin lightColor { //** Theme Colors @@ -34,7 +34,7 @@ mixin darkColor { //**Text Colors static const Color textPrimaryColor = Color(0xFFCCD6F6); - static const Color textSecondaryColor = Colors.white60; + static const Color textSecondaryColor = Colors.white30; static const Color dividerColor = Colors.white60; } diff --git a/lib/app/configs.dart b/lib/app/configs.dart index f8a4451..91c68bf 100644 --- a/lib/app/configs.dart +++ b/lib/app/configs.dart @@ -1,5 +1,7 @@ +import 'package:flutter/material.dart'; import 'package:portfolio/app/icons.dart'; import 'package:portfolio/core/models/project.dart'; +import 'package:portfolio/core/models/skill_display.dart'; import 'package:portfolio/core/models/skill_model.dart'; import 'package:portfolio/core/models/technologies.dart'; import 'package:portfolio/core/models/timeline_experience.dart'; @@ -40,6 +42,24 @@ mixin EducationDetails { //*Personal details mixin PersonalDetails { + static const List skillDisplayList = [ + SkillDisplay( + title: "Mobile Application Developement", + color: Color(0xFFE2A599), + iconData: SkillDisplayIcons.appIcon), + SkillDisplay( + title: "Full Stack Web Developement", + color: Color(0xFF5E57BB), + iconData: SkillDisplayIcons.websiteIcon), + SkillDisplay( + title: "AI/ML Engineering", + color: Color(0xFFE45447), + iconData: SkillDisplayIcons.mlIcon), + SkillDisplay( + title: "Database Management", + color: Color(0xFFFFB300), + iconData: SkillDisplayIcons.databaseIcon) + ]; static const String resumeLink = "https://drive.google.com/file/d/1zgGpQfz1sgvG-8eiCDXzmBIu59mJ7Jho/view?usp=sharing"; static const String whatsappLink = "https://wa.me/7997217156"; @@ -238,7 +258,7 @@ mixin PersonalDetails { static String userName = "Shashi Kumar"; static String shortIntro = - "A dexterous builder for mobile and web application."; + "I’m Shashi Kumar and I’m a full stack developer, and I specialize in efficient Flutter Applications that just work across all platforms and browsers. I care deeply about building interfaces that are usable and pleasant for the most number of people possible.And my main motto whenever building any application is to always build pixel perfect high performant applications that provide user with a rich experience."; static String intro = "I started my career into developement as android developer.First I built android applications in native android.Later I heared about flutter which helps in building cross platform applications.After gaining experience in flutter,I applied to internships,through which I was able to learn communication skills and code architectures.After that I worked as a freelancer and gained experience of how to build applications in production level.Presently I'm focusing on web developement.I learnt MERN Stack.And working projects on it."; } diff --git a/lib/app/icons.dart b/lib/app/icons.dart index 14db603..e85a96c 100644 --- a/lib/app/icons.dart +++ b/lib/app/icons.dart @@ -46,3 +46,10 @@ mixin TechnologiesIcon { static const IconData pythonIcon = FlutterIcons.language_python_mco; static const IconData githubIcon = FlutterIcons.github_fea; } + +mixin SkillDisplayIcons { + static const IconData appIcon = FlutterIcons.device_mobile_oct; + static const IconData websiteIcon = FlutterIcons.laptop_mac_mco; + static const IconData mlIcon = FlutterIcons.brain_mco; + static const IconData databaseIcon = FlutterIcons.database_fea; +} diff --git a/lib/app/snackbar_config.dart b/lib/app/snackbar_config.dart deleted file mode 100644 index 312bbbb..0000000 --- a/lib/app/snackbar_config.dart +++ /dev/null @@ -1,35 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:portfolio/app/colors.dart'; -import 'package:portfolio/app/icons.dart'; -import 'package:get/get.dart'; -import 'package:stacked_services/stacked_services.dart'; - -import 'locator.dart'; - -enum SnackbarType { floating } -void setupSnackbarUi() { - final service = locator(); - service.registerCustomSnackbarConfig( - variant: SnackbarType.floating, - config: SnackbarConfig( - margin: const EdgeInsets.symmetric(horizontal: 15).copyWith(bottom: 20), - messageColor: Colors.white70, - icon: Icon( - ToastIcons.successIcon, - color: successColor, - ), - backgroundColor: primaryColor, - mainButtonTextColor: successColor, - padding: const EdgeInsets.all(12).copyWith(top: 15), - textColor: Colors.white, - overlayBlur: 2, - snackPosition: SnackPosition.BOTTOM, - snackStyle: SnackStyle.FLOATING, - barBlur: 2, - boxShadows: [BoxShadow(color: primaryColor)], - animationDuration: Duration(seconds: 2), - borderRadius: 10, - dismissDirection: SnackDismissDirection.VERTICAL, - ), - ); -} diff --git a/lib/core/models/skill_display.dart b/lib/core/models/skill_display.dart new file mode 100644 index 0000000..27ab578 --- /dev/null +++ b/lib/core/models/skill_display.dart @@ -0,0 +1,9 @@ +import 'package:flutter/cupertino.dart'; + +class SkillDisplay { + final String title; + final IconData iconData; + final Color color; + + const SkillDisplay({this.title, this.iconData, this.color}); +} diff --git a/lib/core/utils/ScreenUiHelper.dart b/lib/core/utils/ScreenUiHelper.dart index 5f1e39f..04241b3 100644 --- a/lib/core/utils/ScreenUiHelper.dart +++ b/lib/core/utils/ScreenUiHelper.dart @@ -3,6 +3,7 @@ import 'package:flutter_neumorphic/flutter_neumorphic.dart'; import 'package:portfolio/app/colors.dart'; import 'package:portfolio/app/configs.dart'; import 'package:portfolio/core/utils/scaling.dart'; +import 'package:responsive_builder/responsive_builder.dart'; class ScreenUiHelper { double width; @@ -18,6 +19,10 @@ class ScreenUiHelper { TextStyle body; TextStyle buttonStyle; + double headlineSize; + double titleSize; + double bodySize; + Color surfaceColor; Color backgroundColor; Color primaryColor; @@ -67,16 +72,32 @@ class ScreenUiHelper { scalingHelper = ScalingHelper(width: screenWidth); + headlineSize = getDeviceType(mediaQuery.size) == DeviceScreenType.desktop + ? 24 + : getDeviceType(mediaQuery.size) == DeviceScreenType.tablet + ? 24 + : 20; + titleSize = getDeviceType(mediaQuery.size) == DeviceScreenType.desktop + ? 20 + : getDeviceType(mediaQuery.size) == DeviceScreenType.tablet + ? 18 + : 16; + bodySize = getDeviceType(mediaQuery.size) == DeviceScreenType.desktop + ? 14 + : getDeviceType(mediaQuery.size) == DeviceScreenType.tablet + ? 14 + : 12; + headline = TextStyle( fontWeight: FontWeight.bold, color: textPrimaryColor, - fontSize: 24, + fontSize: headlineSize, decoration: TextDecoration.none, fontFamily: SystemProperties.titleFont); title = TextStyle( fontWeight: FontWeight.w600, - fontSize: 18, + fontSize: titleSize, color: textPrimaryColor, decoration: TextDecoration.none, fontFamily: SystemProperties.titleFont); @@ -85,35 +106,35 @@ class ScreenUiHelper { decoration: TextDecoration.none, fontWeight: FontWeight.bold, color: textPrimaryColor, - fontSize: 14); + fontSize: bodySize); body = TextStyle( color: textSecondaryColor, fontWeight: FontWeight.w400, - fontSize: 14, + fontSize: bodySize, decoration: TextDecoration.none, fontFamily: SystemProperties.fontName); headlineTextStyle = NeumorphicTextStyle( fontWeight: FontWeight.bold, - fontSize: 24, + fontSize: headlineSize, decoration: TextDecoration.none, fontFamily: SystemProperties.titleFont); titleTextStyle = NeumorphicTextStyle( fontWeight: FontWeight.w600, - fontSize: 18, + fontSize: titleSize, decoration: TextDecoration.none, fontFamily: SystemProperties.titleFont); buttonTextStyle = NeumorphicTextStyle( fontFamily: SystemProperties.titleFont, decoration: TextDecoration.none, fontWeight: FontWeight.bold, - fontSize: 14); + fontSize: bodySize); bodyTextStyle = NeumorphicTextStyle( fontWeight: FontWeight.w400, - fontSize: 14, + fontSize: bodySize, decoration: TextDecoration.none, fontFamily: SystemProperties.fontName); diff --git a/lib/main.dart b/lib/main.dart index 639d26d..70e1e75 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,6 +1,5 @@ import 'package:flutter_neumorphic/flutter_neumorphic.dart'; import 'package:portfolio/app/locator.dart'; -import 'package:portfolio/app/snackbar_config.dart'; import 'package:flutter/material.dart'; import 'package:portfolio/app/theme.dart'; @@ -11,7 +10,6 @@ import 'ui/views/main/main_view.dart'; Future main() async { setPathUrlStrategy(); await setupLocator(); - setupSnackbarUi(); runApp(MyApp()); } diff --git a/lib/ui/views/about me/about_view_all_size.dart b/lib/ui/views/about me/about_view_all_size.dart index 71fb641..cc6ac45 100644 --- a/lib/ui/views/about me/about_view_all_size.dart +++ b/lib/ui/views/about me/about_view_all_size.dart @@ -99,6 +99,7 @@ class AboutViewResponsive extends StatelessWidget { ), SizedBox(height: 15), Timeline( + indicatorSize: 16, indicatorColor: uiHelpers.primaryColor, lineColor: uiHelpers.textSecondaryColor, shrinkWrap: true, diff --git a/lib/ui/views/contact me/contact_desktop_view.dart b/lib/ui/views/contact me/contact_desktop_view.dart index 57c4515..034d0eb 100644 --- a/lib/ui/views/contact me/contact_desktop_view.dart +++ b/lib/ui/views/contact me/contact_desktop_view.dart @@ -1,6 +1,5 @@ import 'package:flutter/material.dart'; import 'package:flutter_neumorphic/flutter_neumorphic.dart'; -import 'package:portfolio/app/colors.dart'; import 'package:portfolio/app/configs.dart'; import 'package:portfolio/app/icons.dart'; import 'package:portfolio/core/utils/ScreenUiHelper.dart'; @@ -170,7 +169,7 @@ class ContactDesktopView extends StatelessWidget { prefixIcon: Icon( FormIcon.nameIcon, color: model.hasFocusMap["name"] - ? primaryColor + ? uiHelpers.primaryColor : uiHelpers .textPrimaryColor, ), @@ -227,7 +226,7 @@ class ContactDesktopView extends StatelessWidget { FormIcon.nameIcon, color: model.hasFocusMap["email"] - ? primaryColor + ? uiHelpers.primaryColor : uiHelpers .textPrimaryColor, ), @@ -280,7 +279,7 @@ class ContactDesktopView extends StatelessWidget { FormIcon.nameIcon, color: model.hasFocusMap["subject"] - ? primaryColor + ? uiHelpers.primaryColor : uiHelpers .textPrimaryColor, ), diff --git a/lib/ui/views/contact me/contact_mobile_view.dart b/lib/ui/views/contact me/contact_mobile_view.dart index d03c58a..65c7d4a 100644 --- a/lib/ui/views/contact me/contact_mobile_view.dart +++ b/lib/ui/views/contact me/contact_mobile_view.dart @@ -1,10 +1,11 @@ import 'package:flutter/material.dart'; -import 'package:portfolio/app/colors.dart'; +import 'package:flutter_neumorphic/flutter_neumorphic.dart'; import 'package:portfolio/app/configs.dart'; import 'package:portfolio/app/icons.dart'; import 'package:portfolio/core/utils/ScreenUiHelper.dart'; import 'package:portfolio/ui/views/contact%20me/contact_view_model.dart'; import 'package:portfolio/ui/widgets/fadeAnimation.dart'; +import 'package:portfolio/ui/widgets/icon_wrapper.dart'; class ContactMobileView extends StatelessWidget { final ScreenUiHelper uiHelpers; @@ -39,6 +40,7 @@ class ContactMobileView extends StatelessWidget { child: Text( "Contact me for hiring,or help me to join your team", style: uiHelpers.body.copyWith(fontSize: 18), + textAlign: TextAlign.center, ), ), uiHelpers.verticalSpaceMedium, @@ -49,27 +51,27 @@ class ContactMobileView extends StatelessWidget { FadeAnimation( yDistance: 30, delay: 1.25, - child: IconButton( - icon: Icon(ContactIcons.githubIcon), - onPressed: () => + child: IconWrrapper( + child: Icon(ContactIcons.githubIcon), + onTap: () => model.navigateToSocial(SocialLinks.githubLink), ), ), FadeAnimation( yDistance: 30, delay: 1.25, - child: IconButton( - icon: Icon(ContactIcons.twitterIcon), - onPressed: () => + child: IconWrrapper( + child: Icon(ContactIcons.twitterIcon), + onTap: () => model.navigateToSocial(SocialLinks.twitterLink), ), ), FadeAnimation( yDistance: 30, delay: 1.25, - child: IconButton( - icon: Icon(ContactIcons.linkedinIcon), - onPressed: () => + child: IconWrrapper( + child: Icon(ContactIcons.linkedinIcon), + onTap: () => model.navigateToSocial(SocialLinks.linkedinUrl), ), ) @@ -95,35 +97,40 @@ class ContactMobileView extends StatelessWidget { SizedBox( height: 4, ), - TextFormField( - controller: model.nameController, - validator: (String value) { - if (value.trim().isEmpty) { - return "Please Enter Name"; - } + Neumorphic( + style: NeumorphicStyle( + color: uiHelpers.surfaceColor, + depth: NeumorphicTheme.embossDepth(context), + boxShape: NeumorphicBoxShape.roundRect( + BorderRadius.circular(8)), + ), + padding: EdgeInsets.symmetric( + vertical: 4, horizontal: 4), + child: TextFormField( + controller: model.nameController, + validator: (String value) { + if (value.trim().isEmpty) { + return "Please Enter Name"; + } - return null; - }, - focusNode: model.focusNodeMap["name"], - keyboardType: TextInputType.name, - decoration: InputDecoration( + return null; + }, + focusNode: model.focusNodeMap["name"], + keyboardType: TextInputType.name, + decoration: InputDecoration( isDense: true, prefixIcon: Icon( FormIcon.nameIcon, color: model.hasFocusMap["name"] - ? primaryColor - : textPrimaryColor, + ? uiHelpers.primaryColor + : uiHelpers.textPrimaryColor, ), hintText: "Luffy San", - hintStyle: TextStyle(color: textPrimaryColor), - enabledBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(8), - borderSide: - BorderSide(color: textPrimaryColor)), - border: OutlineInputBorder( - borderRadius: BorderRadius.circular(8), - borderSide: - BorderSide(color: textSecondaryColor))), + hintStyle: TextStyle( + color: uiHelpers.textPrimaryColor), + border: InputBorder.none, + ), + ), ), SizedBox(height: 10), Text( @@ -133,39 +140,44 @@ class ContactMobileView extends StatelessWidget { SizedBox( height: 4, ), - TextFormField( - validator: (String value) { - if (value.trim().isEmpty) { - return "Please Enter Email"; - } else if (!RegExp( - r"^[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+$") - .hasMatch(value)) { - return "Please enter valid email"; - } + Neumorphic( + style: NeumorphicStyle( + color: uiHelpers.surfaceColor, + depth: NeumorphicTheme.embossDepth(context), + boxShape: NeumorphicBoxShape.roundRect( + BorderRadius.circular(8)), + ), + padding: EdgeInsets.symmetric( + vertical: 4, horizontal: 4), + child: TextFormField( + validator: (String value) { + if (value.trim().isEmpty) { + return "Please Enter Email"; + } else if (!RegExp( + r"^[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+$") + .hasMatch(value)) { + return "Please enter valid email"; + } - return null; - }, - controller: model.emailController, - focusNode: model.focusNodeMap["email"], - keyboardType: TextInputType.name, - decoration: InputDecoration( + return null; + }, + controller: model.emailController, + focusNode: model.focusNodeMap["email"], + keyboardType: TextInputType.name, + decoration: InputDecoration( + border: InputBorder.none, isDense: true, prefixIcon: Icon( FormIcon.nameIcon, color: model.hasFocusMap["email"] - ? primaryColor - : textPrimaryColor, + ? uiHelpers.primaryColor + : uiHelpers.textPrimaryColor, ), hintText: "youremail@gmail.com", - hintStyle: TextStyle(color: textPrimaryColor), - enabledBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(8), - borderSide: - BorderSide(color: textPrimaryColor)), - border: OutlineInputBorder( - borderRadius: BorderRadius.circular(8), - borderSide: - BorderSide(color: textSecondaryColor))), + hintStyle: TextStyle( + color: uiHelpers.textPrimaryColor), + ), + ), ), SizedBox(height: 10), Text( @@ -175,35 +187,40 @@ class ContactMobileView extends StatelessWidget { SizedBox( height: 4, ), - TextFormField( - controller: model.subjectController, - validator: (String value) { - if (value.trim().isEmpty) { - return "Please Enter Subject"; - } + Neumorphic( + style: NeumorphicStyle( + color: uiHelpers.surfaceColor, + depth: NeumorphicTheme.embossDepth(context), + boxShape: NeumorphicBoxShape.roundRect( + BorderRadius.circular(8)), + ), + padding: EdgeInsets.symmetric( + vertical: 4, horizontal: 4), + child: TextFormField( + controller: model.subjectController, + validator: (String value) { + if (value.trim().isEmpty) { + return "Please Enter Subject"; + } - return null; - }, - focusNode: model.focusNodeMap["subject"], - keyboardType: TextInputType.name, - decoration: InputDecoration( + return null; + }, + focusNode: model.focusNodeMap["subject"], + keyboardType: TextInputType.name, + decoration: InputDecoration( + border: InputBorder.none, isDense: true, prefixIcon: Icon( FormIcon.nameIcon, color: model.hasFocusMap["subject"] - ? primaryColor - : textPrimaryColor, + ? uiHelpers.primaryColor + : uiHelpers.textPrimaryColor, ), hintText: "Hiring for...", - hintStyle: TextStyle(color: textPrimaryColor), - enabledBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(8), - borderSide: - BorderSide(color: textPrimaryColor)), - border: OutlineInputBorder( - borderRadius: BorderRadius.circular(8), - borderSide: - BorderSide(color: textSecondaryColor))), + hintStyle: TextStyle( + color: uiHelpers.textPrimaryColor), + ), + ), ), SizedBox( height: 10, @@ -215,48 +232,55 @@ class ContactMobileView extends StatelessWidget { SizedBox( height: 4, ), - TextFormField( - controller: model.bodyController, - validator: (String value) { - if (value.trim().isEmpty) { - return "Please Enter Message"; - } + Neumorphic( + style: NeumorphicStyle( + color: uiHelpers.surfaceColor, + depth: NeumorphicTheme.embossDepth(context), + boxShape: NeumorphicBoxShape.roundRect( + BorderRadius.circular(8)), + ), + padding: EdgeInsets.symmetric( + vertical: 4, horizontal: 4), + child: TextFormField( + controller: model.bodyController, + validator: (String value) { + if (value.trim().isEmpty) { + return "Please Enter Message"; + } - return null; - }, - maxLines: 4, - keyboardType: TextInputType.name, - decoration: InputDecoration( + return null; + }, + maxLines: 4, + keyboardType: TextInputType.name, + decoration: InputDecoration( + border: InputBorder.none, isDense: true, - enabledBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(8), - borderSide: - BorderSide(color: textPrimaryColor)), alignLabelWithHint: true, - hintStyle: TextStyle(color: textPrimaryColor), + hintStyle: TextStyle( + color: uiHelpers.textPrimaryColor), hintText: "Your Messsage..", - border: OutlineInputBorder( - borderRadius: BorderRadius.circular(8), - borderSide: - BorderSide(color: textSecondaryColor))), + ), + ), ), ], crossAxisAlignment: CrossAxisAlignment.start), uiHelpers.verticalSpaceMedium, - Container( + Align( alignment: Alignment.center, - child: MaterialButton( + child: IconWrrapper( + margin: const EdgeInsets.all(0), + color: uiHelpers.backgroundColor, + padding: const EdgeInsets.all(0), + onTap: () => model.openMail(), + child: Padding( padding: const EdgeInsets.symmetric( - horizontal: 40, vertical: 20), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(6)), - color: primaryColor, - onPressed: () => model.openMail(), + horizontal: 25, vertical: 15), child: Text( "Send Message", style: uiHelpers.buttonStyle.copyWith( - color: Colors.white, - fontWeight: FontWeight.w400), - )), + color: uiHelpers.textPrimaryColor), + ), + ), + ), ), uiHelpers.verticalSpaceMedium, ], diff --git a/lib/ui/views/contact me/contact_tablet_view.dart b/lib/ui/views/contact me/contact_tablet_view.dart deleted file mode 100644 index 08e4c5c..0000000 --- a/lib/ui/views/contact me/contact_tablet_view.dart +++ /dev/null @@ -1,335 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:portfolio/app/colors.dart'; -import 'package:portfolio/app/configs.dart'; -import 'package:portfolio/app/icons.dart'; -import 'package:portfolio/core/utils/ScreenUiHelper.dart'; -import 'package:portfolio/ui/views/contact%20me/contact_view_model.dart'; -import 'package:portfolio/ui/widgets/contact_header_icon_widget.dart'; -import 'package:portfolio/ui/widgets/fadeAnimation.dart'; - -class ContactTabletView extends StatelessWidget { - final ScreenUiHelper uiHelpers; - final ContactViewModel model; - - const ContactTabletView({Key key, this.uiHelpers, this.model}) - : super(key: key); - @override - Widget build(BuildContext context) { - return Scaffold( - body: Form( - key: model.formKey, - child: Container( - alignment: Alignment.center, - child: SingleChildScrollView( - child: Column( - children: [ - Text( - "Get In Touch!", - style: uiHelpers.headline.copyWith(fontSize: 45), - ), - SizedBox( - height: 8, - ), - FadeAnimation( - xDistance: 50, - delay: 1.5, - child: Text( - "Contact me for hiring,or help me to join your team", - style: uiHelpers.body.copyWith(fontSize: 25), - ), - ), - uiHelpers.verticalSpaceMedium, - Row( - mainAxisAlignment: MainAxisAlignment.center, - mainAxisSize: MainAxisSize.max, - children: [ - FadeAnimation( - xDistance: 50, - delay: 2, - child: MouseRegion( - onEnter: (event) => - model.changeSelected(true, "Github"), - onExit: (event) => - model.changeSelected(false, "Github"), - child: ContactIconHeader( - onTap: () => - model.navigateToSocial(SocialLinks.githubLink), - name: "Github", - icon: ContactIcons.githubIcon, - isActive: model.selected == "Github", - ), - ), - ), - FadeAnimation( - xDistance: 50, - delay: 2.4, - child: MouseRegion( - onEnter: (event) => - model.changeSelected(true, "Twitter"), - onExit: (event) => - model.changeSelected(false, "Twitter"), - child: ContactIconHeader( - onTap: () => - model.navigateToSocial(SocialLinks.twitterLink), - name: "Twitter", - icon: ContactIcons.twitterIcon, - isActive: model.selected == "Twitter", - ), - ), - ), - FadeAnimation( - xDistance: 50, - delay: 2.6, - child: MouseRegion( - onEnter: (event) => - model.changeSelected(true, "LinkedIn"), - onExit: (event) => - model.changeSelected(false, "LinkedIn"), - child: ContactIconHeader( - onTap: () => - model.navigateToSocial(SocialLinks.linkedinUrl), - name: "LinkedIn", - icon: ContactIcons.linkedinIcon, - isActive: model.selected == "LinkedIn", - ), - ), - ), - ], - ), - uiHelpers.verticalSpaceMedium, - FadeAnimation( - xDistance: 50, - delay: 2.8, - child: Card( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10)), - child: Container( - padding: const EdgeInsets.symmetric( - horizontal: 25, vertical: 25), - width: uiHelpers.width * 0.6, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - "Contact Form", - style: uiHelpers.headline, - ), - uiHelpers.verticalSpaceLow, - Row( - children: [ - Container( - width: uiHelpers.width * 0.3, - child: Column( - children: [ - Text( - "Your Name", - style: uiHelpers.body, - ), - SizedBox( - height: 4, - ), - TextFormField( - controller: model.nameController, - validator: (String value) { - if (value.trim().isEmpty) { - return "Please Enter Name"; - } - - return null; - }, - focusNode: model.focusNodeMap["name"], - keyboardType: TextInputType.name, - decoration: InputDecoration( - prefixIcon: Icon( - FormIcon.nameIcon, - color: model.hasFocusMap["name"] - ? primaryColor - : textPrimaryColor, - ), - hintText: "Luffy San", - hintStyle: TextStyle( - color: textPrimaryColor), - enabledBorder: OutlineInputBorder( - borderRadius: - BorderRadius.circular(8), - borderSide: BorderSide( - color: textPrimaryColor)), - border: OutlineInputBorder( - borderRadius: - BorderRadius.circular(8), - borderSide: BorderSide( - color: - textSecondaryColor))), - ), - SizedBox(height: 10), - Text( - "Your Email", - style: uiHelpers.body, - ), - SizedBox( - height: 4, - ), - TextFormField( - controller: model.emailController, - validator: (String value) { - if (value.trim().isEmpty) { - return "Please Enter Email"; - } else if (!RegExp( - r"^[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+$") - .hasMatch(value)) { - return "Please enter valid email"; - } - - return null; - }, - focusNode: model.focusNodeMap["email"], - keyboardType: TextInputType.name, - decoration: InputDecoration( - prefixIcon: Icon( - FormIcon.nameIcon, - color: model.hasFocusMap["email"] - ? primaryColor - : textPrimaryColor, - ), - hintText: "youremail@gmail.com", - hintStyle: TextStyle( - color: textPrimaryColor), - enabledBorder: OutlineInputBorder( - borderRadius: - BorderRadius.circular(8), - borderSide: BorderSide( - color: textPrimaryColor)), - border: OutlineInputBorder( - borderRadius: - BorderRadius.circular(8), - borderSide: BorderSide( - color: - textSecondaryColor))), - ), - SizedBox(height: 10), - Text( - "Subject", - style: uiHelpers.body, - ), - SizedBox( - height: 4, - ), - TextFormField( - controller: model.subjectController, - validator: (String value) { - if (value.trim().isEmpty) { - return "Please Enter Subject"; - } - return null; - }, - focusNode: - model.focusNodeMap["subject"], - keyboardType: TextInputType.name, - decoration: InputDecoration( - prefixIcon: Icon( - FormIcon.nameIcon, - color: - model.hasFocusMap["subject"] - ? primaryColor - : textPrimaryColor, - ), - hintText: "Hiring for...", - hintStyle: TextStyle( - color: textPrimaryColor), - enabledBorder: OutlineInputBorder( - borderRadius: - BorderRadius.circular(8), - borderSide: BorderSide( - color: textPrimaryColor)), - border: OutlineInputBorder( - borderRadius: - BorderRadius.circular(8), - borderSide: BorderSide( - color: - textSecondaryColor))), - ), - ], - crossAxisAlignment: - CrossAxisAlignment.start), - ), - Expanded( - child: Container( - padding: const EdgeInsets.only(left: 15), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - "Message", - style: uiHelpers.body, - ), - SizedBox( - height: 4, - ), - TextFormField( - controller: model.bodyController, - validator: (String value) { - if (value.trim().isEmpty) { - return "Please Enter Message"; - } - - return null; - }, - maxLines: 10, - keyboardType: TextInputType.name, - decoration: InputDecoration( - enabledBorder: OutlineInputBorder( - borderRadius: - BorderRadius.circular(8), - borderSide: BorderSide( - color: textPrimaryColor)), - alignLabelWithHint: true, - hintStyle: TextStyle( - color: textPrimaryColor), - hintText: "Your Messsage..", - border: OutlineInputBorder( - borderRadius: - BorderRadius.circular(8), - borderSide: BorderSide( - color: - textSecondaryColor))), - ), - ], - ), - ), - ) - ], - ), - uiHelpers.verticalSpaceHigh, - Container( - alignment: Alignment.center, - child: MaterialButton( - padding: const EdgeInsets.symmetric( - horizontal: 40, vertical: 20), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(6)), - color: primaryColor, - onPressed: () => model.openMail(), - child: Text( - "Send Message", - style: uiHelpers.buttonStyle.copyWith( - color: Colors.white, - fontWeight: FontWeight.w400), - )), - ), - ], - ), - ), - ), - ) - ], - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, - mainAxisSize: MainAxisSize.max, - ), - ), - ), - ), - ); - } -} diff --git a/lib/ui/views/contact me/contact_view.dart b/lib/ui/views/contact me/contact_view.dart index 991cba2..fba1436 100644 --- a/lib/ui/views/contact me/contact_view.dart +++ b/lib/ui/views/contact me/contact_view.dart @@ -3,7 +3,6 @@ import 'package:oktoast/oktoast.dart'; import 'package:portfolio/core/utils/architecture_view.dart'; import 'package:portfolio/ui/views/contact%20me/contact_desktop_view.dart'; import 'package:portfolio/ui/views/contact%20me/contact_mobile_view.dart'; -import 'package:portfolio/ui/views/contact%20me/contact_tablet_view.dart'; import 'package:responsive_builder/responsive_builder.dart'; import 'contact_view_model.dart'; @@ -26,7 +25,7 @@ class ContactView extends StatelessWidget { uiHelpers: uiHelpers, model: model, ), - tablet: ContactTabletView( + tablet: ContactDesktopView( uiHelpers: uiHelpers, model: model, ), diff --git a/lib/ui/views/experience/experience_tablet_view.dart b/lib/ui/views/experience/experience_tablet_view.dart index c9f895c..3197f4f 100644 --- a/lib/ui/views/experience/experience_tablet_view.dart +++ b/lib/ui/views/experience/experience_tablet_view.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:portfolio/app/colors.dart'; import 'package:portfolio/app/configs.dart'; import 'package:portfolio/app/icons.dart'; import 'package:portfolio/core/utils/ScreenUiHelper.dart'; @@ -31,11 +30,13 @@ class ExperienceTabletView extends StatelessWidget { uiHelpers.verticalSpaceLow, TabBar( labelStyle: TextStyle( - color: primaryColor, fontWeight: FontWeight.bold), + color: uiHelpers.primaryColor, + fontWeight: FontWeight.bold), unselectedLabelStyle: TextStyle( - color: primaryColor, fontWeight: FontWeight.w300), - unselectedLabelColor: textSecondaryColor, - labelColor: primaryColor, + color: uiHelpers.primaryColor, + fontWeight: FontWeight.w300), + unselectedLabelColor: uiHelpers.textSecondaryColor, + labelColor: uiHelpers.primaryColor, isScrollable: true, physics: BouncingScrollPhysics(), tabs: [ @@ -62,22 +63,22 @@ class ExperienceTabletView extends StatelessWidget { text: TextSpan( text: PersonalDetails.experienceList[i].title, - style: uiHelpers.title - .copyWith(color: textPrimaryColor), + style: uiHelpers.title.copyWith( + color: uiHelpers.textPrimaryColor), children: [ TextSpan( text: " @${PersonalDetails.experienceList[i].position}", - style: uiHelpers.body - .copyWith(color: primaryColor), + style: uiHelpers.body.copyWith( + color: uiHelpers.primaryColor), ) ]), ), SizedBox(height: 8), Text( "${PersonalDetails.experienceList[i].timePeriod}", - style: uiHelpers.body - .copyWith(color: textSecondaryColor), + style: uiHelpers.body.copyWith( + color: uiHelpers.textSecondaryColor), ), uiHelpers.verticalSpaceLow, ListView.builder( diff --git a/lib/ui/views/experience/experience_view_mobile.dart b/lib/ui/views/experience/experience_view_mobile.dart index 483903e..a4a8e58 100644 --- a/lib/ui/views/experience/experience_view_mobile.dart +++ b/lib/ui/views/experience/experience_view_mobile.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +// ignore: unused_import import 'package:portfolio/app/colors.dart'; import 'package:portfolio/app/configs.dart'; import 'package:portfolio/app/icons.dart'; @@ -31,11 +32,13 @@ class ExperienceMobileView extends StatelessWidget { uiHelpers.verticalSpaceLow, TabBar( labelStyle: TextStyle( - color: primaryColor, fontWeight: FontWeight.bold), + color: uiHelpers.primaryColor, + fontWeight: FontWeight.bold), unselectedLabelStyle: TextStyle( - color: primaryColor, fontWeight: FontWeight.w300), - unselectedLabelColor: textSecondaryColor, - labelColor: primaryColor, + color: uiHelpers.primaryColor, + fontWeight: FontWeight.w300), + unselectedLabelColor: uiHelpers.textSecondaryColor, + labelColor: uiHelpers.primaryColor, isScrollable: true, physics: BouncingScrollPhysics(), tabs: [ @@ -62,22 +65,22 @@ class ExperienceMobileView extends StatelessWidget { text: TextSpan( text: PersonalDetails.experienceList[i].title, - style: uiHelpers.title - .copyWith(color: textPrimaryColor), + style: uiHelpers.title.copyWith( + color: uiHelpers.textPrimaryColor), children: [ TextSpan( text: " @${PersonalDetails.experienceList[i].position}", - style: uiHelpers.body - .copyWith(color: primaryColor), + style: uiHelpers.body.copyWith( + color: uiHelpers.primaryColor), ) ]), ), SizedBox(height: 8), Text( "${PersonalDetails.experienceList[i].timePeriod}", - style: uiHelpers.body - .copyWith(color: textSecondaryColor), + style: uiHelpers.body.copyWith( + color: uiHelpers.textSecondaryColor), ), uiHelpers.verticalSpaceLow, ListView.builder( @@ -114,7 +117,7 @@ class ExperienceMobileView extends StatelessWidget { Container( width: uiHelpers.width * 0.16, child: Divider( - color: Colors.white60, + color: uiHelpers.dividerColor, thickness: 2.5, ), ), diff --git a/lib/ui/views/home/home_view.dart b/lib/ui/views/home/home_view.dart index 9f47c22..931c6ed 100644 --- a/lib/ui/views/home/home_view.dart +++ b/lib/ui/views/home/home_view.dart @@ -12,7 +12,7 @@ class HomeView extends StatelessWidget { return ScreenBuilder( viewModel: HomeViewModel(), disposeViewModel: true, - onModelReady: (model) => model.init(), + onModelReady: (model) => model.init(context), builder: (context, uiHelpers, model) { return Scaffold( body: ScreenTypeLayout( diff --git a/lib/ui/views/home/home_view_desktop.dart b/lib/ui/views/home/home_view_desktop.dart index 90dacf4..70a4e3e 100644 --- a/lib/ui/views/home/home_view_desktop.dart +++ b/lib/ui/views/home/home_view_desktop.dart @@ -1,6 +1,5 @@ import 'package:flutter/material.dart'; import 'package:flutter_neumorphic/flutter_neumorphic.dart'; -import 'package:portfolio/app/colors.dart'; import 'package:portfolio/app/configs.dart'; import 'package:portfolio/app/icons.dart'; import 'package:portfolio/core/utils/ScreenUiHelper.dart'; @@ -112,7 +111,7 @@ class HomeDesktopView extends StatelessWidget { SizedBox(width: 10), Text( e, - style: uiHelpers.headline, + style: uiHelpers.title, ) ], ), @@ -130,17 +129,20 @@ class HomeDesktopView extends StatelessWidget { ), Column( crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, children: [ Container( child: Text( - PersonalDetails.intro, - style: uiHelpers.body - .copyWith(height: 2, color: textPrimaryColor), + PersonalDetails.shortIntro, + style: uiHelpers.body.copyWith( + fontWeight: FontWeight.w400, + height: 2, + color: uiHelpers.textPrimaryColor), ), width: uiHelpers.width * 0.3, ), SizedBox( - height: 10, + height: 15, ), IconWrrapper( padding: const EdgeInsets.symmetric( diff --git a/lib/ui/views/home/home_view_mobile.dart b/lib/ui/views/home/home_view_mobile.dart index b9f3b65..fc3c2e0 100644 --- a/lib/ui/views/home/home_view_mobile.dart +++ b/lib/ui/views/home/home_view_mobile.dart @@ -1,3 +1,4 @@ +import 'package:carousel_slider/carousel_slider.dart'; import 'package:flutter/material.dart'; import 'package:flutter_neumorphic/flutter_neumorphic.dart'; import 'package:portfolio/app/configs.dart'; @@ -59,17 +60,49 @@ class HomeMobileView extends StatelessWidget { style: uiHelpers.headline, ), SizedBox( - height: 10, + height: 25, ), Container( - height: 50.0, - child: PageView.builder( - itemCount: model.titles.length, - controller: model.pageController, - itemBuilder: (_, index) { - return model.titles[index]; + height: 175.0, + child: CarouselSlider.builder( + options: CarouselOptions( + scrollDirection: Axis.horizontal, + autoPlay: true, + viewportFraction: 1), + itemCount: PersonalDetails.skillDisplayList.length, + itemBuilder: (_, index, realIndex) { + return Container( + width: uiHelpers.width, + padding: const EdgeInsets.symmetric( + horizontal: 15, vertical: 20), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon( + PersonalDetails + .skillDisplayList[index].iconData, + color: Colors.white, + size: 30, + ), + SizedBox( + height: 20, + ), + Text( + PersonalDetails.skillDisplayList[index].title, + style: uiHelpers.title.copyWith( + color: Colors.white, + fontSize: 18, + fontFamily: SystemProperties.fontName), + ), + ], + ), + decoration: BoxDecoration( + color: + PersonalDetails.skillDisplayList[index].color, + borderRadius: BorderRadius.circular(12)), + ); }, - scrollDirection: Axis.horizontal, )), SizedBox( height: 30, diff --git a/lib/ui/views/home/home_view_model.dart b/lib/ui/views/home/home_view_model.dart index 99eb9a4..c08b7e9 100644 --- a/lib/ui/views/home/home_view_model.dart +++ b/lib/ui/views/home/home_view_model.dart @@ -1,40 +1,10 @@ -import 'dart:async'; - -import 'package:flutter/cupertino.dart'; import 'package:portfolio/app/configs.dart'; import 'package:portfolio/core/services/url_launcher_service.dart'; import 'package:stacked/stacked.dart'; class HomeViewModel extends BaseViewModel { final UrlLauncherService _urlLauncherService = UrlLauncherService(); - PageController pageController = PageController(); - List titles = [ - RichText( - text: TextSpan( - text: "Innovate Android Developer\nFlutter and Java", - children: [ - TextSpan(text: "Android Developer\nFlutter"), - TextSpan(text: "and"), - TextSpan(text: "Java") - ])), - RichText( - text: TextSpan( - text: "Innovate Android Developer\nFlutter and Java", - children: [ - TextSpan(text: "Android Developer\nFlutter"), - TextSpan(text: "and"), - TextSpan(text: "Java") - ])), - RichText( - text: TextSpan( - text: "Innovate Android Developer\nFlutter and Java", - children: [ - TextSpan(text: "Android Developer\nFlutter"), - TextSpan(text: "and"), - TextSpan(text: "Java") - ])), - ]; bool isIntroCompleted = false; bool isHoveredOnGetInTouch = false; bool isShortIntroCompleted = false; @@ -63,25 +33,7 @@ class HomeViewModel extends BaseViewModel { await _urlLauncherService.launchUrl(SocialLinks.linkedinUrl); } - ding() { - print("yo"); - pageController.animateToPage( - ((pageController.page + 1) % titles.length).toInt(), - duration: Duration(milliseconds: 700), - curve: Curves.easeInOutCubic); - } - - init() async { - await Future.delayed(Duration(seconds: 1)); - - Timer.periodic(Duration(seconds: 5), (Timer timer) { - pageController.animateToPage( - ((pageController.page + 1) % titles.length).toInt(), - duration: Duration(milliseconds: 700), - curve: Curves.easeInOutCubic, - ); - }); - } + init(context) async {} navigateToUrl(String url) async { await _urlLauncherService.launchUrl(url); diff --git a/lib/ui/views/home/home_view_tablet.dart b/lib/ui/views/home/home_view_tablet.dart deleted file mode 100644 index 4e6c073..0000000 --- a/lib/ui/views/home/home_view_tablet.dart +++ /dev/null @@ -1,78 +0,0 @@ -import 'package:animated_text_kit/animated_text_kit.dart'; -import 'package:flutter/material.dart'; -import 'package:portfolio/app/colors.dart'; -import 'package:portfolio/app/configs.dart'; -import 'package:portfolio/core/utils/ScreenUiHelper.dart'; - -import 'home_view_model.dart'; - -class HomeTabletView extends StatelessWidget { - final ScreenUiHelper uiHelpers; - final HomeViewModel model; - - const HomeTabletView({Key key, this.uiHelpers, this.model}) : super(key: key); - @override - Widget build(BuildContext context) { - return Scaffold( - body: Container( - alignment: Alignment.center, - width: double.infinity, - height: double.infinity, - padding: const EdgeInsets.only(left: 120), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - "Hello, this is", - style: uiHelpers.buttonStyle.copyWith( - color: primaryColor, - fontWeight: FontWeight.w300, - letterSpacing: 1), - ), - SizedBox(height: 10), - TypewriterAnimatedTextKit( - text: ["${PersonalDetails.userName}."], - speed: Duration(milliseconds: 100), - textStyle: uiHelpers.title - .copyWith(fontSize: 60, color: Color(0xFFc6D6F6)), - totalRepeatCount: 1, - onFinished: () => model.changeIntroToCompleted(), - repeatForever: false, - ), - Text( - PersonalDetails.shortIntro, - style: uiHelpers.headline - .copyWith(color: Color(0xFFc6D6F6), fontSize: 50), - ), - uiHelpers.verticalSpaceLow, - MaterialButton( - hoverElevation: 100, - elevation: 10, - padding: const EdgeInsets.symmetric(horizontal: 30, vertical: 30), - shape: RoundedRectangleBorder( - side: BorderSide(color: primaryColor), - borderRadius: BorderRadius.circular(8)), - onPressed: () => model.getInTouch(), - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - Text( - "Get In touch", - style: uiHelpers.title.copyWith( - letterSpacing: 1, - color: primaryColor, - fontWeight: FontWeight.w200), - ), - SizedBox(width: 10), - Icon(Icons.arrow_forward_ios, color: primaryColor, size: 25) - ], - ), - ) - ], - ), - ), - ); - } -} diff --git a/lib/ui/views/main/main_view.dart b/lib/ui/views/main/main_view.dart index f71611d..68527e4 100644 --- a/lib/ui/views/main/main_view.dart +++ b/lib/ui/views/main/main_view.dart @@ -2,7 +2,6 @@ import 'package:collapsible_sidebar/collapsible_sidebar.dart'; import 'package:flutter/material.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:flutter_neumorphic/flutter_neumorphic.dart'; -import 'package:portfolio/app/colors.dart'; import 'package:portfolio/app/icons.dart'; import 'package:portfolio/core/utils/architecture_view.dart'; import 'package:portfolio/ui/views/main/main_view_model.dart'; @@ -25,47 +24,51 @@ class MainView extends HookWidget { viewModel: MainViewModel(), builder: (context, uiHelpers, model) => Scaffold( backgroundColor: uiHelpers.backgroundColor, - floatingActionButton: model.isMobile(context) + floatingActionButton: (model.isMobile(context)) ? SizedBox() - : FloatingActionButton( - backgroundColor: uiHelpers.primaryColor, - onPressed: () {}, - child: AnimateIcons( - startIcon: NeumorphicTheme.of(context).isUsingDark - ? MenuIcons.sunIcon - : MenuIcons.moonIcon, - size: 30.0, - controller: AnimateIconController(), - startTooltip: NeumorphicTheme.of(context).isUsingDark - ? 'Dark Mode' - : "Light Mode", - endTooltip: !NeumorphicTheme.of(context).isUsingDark - ? 'Dark Mode' - : "Light Mode", - onStartIconPress: () { - NeumorphicTheme.of(context).themeMode = - NeumorphicTheme.of(context).isUsingDark - ? ThemeMode.light - : ThemeMode.dark; - return true; - }, - onEndIconPress: () { - print(NeumorphicTheme.of(context).isUsingDark); - NeumorphicTheme.of(context).themeMode = - ThemeMode.dark; + : AnimatedOpacity( + opacity: model.isIndex3 ? 0 : 1, + duration: Duration(milliseconds: 700), + child: FloatingActionButton( + backgroundColor: uiHelpers.primaryColor, + onPressed: () {}, + child: AnimateIcons( + startIcon: NeumorphicTheme.of(context).isUsingDark + ? MenuIcons.sunIcon + : MenuIcons.moonIcon, + size: 30.0, + controller: AnimateIconController(), + startTooltip: NeumorphicTheme.of(context).isUsingDark + ? 'Dark Mode' + : "Light Mode", + endTooltip: !NeumorphicTheme.of(context).isUsingDark + ? 'Dark Mode' + : "Light Mode", + onStartIconPress: () { + NeumorphicTheme.of(context).themeMode = + NeumorphicTheme.of(context).isUsingDark + ? ThemeMode.light + : ThemeMode.dark; + return true; + }, + onEndIconPress: () { + print(NeumorphicTheme.of(context).isUsingDark); + NeumorphicTheme.of(context).themeMode = + ThemeMode.dark; - return true; - }, - duration: Duration(milliseconds: 500), - startIconColor: Colors.deepPurple, - endIconColor: Colors.deepOrange, - clockwise: false, + return true; + }, + duration: Duration(milliseconds: 500), + startIconColor: Colors.deepPurple, + endIconColor: Colors.deepOrange, + clockwise: false, + ), ), ), body: ScreenTypeLayout( desktop: CollapsibleSidebar( fitItemsToBottom: false, - selectedIconColor: primaryColor, + selectedIconColor: uiHelpers.primaryColor, maxWidth: 250, avatarImg: AssetImage("assets/images/s.jpg"), topPadding: 50, diff --git a/lib/ui/views/main/main_view_model.dart b/lib/ui/views/main/main_view_model.dart index 0c2d870..823ad5f 100644 --- a/lib/ui/views/main/main_view_model.dart +++ b/lib/ui/views/main/main_view_model.dart @@ -13,6 +13,7 @@ class MainViewModel extends BaseViewModel { int index = 0; bool isIntroCompleted = false; PageController pageController = PageController(); + bool isIndex3 = false; List collapsibleItem = []; final List menuItems = [ @@ -60,6 +61,7 @@ class MainViewModel extends BaseViewModel { if (isMobile) { changeMenuForMobile(controller, slideController); } + isIndex3 = (index == 3); notifyListeners(); } } @@ -70,6 +72,7 @@ class MainViewModel extends BaseViewModel { text: 'Home', icon: MenuIcons.homeIcon, onPressed: () { + isIndex3 = false; child = views[0]; notifyListeners(); }, @@ -78,6 +81,8 @@ class MainViewModel extends BaseViewModel { text: 'About', icon: MenuIcons.aboutIcon, onPressed: () { + isIndex3 = false; + child = views[1]; notifyListeners(); }, @@ -86,6 +91,8 @@ class MainViewModel extends BaseViewModel { text: 'Projects', icon: MenuIcons.projectIcon, onPressed: () { + isIndex3 = false; + child = views[2]; notifyListeners(); }, @@ -94,6 +101,7 @@ class MainViewModel extends BaseViewModel { text: 'Experience', icon: MenuIcons.experienceIcon, onPressed: () { + isIndex3 = true; child = views[3]; notifyListeners(); }, @@ -102,6 +110,7 @@ class MainViewModel extends BaseViewModel { text: 'Contact', icon: MenuIcons.contactIcon, onPressed: () { + isIndex3 = false; child = views[4]; notifyListeners(); }, diff --git a/lib/ui/views/projects/project_view.dart b/lib/ui/views/projects/project_view.dart index fc97d7c..1f5d1e7 100644 --- a/lib/ui/views/projects/project_view.dart +++ b/lib/ui/views/projects/project_view.dart @@ -1,11 +1,8 @@ import 'package:flutter/material.dart'; import 'package:portfolio/core/utils/architecture_view.dart'; -import 'package:responsive_builder/responsive_builder.dart'; -import 'project_view_desktop.dart'; -import 'project_view_mobile.dart'; +import 'project_view_responsive.dart'; import 'project_view_model.dart'; -import 'project_view_tablet.dart'; class ProjectView extends StatelessWidget { @override @@ -14,10 +11,9 @@ class ProjectView extends StatelessWidget { viewModel: ProjectViewModel(), onModelReady: (m) => m.init(), builder: (context, uiHelpers, model) { - return ScreenTypeLayout( - desktop: ProjectDesktopView(model: model, uiHelpers: uiHelpers), - tablet: ProjectTabletView(model: model, uiHelpers: uiHelpers), - mobile: ProjectMobileView(model: model, uiHelpers: uiHelpers), + return ProjectResponsiveView( + uiHelpers: uiHelpers, + model: model, ); }); } diff --git a/lib/ui/views/projects/project_view_desktop.dart b/lib/ui/views/projects/project_view_desktop.dart deleted file mode 100644 index 5bd3f6d..0000000 --- a/lib/ui/views/projects/project_view_desktop.dart +++ /dev/null @@ -1,92 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_neumorphic/flutter_neumorphic.dart'; -import 'package:portfolio/core/utils/ScreenUiHelper.dart'; -import 'package:portfolio/ui/views/projects/project_view_model.dart'; -import 'package:portfolio/ui/widgets/grid_view_widget.dart'; - -class ProjectDesktopView extends StatelessWidget { - final ScreenUiHelper uiHelpers; - final ProjectViewModel model; - - const ProjectDesktopView({Key key, this.uiHelpers, this.model}) - : super(key: key); - @override - Widget build(BuildContext context) { - return Scaffold( - backgroundColor: uiHelpers.backgroundColor, - body: Container( - child: Center( - child: Container( - padding: const EdgeInsets.symmetric(horizontal: 20), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.center, - mainAxisSize: MainAxisSize.max, - children: [ - uiHelpers.verticalSpaceHigh, - Text( - "Some Things I’ve Built", - style: uiHelpers.headline.copyWith(fontSize: 45), - ), - Container( - width: uiHelpers.width * 0.25, - child: Divider( - color: uiHelpers.dividerColor, - thickness: 2.5, - ), - ), - uiHelpers.verticalSpaceHigh, - Padding( - padding: const EdgeInsets.symmetric(horizontal: 100), - child: NeumorphicToggle( - movingCurve: Curves.linearToEaseOut, - style: NeumorphicToggleStyle( - backgroundColor: uiHelpers.surfaceColor), - onChanged: (value) => model.changeIndex(value), - children: [ - ToggleElement( - foreground: Center(child: Text("All")), - background: Center( - child: Text("All"), - )), - ToggleElement( - foreground: - Center(child: Text("Mobile Applications")), - background: Center(child: Text("Applications"))), - ToggleElement( - foreground: Center(child: Text("Web Applications")), - background: Center(child: Text("Web Applications"))), - ToggleElement( - foreground: Center(child: Text("Others")), - background: Center(child: Text("Others"))) - ], - thumb: SizedBox(), - selectedIndex: model.index, - ), - ), - SizedBox( - height: 25, - ), - Expanded( - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - padding: - const EdgeInsets.symmetric(horizontal: 100), - child: ResponsiveGridRow( - children: model.getProjects(), - )), - ], - ), - ), - ) - ], - ), - ), - ), - ), - ); - } -} diff --git a/lib/ui/views/projects/project_view_mobile.dart b/lib/ui/views/projects/project_view_mobile.dart deleted file mode 100644 index 09a6d62..0000000 --- a/lib/ui/views/projects/project_view_mobile.dart +++ /dev/null @@ -1,59 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:portfolio/app/colors.dart'; -import 'package:portfolio/core/utils/ScreenUiHelper.dart'; -import 'package:portfolio/ui/views/projects/project_view_model.dart'; -import 'package:portfolio/ui/widgets/grid_view_widget.dart'; - -class ProjectMobileView extends StatelessWidget { - final ScreenUiHelper uiHelpers; - final ProjectViewModel model; - - const ProjectMobileView({Key key, this.uiHelpers, this.model}) - : super(key: key); - @override - Widget build(BuildContext context) { - return Scaffold( - body: Container( - child: Center( - child: Container( - padding: const EdgeInsets.symmetric(), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.center, - mainAxisSize: MainAxisSize.max, - children: [ - uiHelpers.verticalSpaceHigh, - Text( - "Some Things I’ve Built", - style: uiHelpers.headline.copyWith(fontSize: 24), - ), - Container( - width: uiHelpers.width * 0.45, - child: Divider( - color: dividerColor, - thickness: 2.5, - ), - ), - uiHelpers.verticalSpaceLow, - Expanded( - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - padding: const EdgeInsets.symmetric(horizontal: 10), - child: ResponsiveGridRow( - children: model.list, - )), - ], - ), - ), - ) - ], - ), - ), - ), - ), - ); - } -} diff --git a/lib/ui/views/projects/project_view_model.dart b/lib/ui/views/projects/project_view_model.dart index a90a775..02dced5 100644 --- a/lib/ui/views/projects/project_view_model.dart +++ b/lib/ui/views/projects/project_view_model.dart @@ -35,6 +35,8 @@ class ProjectViewModel extends BaseViewModel { mapList[s] = [ ResponsiveGridCol( xl: 4, + sm: 12, + xs: 12, md: 6, child: ProjectWidget( index: i, project: PersonalDetails.projectsList[i])) @@ -42,6 +44,8 @@ class ProjectViewModel extends BaseViewModel { } else { mapList[s].add(ResponsiveGridCol( xl: 4, + sm: 12, + xs: 12, md: 6, child: ProjectWidget( index: i, project: PersonalDetails.projectsList[i]))); @@ -49,6 +53,8 @@ class ProjectViewModel extends BaseViewModel { } else { mapList["Others"].add(ResponsiveGridCol( xl: 4, + sm: 12, + xs: 12, md: 6, child: ProjectWidget( index: i, project: PersonalDetails.projectsList[i]))); @@ -57,6 +63,8 @@ class ProjectViewModel extends BaseViewModel { mapList["All"].add(ResponsiveGridCol( xl: 4, md: 6, + sm: 12, + xs: 12, child: ProjectWidget( index: i, project: PersonalDetails.projectsList[i]))); } diff --git a/lib/ui/views/projects/project_view_responsive.dart b/lib/ui/views/projects/project_view_responsive.dart new file mode 100644 index 0000000..fa5a327 --- /dev/null +++ b/lib/ui/views/projects/project_view_responsive.dart @@ -0,0 +1,132 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_neumorphic/flutter_neumorphic.dart'; +import 'package:portfolio/app/configs.dart'; +import 'package:portfolio/core/utils/ScreenUiHelper.dart'; +import 'package:portfolio/ui/views/projects/project_view_model.dart'; +import 'package:portfolio/ui/widgets/grid_view_widget.dart'; + +class ProjectResponsiveView extends StatelessWidget { + final ScreenUiHelper uiHelpers; + final ProjectViewModel model; + + const ProjectResponsiveView({Key key, this.uiHelpers, this.model}) + : super(key: key); + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: uiHelpers.backgroundColor, + body: Container( + child: Center( + child: Container( + padding: const EdgeInsets.symmetric(horizontal: 20), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.max, + children: [ + uiHelpers.verticalSpaceHigh, + Text("Some Things I’ve Built", style: uiHelpers.headline), + Container( + width: uiHelpers.width * 0.25, + child: Divider( + color: uiHelpers.dividerColor, + thickness: 2.5, + ), + ), + uiHelpers.verticalSpaceHigh, + NeumorphicToggle( + width: uiHelpers.width * 1.2, + movingCurve: Curves.linearToEaseOut, + style: NeumorphicToggleStyle( + backgroundColor: uiHelpers.surfaceColor), + onChanged: (value) => model.changeIndex(value), + children: [ + ToggleElement( + foreground: Center( + child: Text( + "All", + style: uiHelpers.body.copyWith( + fontWeight: FontWeight.bold, + fontFamily: SystemProperties.titleFont), + textAlign: TextAlign.center, + )), + background: Center( + child: Text( + "All", + style: uiHelpers.body, + textAlign: TextAlign.center, + ), + )), + ToggleElement( + foreground: Center( + child: Text( + "Apps", + style: uiHelpers.body.copyWith( + fontWeight: FontWeight.bold, + fontFamily: SystemProperties.titleFont), + textAlign: TextAlign.center, + )), + background: Center( + child: Text( + "Apps", + style: uiHelpers.body, + textAlign: TextAlign.center, + ))), + ToggleElement( + foreground: Center( + child: Text( + "Web Apps", + style: uiHelpers.body.copyWith( + fontWeight: FontWeight.bold, + fontFamily: SystemProperties.titleFont), + textAlign: TextAlign.center, + )), + background: Center( + child: Text( + "Web Apps", + style: uiHelpers.body, + textAlign: TextAlign.center, + ))), + ToggleElement( + foreground: Center( + child: Text( + "Others", + style: uiHelpers.body.copyWith( + fontWeight: FontWeight.bold, + fontFamily: SystemProperties.titleFont), + textAlign: TextAlign.center, + )), + background: Center( + child: Text( + "Others", + style: uiHelpers.body, + textAlign: TextAlign.center, + ))) + ], + thumb: SizedBox(), + selectedIndex: model.index, + ), + SizedBox( + height: 25, + ), + Expanded( + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + child: ResponsiveGridRow( + children: model.getProjects(), + )), + ], + ), + ), + ) + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/ui/views/projects/project_view_tablet.dart b/lib/ui/views/projects/project_view_tablet.dart deleted file mode 100644 index 6ebabcb..0000000 --- a/lib/ui/views/projects/project_view_tablet.dart +++ /dev/null @@ -1,59 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:portfolio/app/colors.dart'; -import 'package:portfolio/core/utils/ScreenUiHelper.dart'; -import 'package:portfolio/ui/views/projects/project_view_model.dart'; -import 'package:portfolio/ui/widgets/grid_view_widget.dart'; - -class ProjectTabletView extends StatelessWidget { - final ScreenUiHelper uiHelpers; - final ProjectViewModel model; - - const ProjectTabletView({Key key, this.uiHelpers, this.model}) - : super(key: key); - @override - Widget build(BuildContext context) { - return Scaffold( - body: Container( - child: Center( - child: Container( - padding: const EdgeInsets.symmetric(horizontal: 20), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.center, - mainAxisSize: MainAxisSize.max, - children: [ - uiHelpers.verticalSpaceHigh, - Text( - "Some Things I’ve Built", - style: uiHelpers.headline.copyWith(fontSize: 45), - ), - Container( - width: uiHelpers.width * 0.40, - child: Divider( - color: dividerColor, - thickness: 2.5, - ), - ), - uiHelpers.verticalSpaceHigh, - Expanded( - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - padding: const EdgeInsets.symmetric(horizontal: 50), - child: ResponsiveGridRow( - children: model.list, - )), - ], - ), - ), - ) - ], - ), - ), - ), - ), - ); - } -} diff --git a/lib/ui/widgets/chipWidget.dart b/lib/ui/widgets/chipWidget.dart deleted file mode 100644 index e4a342a..0000000 --- a/lib/ui/widgets/chipWidget.dart +++ /dev/null @@ -1,30 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_neumorphic/flutter_neumorphic.dart'; -import 'package:portfolio/app/colors.dart'; - -class ChipWidget extends StatelessWidget { - final String text; - final bool isSelected; - - const ChipWidget({Key key, this.text, this.isSelected}) : super(key: key); - @override - Widget build(BuildContext context) { - return Neumorphic( - style: NeumorphicStyle(shape: NeumorphicShape.flat), - child: Text( - text, - style: isSelected - ? TextStyle( - decoration: TextDecoration.none, - fontSize: 22, - fontWeight: FontWeight.bold, - color: textPrimaryColor) - : TextStyle( - decoration: TextDecoration.none, - fontSize: 16, - fontWeight: FontWeight.w300, - color: textPrimaryColor), - ), - ); - } -} diff --git a/lib/ui/widgets/custom_toast.dart b/lib/ui/widgets/custom_toast.dart deleted file mode 100644 index 290ccc8..0000000 --- a/lib/ui/widgets/custom_toast.dart +++ /dev/null @@ -1,43 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:portfolio/app/colors.dart'; -import 'package:portfolio/core/utils/ScreenUiHelper.dart'; - -class CustomToast extends StatelessWidget { - final String content; - final Icon icon; - const CustomToast({@required this.content, @required this.icon}); - - @override - Widget build(BuildContext context) { - final ScreenUiHelper uiHelper = ScreenUiHelper.fromContext(context); - return Material( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - shadowColor: Colors.transparent, - color: backgroundColor, - elevation: 250, - child: ClipRRect( - borderRadius: BorderRadius.circular(10.0), - child: Container( - width: 500, - color: backgroundColor, - padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 20), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - icon, - SizedBox( - width: 5, - ), - Text( - content, - style: uiHelper.body, - ), - ], - ), - ), - ), - ); - } -} diff --git a/lib/ui/widgets/eductaion_timeline_widget.dart b/lib/ui/widgets/eductaion_timeline_widget.dart index caa8224..e3cfc6d 100644 --- a/lib/ui/widgets/eductaion_timeline_widget.dart +++ b/lib/ui/widgets/eductaion_timeline_widget.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:portfolio/app/colors.dart'; import 'package:portfolio/app/configs.dart'; import 'package:portfolio/core/utils/ScreenUiHelper.dart'; @@ -20,6 +19,7 @@ class EducationDetailsTimelineWidget extends StatelessWidget { Widget build(BuildContext context) { final ScreenUiHelper uiHelper = ScreenUiHelper.fromContext(context); return Container( + padding: const EdgeInsets.only(left: 10), child: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -54,7 +54,7 @@ class EducationDetailsTimelineWidget extends StatelessWidget { text: "$percentage", style: uiHelper.title.copyWith( fontSize: 14, - color: primaryColor, + color: uiHelper.primaryColor, fontWeight: FontWeight.bold)) ]), ), diff --git a/lib/ui/widgets/experience_chip_widget.dart b/lib/ui/widgets/experience_chip_widget.dart deleted file mode 100644 index d671cea..0000000 --- a/lib/ui/widgets/experience_chip_widget.dart +++ /dev/null @@ -1,45 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_neumorphic/flutter_neumorphic.dart'; -import 'package:portfolio/app/colors.dart'; -import 'package:portfolio/core/utils/ScreenUiHelper.dart'; - -class ExperienceChipWidget extends StatefulWidget { - const ExperienceChipWidget({Key key, this.title}) : super(key: key); - - final String title; - - @override - _ExperienceChipWidgetState createState() => _ExperienceChipWidgetState(); -} - -class _ExperienceChipWidgetState extends State { - bool isHovered = false; - - @override - Widget build(BuildContext context) { - final ScreenUiHelper uiHelpers = ScreenUiHelper.fromContext(context); - return Padding( - padding: const EdgeInsets.all(8.0), - child: MouseRegion( - onEnter: (event) => setState(() => isHovered = true), - onExit: (event) => setState(() => isHovered = false), - child: Neumorphic( - padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10), - style: NeumorphicStyle( - shape: isHovered ? NeumorphicShape.convex : NeumorphicShape.flat, - depth: isHovered ? 6 : -12, - boxShape: NeumorphicBoxShape.roundRect(BorderRadius.circular(12)), - color: surfaceColor, - ), - duration: Duration(milliseconds: 300), - child: Text( - widget.title, - style: uiHelpers.body.copyWith( - color: isHovered ? primaryColor : textSecondaryColor, - fontWeight: isHovered ? FontWeight.w500 : FontWeight.w300), - ), - ), - ), - ); - } -} diff --git a/lib/ui/widgets/projectWidget.dart b/lib/ui/widgets/projectWidget.dart index e68f7ba..b9aa6cf 100644 --- a/lib/ui/widgets/projectWidget.dart +++ b/lib/ui/widgets/projectWidget.dart @@ -4,7 +4,6 @@ import 'package:portfolio/app/icons.dart'; import 'package:portfolio/core/models/project.dart'; import 'package:portfolio/core/services/url_launcher_service.dart'; import 'package:portfolio/core/utils/ScreenUiHelper.dart'; -import 'package:responsive_builder/responsive_builder.dart'; import 'fadeAnimation.dart'; @@ -20,286 +19,103 @@ class ProjectWidget extends StatelessWidget { Widget build(BuildContext context) { final UrlLauncherService _urlLauncherService = UrlLauncherService(); final ScreenUiHelper uiHelpers = ScreenUiHelper.fromContext(context); - return ScreenTypeLayout( - desktop: FadeAnimation( - xDistance: 0, - yDistance: 0000000, - delay: index * 0.2 + 1, - child: Container( - height: 250, - margin: EdgeInsets.only( - bottom: 15, right: uiHelpers.width > 768 ? 15 : 0), - child: Neumorphic( - style: NeumorphicStyle( - shape: NeumorphicShape.convex, - shadowLightColor: uiHelpers.backgroundColor, - depth: 5, - intensity: 0.6, - color: uiHelpers.backgroundColor, - surfaceIntensity: 0.3, - boxShape: - NeumorphicBoxShape.roundRect(BorderRadius.circular(12))), - child: Container( - padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 15), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - mainAxisSize: MainAxisSize.max, - children: [ - NeumorphicIcon( - ProjectIcons.folderIcon, - size: 30, - style: NeumorphicStyle( - surfaceIntensity: 0.1, - intensity: 0.3, - color: uiHelpers.primaryColor), - ), - Row( - mainAxisSize: MainAxisSize.min, - children: [ - project.websiteLink == null - ? SizedBox() - : IconButton( - icon: NeumorphicIcon( - ProjectIcons.websiteIcon, - style: NeumorphicStyle( - surfaceIntensity: 0.1, - intensity: 0.3, - color: uiHelpers.primaryColor), - ), - onPressed: () => _urlLauncherService - .launchUrl(project.websiteLink), + return FadeAnimation( + xDistance: 0, + yDistance: 0000000, + delay: index * 0.2 + 1, + child: Container( + height: 250, + margin: + EdgeInsets.only(bottom: 15, right: uiHelpers.width > 768 ? 15 : 0), + child: Neumorphic( + style: NeumorphicStyle( + shape: NeumorphicShape.convex, + shadowLightColor: uiHelpers.backgroundColor, + depth: 5, + intensity: 0.6, + color: uiHelpers.backgroundColor, + surfaceIntensity: 0.3, + boxShape: + NeumorphicBoxShape.roundRect(BorderRadius.circular(12))), + child: Container( + width: uiHelpers.width, + padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 15), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisSize: MainAxisSize.max, + children: [ + Icon( + ProjectIcons.folderIcon, + color: uiHelpers.primaryColor, + size: 30, + ), + Row( + mainAxisSize: MainAxisSize.min, + children: [ + project.websiteLink == null + ? SizedBox() + : IconButton( + icon: Icon( + ProjectIcons.websiteIcon, + color: uiHelpers.primaryColor, ), - project.githubLink == null - ? SizedBox() - : IconButton( - icon: NeumorphicIcon( - ProjectIcons.githubIcon, - style: NeumorphicStyle( - surfaceIntensity: 0.1, - intensity: 0.3, - color: uiHelpers.primaryColor), - ), - onPressed: () => _urlLauncherService - .launchUrl(project.githubLink), + onPressed: () => _urlLauncherService + .launchUrl(project.websiteLink), + ), + project.githubLink == null + ? SizedBox() + : IconButton( + icon: Icon( + ProjectIcons.githubIcon, + color: uiHelpers.primaryColor, ), - project.playstoreLink == null - ? SizedBox() - : IconButton( - icon: NeumorphicIcon( - ProjectIcons.playstoreIcon, - style: NeumorphicStyle( - surfaceIntensity: 0.1, - intensity: 0.3, - color: uiHelpers.primaryColor), - ), - onPressed: () => _urlLauncherService - .launchUrl(project.playstoreLink), + onPressed: () => _urlLauncherService + .launchUrl(project.githubLink), + ), + project.playstoreLink == null + ? SizedBox() + : IconButton( + icon: Icon( + ProjectIcons.playstoreIcon, + color: uiHelpers.primaryColor, ), - ], - ), - ], - ), - uiHelpers.verticalSpaceMedium, - Text( - project.title, - style: uiHelpers.title, - ), - uiHelpers.verticalSpaceLow, - Text( - project.description, - style: uiHelpers.body.copyWith(fontWeight: FontWeight.w300), - ), - Spacer(), - Wrap( - children: [ - for (int i = 0; i < project.tools.length; i++) - Padding( - child: Text( - project.tools[i], - style: uiHelpers.body.copyWith( - fontWeight: FontWeight.w400, - color: uiHelpers.textSecondaryColor), - ), - padding: const EdgeInsets.symmetric(vertical: 4) - .copyWith(right: 16), + onPressed: () => _urlLauncherService + .launchUrl(project.playstoreLink), + ), + ], + ), + ], + ), + uiHelpers.verticalSpaceMedium, + Text( + project.title, + style: uiHelpers.title, + ), + uiHelpers.verticalSpaceLow, + Text( + project.description, + style: uiHelpers.body.copyWith(fontWeight: FontWeight.w300), + ), + Spacer(), + Wrap( + children: [ + for (int i = 0; i < project.tools.length; i++) + Padding( + child: Text( + project.tools[i], + style: uiHelpers.body.copyWith( + fontWeight: FontWeight.w400, + color: uiHelpers.textSecondaryColor), ), - ], - ) - ], - ), - ), - ), - ), - ), - tablet: FadeAnimation( - delay: index * 0.2 + 1, - xDistance: 0, - child: Container( - height: 250, - margin: EdgeInsets.only( - bottom: 15, right: uiHelpers.width > 768 ? 15 : 0), - child: Material( - color: uiHelpers.surfaceColor, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(4), - ), - elevation: 10, - child: Container( - padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 15), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - mainAxisSize: MainAxisSize.max, - children: [ - NeumorphicIcon(ProjectIcons.folderIcon, size: 30), - Row( - mainAxisSize: MainAxisSize.min, - children: [ - project.websiteLink == null - ? SizedBox() - : IconButton( - icon: NeumorphicIcon( - ProjectIcons.websiteIcon, - ), - onPressed: () => _urlLauncherService - .launchUrl(project.websiteLink), - ), - project.githubLink == null - ? SizedBox() - : IconButton( - icon: NeumorphicIcon(ProjectIcons.githubIcon), - onPressed: () => _urlLauncherService - .launchUrl(project.githubLink), - ), - project.playstoreLink == null - ? SizedBox() - : IconButton( - icon: NeumorphicIcon( - ProjectIcons.playstoreIcon), - onPressed: () => _urlLauncherService - .launchUrl(project.playstoreLink), - ), - ], + padding: const EdgeInsets.symmetric(vertical: 4) + .copyWith(right: 16), ), - ], - ), - uiHelpers.verticalSpaceMedium, - Text( - project.title, - style: uiHelpers.title, - ), - uiHelpers.verticalSpaceLow, - Text( - project.description, - style: uiHelpers.body.copyWith(fontWeight: FontWeight.w300), - ), - uiHelpers.verticalSpaceLow, - Wrap( - children: [ - for (int i = 0; i < project.tools.length; i++) - Padding( - child: Text( - project.tools[i], - style: uiHelpers.body.copyWith( - fontWeight: FontWeight.w400, - color: uiHelpers.textSecondaryColor), - ), - padding: const EdgeInsets.symmetric(vertical: 4) - .copyWith(right: 16), - ), - ], - ) - ], - ), - ), - ), - ), - ), - mobile: FadeAnimation( - delay: index * 0.2 + 1, - xDistance: 0, - child: Container( - margin: EdgeInsets.only( - bottom: 15, right: uiHelpers.width > 768 ? 15 : 0), - child: Material( - color: uiHelpers.surfaceColor, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(4), - ), - elevation: 10, - child: Container( - padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 15), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - mainAxisSize: MainAxisSize.max, - children: [ - NeumorphicIcon(ProjectIcons.folderIcon, size: 30), - Row( - mainAxisSize: MainAxisSize.min, - children: [ - project.websiteLink == null - ? SizedBox() - : IconButton( - icon: - NeumorphicIcon(ProjectIcons.websiteIcon), - onPressed: () => _urlLauncherService - .launchUrl(project.websiteLink), - ), - project.githubLink == null - ? SizedBox() - : IconButton( - icon: NeumorphicIcon(ProjectIcons.githubIcon), - onPressed: () => _urlLauncherService - .launchUrl(project.githubLink), - ), - project.playstoreLink == null - ? SizedBox() - : IconButton( - icon: NeumorphicIcon( - ProjectIcons.playstoreIcon), - onPressed: () => _urlLauncherService - .launchUrl(project.playstoreLink), - ), - ], - ), - ], - ), - uiHelpers.verticalSpaceMedium, - Text( - project.title, - style: uiHelpers.title, - ), - uiHelpers.verticalSpaceLow, - Text( - project.description, - style: uiHelpers.body.copyWith(fontWeight: FontWeight.w300), - ), - uiHelpers.verticalSpaceLow, - Wrap( - children: [ - for (int i = 0; i < project.tools.length; i++) - Padding( - child: Text( - project.tools[i], - style: uiHelpers.body.copyWith( - fontWeight: FontWeight.w400, - color: uiHelpers.textSecondaryColor), - ), - padding: const EdgeInsets.symmetric(vertical: 4) - .copyWith(right: 16), - ), - ], - ) - ], - ), + ], + ) + ], ), ), ), diff --git a/lib/ui/widgets/timeline_widget.dart b/lib/ui/widgets/timeline_widget.dart index 19814f8..9753294 100644 --- a/lib/ui/widgets/timeline_widget.dart +++ b/lib/ui/widgets/timeline_widget.dart @@ -1,6 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:portfolio/core/utils/ScreenUiHelper.dart'; -import 'package:portfolio/ui/widgets/custom%20shapes/education_painter.dart'; class Timeline extends StatelessWidget { const Timeline({ @@ -16,7 +14,7 @@ class Timeline extends StatelessWidget { this.shrinkWrap = true, this.primary = false, this.reverse = false, - this.indicatorSize = 12.0, + this.indicatorSize = 30.0, this.lineGap = 4.0, this.indicatorColor = Colors.blue, this.indicatorStyle = PaintingStyle.fill, @@ -49,32 +47,133 @@ class Timeline extends StatelessWidget { final StrokeCap strokeCap; final double strokeWidth; final PaintingStyle style; + @override Widget build(BuildContext context) { - final ScreenUiHelper uiHelper = ScreenUiHelper.fromContext(context); - return ListView.builder( - shrinkWrap: true, - primary: false, - itemCount: children.length, - itemBuilder: (context, index) => LayoutBuilder( - builder: (BuildContext context, BoxConstraints constraints) { - print(constraints.maxWidth); - return CustomPaint( - painter: RPSCustomPainter( - indicatorColor: uiHelper.primaryColor, - lineColor: uiHelper.dividerColor, - verticalHeight: index == 0 ? 120 : 150, - horizontalWidth: 200, - indicatorSize: 6, - isFirst: index == 0), - child: Container( - height: index == 0 ? 100 : 120, - padding: EdgeInsets.only( - left: 20, top: (index != 0) ? 100 * 0.26 : 0), - child: children[index], - ), - ); - }, - )); + return ListView.separated( + padding: padding, + separatorBuilder: (_, __) => SizedBox(height: itemGap), + physics: physics, + shrinkWrap: shrinkWrap, + itemCount: itemCount, + controller: controller, + reverse: reverse, + primary: primary, + itemBuilder: (context, index) { + final child = children[index]; + + Widget indicator; + if (indicators != null) { + indicator = indicators[index]; + } + + final isFirst = index == 0; + final isLast = index == itemCount - 1; + + final timelineTile = [ + CustomPaint( + foregroundPainter: _TimelinePainter( + hideDefaultIndicator: indicator != null, + lineColor: lineColor, + indicatorColor: indicatorColor, + indicatorSize: indicatorSize, + indicatorStyle: indicatorStyle, + isFirst: isFirst, + isLast: isLast, + lineGap: lineGap, + strokeCap: strokeCap, + strokeWidth: strokeWidth, + style: style, + itemGap: itemGap, + ), + child: SizedBox( + height: double.infinity, + width: indicatorSize, + child: indicator, + ), + ), + SizedBox(width: gutterSpacing), + Expanded(child: child), + ]; + + return IntrinsicHeight( + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: + isLeftAligned ? timelineTile : timelineTile.reversed.toList(), + ), + ); + }, + ); + } +} + +class _TimelinePainter extends CustomPainter { + _TimelinePainter({ + @required this.hideDefaultIndicator, + @required this.indicatorColor, + @required this.indicatorStyle, + @required this.indicatorSize, + @required this.lineGap, + @required this.strokeCap, + @required this.strokeWidth, + @required this.style, + @required this.lineColor, + @required this.isFirst, + @required this.isLast, + @required this.itemGap, + }) : linePaint = Paint() + ..color = lineColor + ..strokeCap = strokeCap + ..strokeWidth = strokeWidth + ..style = style, + circlePaint = Paint() + ..color = indicatorColor + ..style = indicatorStyle; + + final bool hideDefaultIndicator; + final Color indicatorColor; + final PaintingStyle indicatorStyle; + final double indicatorSize; + final double lineGap; + final StrokeCap strokeCap; + final double strokeWidth; + final PaintingStyle style; + final Color lineColor; + final Paint linePaint; + final Paint circlePaint; + final bool isFirst; + final bool isLast; + final double itemGap; + + @override + void paint(Canvas canvas, Size size) { + final indicatorRadius = indicatorSize / 2; + final halfItemGap = itemGap / 2; + final indicatorMargin = indicatorRadius + lineGap; + + final top = size.topLeft(Offset(indicatorRadius, 0.0 - halfItemGap)); + final centerTop = size.centerLeft( + Offset(indicatorRadius, -indicatorMargin), + ); + + final bottom = size.bottomLeft(Offset(indicatorRadius, 0.0 + halfItemGap)); + final centerBottom = size.centerLeft( + Offset(indicatorRadius, indicatorMargin), + ); + + if (!isFirst) canvas.drawLine(top, centerTop, linePaint); + if (!isLast) canvas.drawLine(centerBottom, bottom, linePaint); + + if (!hideDefaultIndicator) { + final Offset offsetCenter = size.centerLeft(Offset(indicatorRadius, 0)); + + canvas.drawCircle(offsetCenter, indicatorRadius, circlePaint); + } + } + + @override + bool shouldRepaint(CustomPainter oldDelegate) { + return false; } } diff --git a/pubspec.lock b/pubspec.lock index 5b9e691..a20a21b 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -7,14 +7,14 @@ packages: name: _fe_analyzer_shared url: "https://pub.dartlang.org" source: hosted - version: "20.0.0" + version: "21.0.0" analyzer: dependency: transitive description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "1.4.0" + version: "1.5.0" animated_text_kit: dependency: "direct main" description: @@ -70,7 +70,7 @@ packages: name: build url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.0.1" build_config: dependency: transitive description: @@ -120,6 +120,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "8.0.4" + carousel_slider: + dependency: "direct main" + description: + name: carousel_slider + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" change_app_package_name: dependency: "direct dev" description: @@ -517,7 +524,7 @@ packages: name: stacked url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" + version: "2.1.0" stacked_services: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index a439499..983ffce 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -14,7 +14,7 @@ dependencies: font_awesome_flutter: #*Architecture - stacked: ^2.0.4 + stacked: ^2.1.0 stacked_services: ^0.8.3 responsive_builder: ^0.4.1 get_it: ^6.1.1 @@ -28,11 +28,13 @@ dependencies: #*Utilities collapsible_sidebar: ^2.0.0 - animated_text_kit: ^4.0.0 + animated_text_kit: ^4.2.0 simple_animations: ^3.0.3 oktoast: ^3.0.0 flutter_neumorphic: animations: + carousel_slider: + dev_dependencies: flutter_test: sdk: flutter