Skip to content

Commit

Permalink
Merge pull request #252 from TechnicalTeam-BVCOENM/fix
Browse files Browse the repository at this point in the history
fix: overflow issue
  • Loading branch information
Niranjan-Dorage authored Sep 2, 2024
2 parents b31eeae + 672cba8 commit 3af421d
Show file tree
Hide file tree
Showing 8 changed files with 205 additions and 313 deletions.
24 changes: 10 additions & 14 deletions lib/ui/views/community/clubs/clubs_view_components.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,16 @@ class ClubsData extends ViewModelWidget<ClubsViewModel> {
padding: const EdgeInsets.symmetric(horizontal: 18).r,
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
10.verticalSpace,
Hero(
tag: clubShortHand,
child: Center(
child: ClipRRect(
borderRadius: BorderRadius.circular(16.0).r,
child: CachedNetworkImage(
height: 276.h,
width: 395.w,
fit: BoxFit.fill,
imageUrl: clubImage,
placeholder: (context, url) =>
const CircularLoadingIndicator(),
errorWidget: (context, url, error) => const Icon(Icons.error),
),
Center(
child: ClipRRect(
borderRadius: BorderRadius.circular(16.0).r,
child: CachedNetworkImage(
height: 276.h,
width: 395.w,
fit: BoxFit.fill,
imageUrl: clubImage,
placeholder: (context, url) => const CircularLoadingIndicator(),
errorWidget: (context, url, error) => const Icon(Icons.error),
),
),
),
Expand Down
300 changes: 126 additions & 174 deletions lib/ui/views/community/community_view.dart

Large diffs are not rendered by default.

74 changes: 34 additions & 40 deletions lib/ui/views/community/community_view_components.dart
Original file line number Diff line number Diff line change
Expand Up @@ -200,27 +200,24 @@ class DepartmentClubs extends ViewModelWidget<CommunityViewModel> {
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Hero(
tag: data.clubShortHand,
child: CachedNetworkImage(
imageUrl: data.clubImage,
height: 80.h,
width: 120.w,
fit: BoxFit.fitHeight,
maxHeightDiskCache: 200,
imageBuilder: (context, imageProvider) {
return Container(
height: 80.h,
width: 120.w,
decoration: BoxDecoration(
image: DecorationImage(
image: imageProvider,
fit: BoxFit.cover,
),
CachedNetworkImage(
imageUrl: data.clubImage,
height: 80.h,
width: 120.w,
fit: BoxFit.fitHeight,
maxHeightDiskCache: 200,
imageBuilder: (context, imageProvider) {
return Container(
height: 80.h,
width: 120.w,
decoration: BoxDecoration(
image: DecorationImage(
image: imageProvider,
fit: BoxFit.cover,
),
);
},
),
),
);
},
),
Container(
height: 30.h,
Expand Down Expand Up @@ -284,27 +281,24 @@ class UniversalClubs extends ViewModelWidget<CommunityViewModel> {
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Hero(
tag: data.uniclubShortHand,
child: CachedNetworkImage(
imageUrl: data.uniclubImage,
height: 80.h,
width: 120.w,
fit: BoxFit.fitHeight,
maxHeightDiskCache: 200,
imageBuilder: (context, imageProvider) {
return Container(
height: 80.h,
width: 120.w,
decoration: BoxDecoration(
image: DecorationImage(
image: imageProvider,
fit: BoxFit.cover,
),
CachedNetworkImage(
imageUrl: data.uniclubImage,
height: 80.h,
width: 120.w,
fit: BoxFit.fitHeight,
maxHeightDiskCache: 200,
imageBuilder: (context, imageProvider) {
return Container(
height: 80.h,
width: 120.w,
decoration: BoxDecoration(
image: DecorationImage(
image: imageProvider,
fit: BoxFit.cover,
),
);
},
),
),
);
},
),
Container(
height: 30.h,
Expand Down
30 changes: 5 additions & 25 deletions lib/ui/views/community/community_view_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -121,25 +121,6 @@ class CommunityViewModel extends BaseViewModel {
}
}

Future<void> fetchAffirmation() async {
try {
List<String> author;
var response = await http.get(Uri.parse('https://api.forismatic.com/api/1.0/?method=getQuote&format=json&lang=en'));

if (response.statusCode != 200) {
return;
} else if (response.statusCode == 200) {
final data = jsonDecode(response.body.toString());
affirmation = data['quoteText'];
authorName = data['quoteAuthor'];
author = authorName.split(",");
authorName = author[0];
}
} on Exception catch (e) {
log.e("Error in fetching affirmation: ${e.toString()}");
}
}

Future<void> updateLikes(String blogId, BuildContext context) async {
final currentBlog = localStorageService.read("isLiked_$blogId");
AuthenticationService authenticationService =
Expand Down Expand Up @@ -171,12 +152,11 @@ class CommunityViewModel extends BaseViewModel {
Future<void> init(context) async {
try {
_analyticsService.logScreen(screenName: 'CommunityView Screen Opened');
await runBusyFuture(getBlogData());
await getDepartmentClubsData();
notifyListeners();
await getUniversalClubsData();
notifyListeners();
await fetchAffirmation();
Future.wait([
getBlogData(),
getDepartmentClubsData(),
getUniversalClubsData(),
]);
notifyListeners();
} catch (e) {
log.e(e.toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class DettailedBlogPageModel extends BaseViewModel {
eventName: "Detailed_Blog_View",
value: "${blogData.title} Blog Viewed : ${blogData.documentId}");

SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: []);
// SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: []);
}

void shareBlog(BuildContext context, CommunityBlogsData blogData) async {
Expand All @@ -26,7 +26,7 @@ class DettailedBlogPageModel extends BaseViewModel {
}

void disposeModel() {
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual,
overlays: SystemUiOverlay.values);
// SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual,
// overlays: SystemUiOverlay.values);
}
}
34 changes: 2 additions & 32 deletions lib/ui/views/community/uni_clubs/uni_clubs_view_components.dart
Original file line number Diff line number Diff line change
Expand Up @@ -114,38 +114,8 @@ class UniversalClubsDatas extends ViewModelWidget<UniClubsViewModel> {
),
),
),
clubFest.isEmpty
? Container()
: Padding(
padding: const EdgeInsets.only(left: 16.0).r,
child: Text(
"Fests | ${clubFest.length}",
style: fontTheme.body(
context,
fontWeight: FontWeight.w500,
),
),
),
clubFest.isEmpty
? Container()
: SizedBox(
height: 230.h,
width: double.infinity,
child: ListView.builder(
physics: const BouncingScrollPhysics(),
scrollDirection: Axis.horizontal,
itemCount: clubFest.length,
shrinkWrap: true,
itemBuilder: (context, index) {
return FestCard(
clubFest: clubFest,
fontTheme: fontTheme,
index: index,
);
},
),
),
15.verticalSpace,
12.verticalSpace,
// TODO: Add button to join the club
]));
}
}
Expand Down
46 changes: 23 additions & 23 deletions lib/ui/views/home/home_view_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,29 @@ class HomeViewModel extends BaseViewModel {
List<CelebrationData> get celebrationData => _celebrationData;
int get activeIndex => _activeIndex;

List<QuickLinksModel> quickLinksList = [
QuickLinksModel(
imageUrl: "assets/images/android_splash_logo.png",
title: "BVCOENM",
url: 'https://www.bvcoenm.edu.in/',
),
QuickLinksModel(
imageUrl: "assets/images/home/quick_links/abhiyaan.png",
title: "Abhiyaan",
url: 'https://abhiyaan.tech/',
),
QuickLinksModel(
imageUrl: "assets/images/home/quick_links/tdc_logo.png",
title: "TDC",
url: 'https://abhiyaan.tech/',
),
QuickLinksModel(
imageUrl: "assets/images/home/quick_links/cesa.png",
title: "CESA",
url: 'https://www.clubcesa.tech/',
),
];

bool toggleCelebrationShown() {
try {
isCelebrationShown = true;
Expand Down Expand Up @@ -136,29 +159,6 @@ class HomeViewModel extends BaseViewModel {
}
}

List<QuickLinksModel> quickLinksList = [
QuickLinksModel(
imageUrl: "assets/images/android_splash_logo.png",
title: "BVCOENM",
url: 'https://www.bvcoenm.edu.in/',
),
QuickLinksModel(
imageUrl: "assets/images/home/quick_links/abhiyaan.png",
title: "Abhiyaan",
url: 'https://abhiyaan.tech/',
),
QuickLinksModel(
imageUrl: "assets/images/home/quick_links/tdc_logo.png",
title: "TDC",
url: 'https://abhiyaan.tech/',
),
QuickLinksModel(
imageUrl: "assets/images/home/quick_links/cesa.png",
title: "CESA",
url: 'https://www.clubcesa.tech/',
),
];

Future<void> afterInit(context) async {
try {
await getCelebrationData()
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: abhiyaan
description: A new Flutter project.
publish_to: "none"
version: 1.1.5+10
# Major.Minor.Patch+Build
version: 1.1.6+11
# Major.Minor.Patch+Build
# Major - Major changes like UI/UX changes, new features, etc. Those changes that are not backward compatible.
# Minor - Minor changes like bug fixes, performance improvements, etc. Those changes that are backward compatible.
# Patch - Patch changes like small bug fixes, small improvements, etc. Those changes that are backward compatible.
Expand Down

0 comments on commit 3af421d

Please sign in to comment.