Skip to content

Commit 7d81ccd

Browse files
Roman JaquezRoman Jaquez
authored andcommitted
more on schedule
1 parent 714e39c commit 7d81ccd

File tree

5 files changed

+157
-78
lines changed

5 files changed

+157
-78
lines changed

lib/features/schedule/presentation/pages/schedule_page.dart

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ class SchedulePage extends ConsumerWidget {
2626
final uiConfig = ScheduleContentResponsiveConfig.getSchedulePageResponsiveConfig(context);
2727
final schedule = ref.watch(scheduleFutureProvider);
2828

29-
// return SingleChildScrollView(
30-
// child: ScheduleDayBlock(
31-
// )
32-
// );
3329
return SingleChildScrollView(
3430
child: Center(
3531
child: Padding(
@@ -53,16 +49,6 @@ class SchedulePage extends ConsumerWidget {
5349
],
5450
),
5551
uiConfig.pageVerticalGap,
56-
// const ComingSoonContainer(),
57-
// uiConfig.pageVerticalGap,
58-
// Text(appLoc.schedulePageContent,
59-
// textAlign: TextAlign.center,
60-
// ),
61-
// uiConfig.pageVerticalGap,
62-
// Text(appLoc.schedulePageSubcontent, textAlign: TextAlign.center,
63-
// style: uiConfig.subheaderStyle
64-
// ),
65-
// uiConfig.pageVerticalGap,
6652
schedule.when(
6753
data: (scheduleData) {
6854

lib/features/schedule/presentation/responsiveness/schedule_content_responsive_config.dart

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@ import 'package:responsive_builder/responsive_builder.dart';
55
class ScheduleContentResponsiveConfig {
66
const ScheduleContentResponsiveConfig({
77
required this.pagePadding,
8+
required this.trackTabPadding,
89
required this.headerStyle,
910
required this.subheaderStyle,
1011
required this.headerDirection,
1112
required this.headerGap,
1213
required this.headerIconSize,
1314
required this.pageVerticalGap,
1415
required this.tabDayLabelStyle,
16+
required this.trackLabelStyle,
1517
required this.timeContentOrientation,
1618
required this.tabDateLabelStyle,
1719
required this.timeFlexValue,
@@ -22,6 +24,7 @@ class ScheduleContentResponsiveConfig {
2224

2325

2426
final EdgeInsets pagePadding;
27+
final EdgeInsets trackTabPadding;
2528
final TextStyle headerStyle;
2629
final TextStyle subheaderStyle;
2730
final Axis headerDirection;
@@ -36,6 +39,8 @@ class ScheduleContentResponsiveConfig {
3639
final int contentFlexValue;
3740
final Axis contentBottomRowOrientation;
3841
final int contentBottomLeftFlex;
42+
final TextStyle trackLabelStyle;
43+
3944

4045

4146
static ScheduleContentResponsiveConfig getSchedulePageResponsiveConfig(BuildContext ctxt) {
@@ -56,6 +61,8 @@ class ScheduleContentResponsiveConfig {
5661
contentFlexValue: 0,
5762
contentBottomRowOrientation: Axis.vertical,
5863
contentBottomLeftFlex: 0,
64+
trackLabelStyle: FlutterConfLatamStyles.h7,
65+
trackTabPadding: FlutterConfLatamStyles.smallPadding,
5966
),
6067
tablet: const ScheduleContentResponsiveConfig(
6168
pagePadding: FlutterConfLatamStyles.mediumPadding,
@@ -65,13 +72,15 @@ class ScheduleContentResponsiveConfig {
6572
headerDirection: Axis.horizontal,
6673
headerIconSize: 60,
6774
pageVerticalGap: FlutterConfLatamStyles.mediumVGap,
68-
tabDayLabelStyle: FlutterConfLatamStyles.h5,
69-
tabDateLabelStyle: FlutterConfLatamStyles.h6,
75+
tabDayLabelStyle: FlutterConfLatamStyles.h6,
76+
tabDateLabelStyle: FlutterConfLatamStyles.h7,
7077
timeContentOrientation: Axis.horizontal,
7178
timeFlexValue: 1,
7279
contentFlexValue: 4,
7380
contentBottomRowOrientation: Axis.horizontal,
7481
contentBottomLeftFlex: 1,
82+
trackLabelStyle: FlutterConfLatamStyles.h7,
83+
trackTabPadding: FlutterConfLatamStyles.mediumPadding,
7584
),
7685
desktop: const ScheduleContentResponsiveConfig(
7786
pagePadding: FlutterConfLatamStyles.xLargePadding,
@@ -88,6 +97,8 @@ class ScheduleContentResponsiveConfig {
8897
contentFlexValue: 4,
8998
contentBottomRowOrientation: Axis.horizontal,
9099
contentBottomLeftFlex: 1,
100+
trackLabelStyle: FlutterConfLatamStyles.h6,
101+
trackTabPadding: FlutterConfLatamStyles.mediumPadding,
91102
),
92103
);
93104

lib/features/schedule/presentation/responsiveness/schedule_day1_layout_lg.dart

Lines changed: 19 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import 'package:flutter/material.dart';
2+
import 'package:flutter_conf_colombia/features/schedule/presentation/responsiveness/schedule_content_responsive_config.dart';
3+
import 'package:flutter_conf_colombia/features/schedule/presentation/widgets/schedule_cell_content.dart';
24
import 'package:flutter_conf_colombia/features/schedule/presentation/widgets/schedule_session.dart';
35
import 'package:flutter_conf_colombia/features/sessions/data/models/session.model.dart';
46
import 'package:flutter_conf_colombia/features/speakers/data/models/speaker.model.dart';
@@ -19,62 +21,14 @@ class ScheduleDay1LargeLayout extends StatelessWidget {
1921

2022
Widget getSessionFromSlotId(int id) {
2123

22-
2324
if (sessions.any((s) => s.scheduleSlot == id)) {
2425
final foundSession = sessions.firstWhere((s) => s.scheduleSlot == id);
25-
final sessionColor = Utils.getColorFromSessionType(foundSession.sessionType);
26-
return Container(
27-
padding: const EdgeInsets.all(20),
28-
color: Utils.getColorFromSessionType(foundSession.sessionType),
29-
child: Column(
30-
crossAxisAlignment: CrossAxisAlignment.start,
31-
mainAxisAlignment: MainAxisAlignment.spaceBetween,
32-
children: [
33-
Column(
34-
crossAxisAlignment: CrossAxisAlignment.start,
35-
mainAxisSize: MainAxisSize.min,
36-
children: [
37-
Text(sessions.firstWhere((s) => s.scheduleSlot == id).title,
38-
maxLines: 2,
39-
overflow: TextOverflow.ellipsis,
40-
style: FlutterConfLatamStyles.getStylesFromSessionType(foundSession.sessionType),
41-
),
42-
Text(sessions.firstWhere((s) => s.scheduleSlot == id).description,
43-
maxLines: 1,
44-
overflow: TextOverflow.ellipsis,
45-
),
46-
],
47-
),
48-
if (foundSession.speakerId.isNotEmpty)
49-
Row(
50-
mainAxisSize: MainAxisSize.min,
51-
children: [
52-
Container(
53-
width: 40,
54-
height: 40,
55-
decoration: BoxDecoration(
56-
shape: BoxShape.circle,
57-
border: Border.all(
58-
width: 4, color: sessionColor,
59-
strokeAlign: BorderSide.strokeAlignOutside
60-
),
61-
image: DecorationImage(
62-
image: NetworkImage(
63-
speakers.firstWhere((s) => s.id == foundSession.speakerId).photo!,
64-
),
65-
fit: BoxFit.cover,
66-
)
67-
),
68-
),
69-
FlutterConfLatamStyles.xsmallHGap,
70-
Text(speakers.firstWhere((s) => s.id == foundSession.speakerId).name!, style: FlutterConfLatamStyles.h7.copyWith(
71-
fontWeight: FontWeight.normal,
72-
color: Colors.black)),
73-
],
74-
)
75-
],
76-
)
77-
);
26+
final speakersList = speakers.where((s) => foundSession.speakers.contains(s.id)).toList();
27+
28+
return ScheduleCellContent(
29+
session: foundSession,
30+
speakers: speakersList
31+
);
7832
}
7933

8034
return Container(
@@ -84,16 +38,19 @@ class ScheduleDay1LargeLayout extends StatelessWidget {
8438

8539
@override
8640
Widget build(BuildContext context) {
41+
42+
final uiConfig = ScheduleContentResponsiveConfig.getSchedulePageResponsiveConfig(context);
43+
8744
return StaggeredGrid.count(
8845
axisDirection: AxisDirection.down,
8946
crossAxisCount: 7,
9047
mainAxisSpacing: 8,
9148
crossAxisSpacing: 8,
9249
children: [
93-
StaggeredGridTile.count(
50+
const StaggeredGridTile.count(
9451
crossAxisCellCount: 1,
9552
mainAxisCellCount: 1,
96-
child: const SizedBox.shrink(),
53+
child: SizedBox.shrink(),
9754
),
9855
StaggeredGridTile.count(
9956
crossAxisCellCount: 2,
@@ -103,9 +60,9 @@ class ScheduleDay1LargeLayout extends StatelessWidget {
10360
crossAxisAlignment: CrossAxisAlignment.stretch,
10461
children: [
10562
Container(
106-
padding: EdgeInsets.all(20),
63+
padding: uiConfig.trackTabPadding,
10764
color: Colors.orangeAccent,
108-
child: Text('Track 1', style: FlutterConfLatamStyles.h6.copyWith(color: Colors.black), textAlign: TextAlign.center,),
65+
child: Text('Track 1', style: uiConfig.trackLabelStyle.copyWith(color: Colors.black), textAlign: TextAlign.center,),
10966
)
11067
],
11168
),
@@ -118,9 +75,9 @@ class ScheduleDay1LargeLayout extends StatelessWidget {
11875
crossAxisAlignment: CrossAxisAlignment.stretch,
11976
children: [
12077
Container(
121-
padding: EdgeInsets.all(20),
78+
padding: uiConfig.trackTabPadding,
12279
color: Colors.orangeAccent,
123-
child: Text('Track 2', style: FlutterConfLatamStyles.h6.copyWith(color: Colors.black), textAlign: TextAlign.center,),
80+
child: Text('Track 2', style: uiConfig.trackLabelStyle.copyWith(color: Colors.black), textAlign: TextAlign.center,),
12481
)
12582
],
12683
),
@@ -133,9 +90,9 @@ class ScheduleDay1LargeLayout extends StatelessWidget {
13390
crossAxisAlignment: CrossAxisAlignment.stretch,
13491
children: [
13592
Container(
136-
padding: EdgeInsets.all(20),
93+
padding: uiConfig.trackTabPadding,
13794
color: Colors.greenAccent,
138-
child: Text('Workshops', style: FlutterConfLatamStyles.h6.copyWith(color: Colors.black), textAlign: TextAlign.center,),
95+
child: Text('Workshops', style: uiConfig.trackLabelStyle.copyWith(color: Colors.black), textAlign: TextAlign.center,),
13996
)
14097
],
14198
),
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:flutter/widgets.dart';
3+
import 'package:flutter_conf_colombia/features/sessions/data/models/session.model.dart';
4+
import 'package:flutter_conf_colombia/features/speakers/data/models/speaker.model.dart';
5+
import 'package:flutter_conf_colombia/helpers/utils.dart';
6+
import 'package:flutter_conf_colombia/styles/styles.dart';
7+
import 'package:responsive_builder/responsive_builder.dart';
8+
9+
class ScheduleCellContent extends StatelessWidget {
10+
11+
final SessionModel session;
12+
final List<SpeakerModel> speakers;
13+
14+
const ScheduleCellContent({
15+
required this.session,
16+
required this.speakers,
17+
super.key});
18+
19+
@override
20+
Widget build(BuildContext context) {
21+
22+
final sessionColor = Utils.getColorFromSessionType(session.sessionType);
23+
24+
final showSpeakerImage = getValueForScreenType(context: context,
25+
mobile: false,
26+
tablet: false,
27+
desktop: true,
28+
);
29+
30+
final showSpeaker = getValueForScreenType(context: context,
31+
mobile: false,
32+
tablet: false,
33+
desktop: true,
34+
);
35+
36+
final showSessionDescription = getValueForScreenType(context: context,
37+
mobile: false,
38+
tablet: false,
39+
desktop: true,
40+
);
41+
42+
double cellPadding = getValueForScreenType(context: context,
43+
mobile: 8,
44+
tablet: 10,
45+
desktop: 16,
46+
);
47+
48+
return Container(
49+
padding: EdgeInsets.all(cellPadding),
50+
color: Utils.getColorFromSessionType(session.sessionType),
51+
child: Column(
52+
crossAxisAlignment: CrossAxisAlignment.start,
53+
mainAxisAlignment: MainAxisAlignment.spaceBetween,
54+
children: [
55+
Column(
56+
crossAxisAlignment: CrossAxisAlignment.start,
57+
mainAxisSize: MainAxisSize.min,
58+
children: [
59+
Text(session.title,
60+
maxLines: 2,
61+
overflow: TextOverflow.ellipsis,
62+
style: FlutterConfLatamStyles.getStylesFromSessionType(session.sessionType),
63+
),
64+
Visibility(
65+
visible: showSessionDescription,
66+
child: Text(session.description,
67+
maxLines: 1,
68+
overflow: TextOverflow.ellipsis,
69+
),
70+
),
71+
],
72+
),
73+
if (speakers.isNotEmpty)
74+
Row(
75+
children: [
76+
for(final speaker in speakers)
77+
Visibility(
78+
visible: showSpeakerImage,
79+
child: Row(
80+
mainAxisSize: MainAxisSize.min,
81+
children: [
82+
Container(
83+
width: 30,
84+
height: 30,
85+
decoration: BoxDecoration(
86+
shape: BoxShape.circle,
87+
border: Border.all(
88+
width: 3, color: sessionColor,
89+
strokeAlign: BorderSide.strokeAlignOutside,
90+
),
91+
image: DecorationImage(
92+
image: NetworkImage(
93+
speaker.photo!,
94+
),
95+
fit: BoxFit.cover,
96+
)
97+
),
98+
),
99+
FlutterConfLatamStyles.xsmallHGap,
100+
Visibility(
101+
visible: showSpeaker,
102+
child: Text(speaker.name!, style:
103+
FlutterConfLatamStyles.label6,
104+
),
105+
),
106+
],
107+
),
108+
)
109+
],
110+
)
111+
],
112+
)
113+
);
114+
}
115+
}

lib/styles/styles.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,16 @@ class FlutterConfLatamStyles {
5151
static const TextStyle h7 = TextStyle(fontSize: 16, fontWeight: FontWeight.bold, color: FlutterLatamColors.blueText);
5252
static const TextStyle h8 = TextStyle(fontSize: 8, fontWeight: FontWeight.bold, color: FlutterLatamColors.blueText);
5353

54+
static const TextStyle label1 = TextStyle(fontSize: 32, fontWeight: FontWeight.bold, color: Colors.black);
55+
static const TextStyle label2 = TextStyle(fontSize: 28, fontWeight: FontWeight.bold, color: Colors.black);
56+
static const TextStyle label3 = TextStyle(fontSize: 24, fontWeight: FontWeight.bold, color: Colors.black);
57+
static const TextStyle label4 = TextStyle(fontSize: 20, fontWeight: FontWeight.bold, color: Colors.black);
58+
static const TextStyle label5 = TextStyle(fontSize: 16, fontWeight: FontWeight.bold, color: Colors.black);
59+
static const TextStyle label6 = TextStyle(fontSize: 12, fontWeight: FontWeight.bold, color: Colors.black);
60+
static const TextStyle label7 = TextStyle(fontSize: 8, fontWeight: FontWeight.bold, color: Colors.black);
61+
static const TextStyle label8 = TextStyle(fontSize: 4, fontWeight: FontWeight.bold, color: Colors.black);
62+
63+
5464
static TextStyle getStylesFromSessionType(SessionType sessionType) {
5565
switch(sessionType) {
5666
case SessionType.eventSession:

0 commit comments

Comments
 (0)