Skip to content

Commit

Permalink
fix #5
Browse files Browse the repository at this point in the history
  • Loading branch information
danger-ahead committed Jun 27, 2022
1 parent 0b5aa96 commit f1e1f1d
Show file tree
Hide file tree
Showing 18 changed files with 422 additions and 459 deletions.
26 changes: 12 additions & 14 deletions lib/src/achievements/card.dart
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -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
Expand All @@ -26,6 +23,8 @@ class _AchievementsCardState extends State<AchievementsCard> {

@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: [
Expand All @@ -38,8 +37,8 @@ class _AchievementsCardState extends State<AchievementsCard> {
),
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(() {
Expand All @@ -50,13 +49,11 @@ class _AchievementsCardState extends State<AchievementsCard> {
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(
Expand All @@ -74,7 +71,8 @@ class _AchievementsCardState extends State<AchievementsCard> {
),
child: Center(
child: SingleChildScrollView(
child: text(widget.desc, 18, Colors.white))),
child: CustomText(
text: widget.desc, fontSize: 18, color: Colors.white))),
),
),
);
Expand Down
7 changes: 5 additions & 2 deletions lib/src/contact_me/contact_me_button.dart
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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()),
Expand Down
29 changes: 29 additions & 0 deletions lib/src/custom/custom_text.dart
Original file line number Diff line number Diff line change
@@ -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,
));
}
}
12 changes: 0 additions & 12 deletions lib/src/custom/text_style.dart

This file was deleted.

161 changes: 161 additions & 0 deletions lib/src/education/card.dart
Original file line number Diff line number Diff line change
@@ -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<EducationDesktop> {
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: <Widget>[
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)),
],
),
),
],
),
],
),
),
),
);
}
}
Loading

0 comments on commit f1e1f1d

Please sign in to comment.