Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/hotfix/social-auth' into hotfix/…
Browse files Browse the repository at this point in the history
…social-auth
  • Loading branch information
MillerAdulu committed Aug 22, 2024
2 parents 23d91e7 + 31db3db commit 64c4bad
Show file tree
Hide file tree
Showing 12 changed files with 177 additions and 147 deletions.
4 changes: 2 additions & 2 deletions lib/common/widgets/personnel_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ class PersonnelWidget extends StatelessWidget {
fit: BoxFit.cover,
imageUrl: imageUrl,
placeholder: (_, __) => const SizedBox(
height: 150,
height: 100,
width: double.infinity,
child: Center(child: CircularProgressIndicator()),
),
errorWidget: (_, __, ___) => const SizedBox(
height: 150,
height: 100,
width: double.infinity,
child: Icon(
Icons.error,
Expand Down
93 changes: 54 additions & 39 deletions lib/common/widgets/social_handle.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,51 +20,66 @@ class SocialHandleBody extends StatelessWidget {
Widget build(BuildContext context) {
final l10n = context.l10n;
final (_, colorScheme) = Misc.getTheme(context);
final size = MediaQuery.sizeOf(context);

return Row(
children: [
Text(
twitterUrl != null ? l10n.twitterHandle : l10n.linkedin,
style: TextStyle(
color: colorScheme.onSurface,
fontSize: 20,
),
),
const Spacer(),
ElevatedButton(
onPressed: () {
if (twitterUrl != null || linkedinUrl != null) {
Misc.launchURL(Uri.parse(twitterUrl ?? linkedinUrl ?? ''));
}
},
style: ElevatedButton.styleFrom(
elevation: 0,
backgroundColor: colorScheme.surface,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
side: BorderSide(
color: colorScheme.primary,
),
return SizedBox(
width: size.width,
child: Wrap(
spacing: 8,
crossAxisAlignment: WrapCrossAlignment.center,
alignment: WrapAlignment.spaceBetween,
children: [
Text(
twitterUrl != null ? l10n.twitterHandle : l10n.linkedin,
style: TextStyle(
color: colorScheme.onSurface,
fontSize: 20,
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
if (twitterUrl != null)
SvgPicture.asset(
AppAssets.iconTwitter,
colorFilter: ColorFilter.mode(
colorScheme.primary,
BlendMode.srcIn,
ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 200),
child: ElevatedButton(
onPressed: () {
if (twitterUrl != null || linkedinUrl != null) {
Misc.launchURL(Uri.parse(twitterUrl ?? linkedinUrl ?? ''));
}
},
style: ElevatedButton.styleFrom(
elevation: 0,
backgroundColor: colorScheme.surface,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
side: BorderSide(
color: colorScheme.primary,
),
height: 20,
),
const SizedBox(width: 3),
Text(name),
],
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
if (twitterUrl != null)
SvgPicture.asset(
AppAssets.iconTwitter,
colorFilter: ColorFilter.mode(
colorScheme.primary,
BlendMode.srcIn,
),
height: 20,
),
const SizedBox(width: 3),
Flexible(
child: Text(
name,
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
],
),
),
),
),
],
],
),
);
}
}
1 change: 1 addition & 0 deletions lib/features/about/ui/organising_team.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class _OrganisingTeamViewState extends State<OrganisingTeamView> {
crossAxisCount: 3,
crossAxisSpacing: 8,
mainAxisSpacing: 8,
mainAxisExtent: 150,
),
itemBuilder: (context, index) => PersonnelWidget(
imageUrl: individualOrganisers[index].photo,
Expand Down
2 changes: 1 addition & 1 deletion lib/features/about/ui/organising_team_details.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class OranisingTeamMemberDetailsPage extends StatelessWidget {
),
expandedHeight: 100,
bottom: PreferredSize(
preferredSize: const Size.fromHeight(0),
preferredSize: const Size.fromHeight(120),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expand Down
2 changes: 1 addition & 1 deletion lib/features/home/ui/speaker_details/speaker_details.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class SpeakerDetailsPage extends StatelessWidget {
),
expandedHeight: 100,
bottom: PreferredSize(
preferredSize: const Size.fromHeight(0),
preferredSize: const Size.fromHeight(120),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expand Down
3 changes: 2 additions & 1 deletion lib/features/home/ui/speakers_list_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class SpeakerListScreen extends StatelessWidget {
l10n.speakers,
style: TextStyle(color: colorScheme.onSurface),
),
surfaceTintColor: Colors.white,
),
body: BlocBuilder<FetchSpeakersCubit, FetchSpeakersState>(
builder: (context, state) => state.maybeWhen(
Expand All @@ -35,7 +36,7 @@ class SpeakerListScreen extends StatelessWidget {
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
mainAxisSpacing: 4,
crossAxisSpacing: 4,
childAspectRatio: 9 / 14,
mainAxisExtent: 316,
crossAxisCount: 2,
),
itemBuilder: (context, index) =>
Expand Down
4 changes: 2 additions & 2 deletions lib/features/home/widgets/speaker_grid_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class SpeakerGridTile extends StatelessWidget {
),
textAlign: TextAlign.center,
),
const SizedBox(height: 8),
const Spacer(),
Text(
speaker.tagline ?? '',
overflow: TextOverflow.clip,
Expand All @@ -77,7 +77,7 @@ class SpeakerGridTile extends StatelessWidget {
),
textAlign: TextAlign.center,
),
const SizedBox(height: 10),
const Spacer(),
SizedBox(
width: double.infinity,
child: ElevatedButton(
Expand Down
4 changes: 1 addition & 3 deletions lib/features/home/widgets/sponsors_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ class _SponsorsCardState extends State<SponsorsCard> {
color: colorScheme.secondaryContainer,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
const Spacer(),
Text(
l10n.sponsors,
style: TextStyle(
Expand All @@ -45,7 +45,6 @@ class _SponsorsCardState extends State<SponsorsCard> {
fontSize: 18,
),
),
const Spacer(),
BlocBuilder<FetchSponsorsCubit, FetchSponsorsState>(
builder: (context, state) => state.maybeWhen(
loaded: (sponsors) {
Expand Down Expand Up @@ -101,7 +100,6 @@ class _SponsorsCardState extends State<SponsorsCard> {
),
),
),
const Spacer(),
],
),
);
Expand Down
165 changes: 87 additions & 78 deletions lib/features/sessions/ui/sessions_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,94 +55,103 @@ class _SessionsScreenState extends State<SessionsScreen>
headerSliverBuilder: (context, innerBoxIsScrolled) => <Widget>[
SliverToBoxAdapter(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
BlocConsumer<FetchGroupedSessionsCubit,
FetchGroupedSessionsState>(
listener: (context, state) {
state.mapOrNull(
loaded: (loaded) {
setState(() {
_availableTabs = loaded.groupedSessions.length;
});
},
);
},
builder: (context, state) => state.maybeWhen(
orElse: () => const Padding(
padding: EdgeInsets.symmetric(horizontal: 16),
child: CircularProgressIndicator(),
),
loaded: (groupedSessions) => TabBar(
onTap: (value) => setState(() {
_currentTab = value;
}),
isScrollable: true,
tabAlignment: TabAlignment.start,
indicatorColor: Colors.transparent,
dividerColor: Colors.transparent,
overlayColor:
WidgetStateProperty.all(Colors.transparent),
tabs: [
...groupedSessions.keys.map(
(date) => DayTabView(
date: DateFormat.d().format(
DateFormat('MM/dd/yyyy').parse(date),
Flexible(
flex: 8,
child: BlocConsumer<FetchGroupedSessionsCubit,
FetchGroupedSessionsState>(
listener: (context, state) {
state.mapOrNull(
loaded: (loaded) {
setState(() {
_availableTabs = loaded.groupedSessions.length;
});
},
);
},
builder: (context, state) => state.maybeWhen(
orElse: () => const Padding(
padding: EdgeInsets.symmetric(horizontal: 16),
child: CircularProgressIndicator(),
),
loaded: (groupedSessions) => TabBar(
onTap: (value) => setState(() {
_currentTab = value;
}),
isScrollable: true,
tabAlignment: TabAlignment.start,
indicatorColor: Colors.transparent,
dividerColor: Colors.transparent,
overlayColor:
WidgetStateProperty.all(Colors.transparent),
tabs: [
...groupedSessions.keys.map(
(date) => DayTabView(
date: DateFormat.d().format(
DateFormat('MM/dd/yyyy').parse(date),
),
day: groupedSessions.keys
.toList()
.indexOf(date) +
1,
isActive: _currentTab ==
groupedSessions.keys
.toList()
.indexOf(date),
),
day: groupedSessions.keys
.toList()
.indexOf(date) +
1,
isActive: _currentTab ==
groupedSessions.keys.toList().indexOf(date),
),
),
],
],
),
),
),
),
const Spacer(),
Padding(
padding: const EdgeInsets.only(right: 16),
child: Column(
children: [
Switch(
value: _isBookmarked,
onChanged: (newValue) {
setState(() {
_isBookmarked = newValue;
});
Flexible(
flex: 2,
child: Padding(
padding: const EdgeInsets.only(right: 16),
child: Column(
children: [
Switch(
value: _isBookmarked,
onChanged: (newValue) {
setState(() {
_isBookmarked = newValue;
});

if (_isBookmarked) {
context
.read<FetchGroupedSessionsCubit>()
.fetchGroupedSessions(
bookmarkStatus: BookmarkStatus.bookmarked,
);
}
if (_isBookmarked) {
context
.read<FetchGroupedSessionsCubit>()
.fetchGroupedSessions(
bookmarkStatus:
BookmarkStatus.bookmarked,
);
}

if (!_isBookmarked) {
context
.read<FetchGroupedSessionsCubit>()
.fetchGroupedSessions();
}
},
trackOutlineWidth: WidgetStateProperty.all(1),
trackColor: WidgetStateProperty.all(Colors.black),
activeTrackColor: ThemeColors.orangeColor,
activeColor: ThemeColors.orangeColor,
thumbColor: WidgetStateProperty.all(Colors.white),
thumbIcon: WidgetStateProperty.all(
const Icon(Icons.star_border_rounded),
if (!_isBookmarked) {
context
.read<FetchGroupedSessionsCubit>()
.fetchGroupedSessions();
}
},
trackOutlineWidth: WidgetStateProperty.all(1),
trackColor: WidgetStateProperty.all(Colors.black),
activeTrackColor: ThemeColors.orangeColor,
activeColor: ThemeColors.orangeColor,
thumbColor: WidgetStateProperty.all(Colors.white),
thumbIcon: WidgetStateProperty.all(
const Icon(Icons.star_border_rounded),
),
),
),
Text(
l10n.mySessions,
style: const TextStyle(
fontSize: 10,
color: Colors.grey,
Text(
l10n.mySessions,
style: const TextStyle(
fontSize: 10,
color: Colors.grey,
),
),
),
],
],
),
),
),
],
Expand Down
Loading

0 comments on commit 64c4bad

Please sign in to comment.