Skip to content

Commit 766a72e

Browse files
committed
update codebase
1 parent e8065e0 commit 766a72e

29 files changed

+1138
-1385
lines changed

Diff for: lib/main.dart

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import 'package:flutter/material.dart';
22
import 'package:google_fonts/google_fonts.dart';
33
import 'package:responsive_framework/responsive_framework.dart';
4-
import 'package:responsive_framework/responsive_wrapper.dart';
54
import 'package:web_portfolio/pages/home/home.dart';
65
import 'package:web_portfolio/utils/constants.dart';
76

@@ -13,7 +12,7 @@ class MyApp extends StatelessWidget {
1312
@override
1413
Widget build(BuildContext context) {
1514
return MaterialApp(
16-
title: 'Flutter Portfolio',
15+
title: "Flutter Portfolio",
1716
debugShowCheckedModeBanner: false,
1817
themeMode: ThemeMode.dark,
1918
darkTheme: Theme.of(context).copyWith(
@@ -29,9 +28,9 @@ class MyApp extends StatelessWidget {
2928
breakpoints: [
3029
ResponsiveBreakpoint.resize(450, name: MOBILE),
3130
ResponsiveBreakpoint.resize(800, name: TABLET),
32-
ResponsiveBreakpoint.autoScale(1000, name: TABLET),
31+
ResponsiveBreakpoint.resize(1000, name: TABLET),
3332
ResponsiveBreakpoint.resize(1200, name: DESKTOP),
34-
ResponsiveBreakpoint.autoScale(2460, name: "4K"),
33+
ResponsiveBreakpoint.resize(2460, name: "4K"),
3534
],
3635
background: Container(
3736
color: kBackgroundColor,

Diff for: lib/models/carousel_item.dart

-8
This file was deleted.

Diff for: lib/models/carousel_item_model.dart

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import 'package:flutter/material.dart';
2+
3+
class CarouselItemModel {
4+
final Widget text;
5+
final Widget image;
6+
7+
CarouselItemModel({
8+
@required this.text,
9+
@required this.image,
10+
});
11+
}

Diff for: lib/models/education.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import 'package:flutter/material.dart';
22

33
class Education {
4-
final String period;
54
final String description;
65
final String linkName;
6+
final String period;
77

88
Education({
99
@required this.description,

Diff for: lib/models/footer_item.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ class FooterItem {
88

99
FooterItem({
1010
@required this.iconPath,
11-
this.text1 = "",
12-
this.text2 = "",
1311
@required this.title,
12+
@required this.text1,
13+
@required this.text2,
1414
});
1515
}

Diff for: lib/models/header_item.dart

+5-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,9 @@ class HeaderItem {
55
final VoidCallback onTap;
66
final bool isButton;
77

8-
HeaderItem({this.title, this.onTap, this.isButton = false});
8+
HeaderItem({
9+
this.title,
10+
this.onTap,
11+
this.isButton = false,
12+
});
913
}

Diff for: lib/models/skill.dart

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
import 'package:flutter/material.dart';
2+
13
class Skill {
24
final String skill;
35
final int percentage;
46

57
Skill({
6-
this.skill,
7-
this.percentage,
8+
@required this.skill,
9+
@required this.percentage,
810
});
911
}

Diff for: lib/models/stat.dart

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import 'package:flutter/material.dart';
22

33
class Stat {
4-
String count;
5-
String title;
4+
final String count;
5+
final String text;
66

77
Stat({
8-
@required this.title,
98
@required this.count,
9+
@required this.text,
1010
});
1111
}

Diff for: lib/models/testimonial.dart

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import 'package:flutter/material.dart';
22

3-
class TestimonialModel {
3+
class Testimonial {
44
final String text;
5-
final String personName;
65
final String occupation;
6+
final String personName;
77
final String profilePhoto;
88

9-
TestimonialModel({
9+
Testimonial({
1010
@required this.text,
1111
@required this.occupation,
1212
@required this.personName,

Diff for: lib/pages/home/components/carousel.dart

+68-135
Original file line numberDiff line numberDiff line change
@@ -1,108 +1,76 @@
1-
import 'package:carousel_slider/carousel_options.dart';
21
import 'package:carousel_slider/carousel_slider.dart';
32
import 'package:flutter/material.dart';
4-
import 'package:flutter/rendering.dart';
5-
import 'package:responsive_framework/responsive_value.dart';
6-
import 'package:responsive_framework/responsive_wrapper.dart';
3+
import 'package:responsive_framework/responsive_framework.dart';
74
import 'package:web_portfolio/pages/home/components/carousel_items.dart';
8-
import 'package:web_portfolio/pages/home/components/page_indicator.dart';
5+
import 'package:web_portfolio/utils/constants.dart';
96
import 'package:web_portfolio/utils/screen_helper.dart';
107

11-
CarouselController carouselController = CarouselController();
12-
138
class Carousel extends StatelessWidget {
9+
final CarouselController carouselController = CarouselController();
1410
@override
1511
Widget build(BuildContext context) {
16-
double containerHeight = MediaQuery.of(context).size.height *
17-
(ScreenHelper.isMobile(context) ? 0.7 : .85);
12+
double carouselContainerHeight = MediaQuery.of(context).size.height *
13+
(ScreenHelper.isMobile(context) ? .7 : .85);
1814
return Container(
19-
height: containerHeight,
15+
height: carouselContainerHeight,
16+
width: double.infinity,
2017
child: Column(
2118
mainAxisAlignment: MainAxisAlignment.start,
2219
children: [
23-
Stack(
24-
alignment: Alignment.topCenter,
25-
children: [
26-
Container(
27-
width: MediaQuery.of(context).size.width,
28-
alignment: Alignment.center,
29-
child: CarouselSlider(
30-
carouselController: carouselController,
31-
options: CarouselOptions(
32-
viewportFraction: 1,
33-
enlargeCenterPage: true,
34-
scrollPhysics: NeverScrollableScrollPhysics(),
35-
height: containerHeight,
36-
),
37-
items: [1, 2, 3, 4, 5].map(
38-
(i) {
39-
return Builder(
40-
builder: (BuildContext context) {
41-
return Container(
42-
constraints: BoxConstraints(
43-
minHeight: containerHeight,
44-
),
45-
child: ScreenHelper(
46-
desktop: buildDesktop(
47-
context,
48-
carouselItems[0].text,
49-
Container(
50-
decoration: BoxDecoration(
51-
image: DecorationImage(
52-
fit: BoxFit.contain,
53-
image: AssetImage(
54-
"assets/person.png",
55-
),
56-
),
57-
),
58-
child: carouselItems[0].image,
59-
),
60-
),
61-
tablet: buildTablet(
62-
context,
63-
carouselItems[0].text,
64-
carouselItems[0].image,
65-
),
66-
mobile: buildMobile(
67-
context,
68-
Container(
69-
height: 900.0,
70-
child: carouselItems[0].text,
71-
),
72-
carouselItems[0].image,
73-
),
74-
),
75-
);
76-
},
77-
);
78-
},
79-
).toList(),
80-
),
20+
Container(
21+
alignment: Alignment.center,
22+
child: CarouselSlider(
23+
carouselController: carouselController,
24+
options: CarouselOptions(
25+
// autoPlay: true,
26+
viewportFraction: 1,
27+
scrollPhysics: NeverScrollableScrollPhysics(),
28+
height: carouselContainerHeight,
8129
),
82-
Positioned(
83-
right: 0.0,
84-
top: (MediaQuery.of(context).size.height - 150.0) / 2 - 70.0,
85-
child: ResponsiveVisibility(
86-
visible: false,
87-
visibleWhen: [Condition.largerThan(name: MOBILE)],
88-
child: PageIndicator(
89-
currentIndex: ValueNotifier(0),
90-
),
30+
items: List.generate(
31+
carouselItems.length,
32+
(index) => Builder(
33+
builder: (BuildContext context) {
34+
return Container(
35+
constraints: BoxConstraints(
36+
minHeight: carouselContainerHeight,
37+
),
38+
child: ScreenHelper(
39+
// Responsive views
40+
desktop: _buildDesktop(
41+
context,
42+
carouselItems[index].text,
43+
carouselItems[index].image,
44+
),
45+
tablet: _buildTablet(
46+
context,
47+
carouselItems[index].text,
48+
carouselItems[index].image,
49+
),
50+
mobile: _buildMobile(
51+
context,
52+
carouselItems[index].text,
53+
carouselItems[index].image,
54+
),
55+
),
56+
);
57+
},
9158
),
92-
)
93-
],
94-
),
59+
).toList(),
60+
),
61+
)
9562
],
9663
),
9764
);
9865
}
9966
}
10067

101-
Widget buildDesktop(BuildContext context, Widget text, Widget image) {
68+
// Big screens
69+
Widget _buildDesktop(BuildContext context, Widget text, Widget image) {
10270
return Center(
10371
child: ResponsiveWrapper(
104-
maxWidth: 1000.0,
105-
minWidth: 1000.0,
72+
maxWidth: kDesktopMaxWidth,
73+
minWidth: kDesktopMaxWidth,
10674
defaultScale: false,
10775
child: Row(
10876
children: [
@@ -111,28 +79,19 @@ Widget buildDesktop(BuildContext context, Widget text, Widget image) {
11179
),
11280
Expanded(
11381
child: image,
114-
),
82+
)
11583
],
11684
),
11785
),
11886
);
11987
}
12088

121-
Widget buildMobile(BuildContext context, Widget text, Widget image) {
122-
return Container(
123-
constraints: BoxConstraints(
124-
maxWidth: MediaQuery.of(context).size.width * 0.8,
125-
),
126-
width: double.infinity,
127-
child: text,
128-
);
129-
}
130-
131-
Widget buildTablet(BuildContext context, Widget text, Widget image) {
89+
// Mid screens
90+
Widget _buildTablet(BuildContext context, Widget text, Widget image) {
13291
return Center(
13392
child: ResponsiveWrapper(
134-
maxWidth: 760.0,
135-
minWidth: 760.0,
93+
maxWidth: kTabletMaxWidth,
94+
minWidth: kTabletMaxWidth,
13695
defaultScale: false,
13796
child: Row(
13897
children: [
@@ -141,47 +100,21 @@ Widget buildTablet(BuildContext context, Widget text, Widget image) {
141100
),
142101
Expanded(
143102
child: image,
144-
),
103+
)
145104
],
146105
),
147106
),
148107
);
149108
}
150109

151-
// class PageChanger extends StatelessWidget {
152-
// @override
153-
// Widget build(BuildContext context) {
154-
// return Row(
155-
// mainAxisAlignment: MainAxisAlignment.start,
156-
// children: [
157-
// MouseRegion(
158-
// cursor: SystemMouseCursors.click,
159-
// child: GestureDetector(
160-
// onTap: () {},
161-
// child: Icon(
162-
// FlutterIcons.caret_square_left_faw5,
163-
// color: kPrimaryColor,
164-
// size: 28.0,
165-
// ),
166-
// ),
167-
// ),
168-
// SizedBox(
169-
// width: 15.0,
170-
// ),
171-
// MouseRegion(
172-
// cursor: SystemMouseCursors.click,
173-
// child: GestureDetector(
174-
// onTap: () {
175-
// carouselController.nextPage();
176-
// },
177-
// child: Icon(
178-
// FlutterIcons.caret_square_right_faw5,
179-
// color: kPrimaryColor,
180-
// size: 28.0,
181-
// ),
182-
// ),
183-
// )
184-
// ],
185-
// );
186-
// }
187-
// }
110+
// SMall Screens
111+
112+
Widget _buildMobile(BuildContext context, Widget text, Widget image) {
113+
return Container(
114+
constraints: BoxConstraints(
115+
maxWidth: getMobileMaxWidth(context),
116+
),
117+
width: double.infinity,
118+
child: text,
119+
);
120+
}

0 commit comments

Comments
 (0)