Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

Commit

Permalink
122-fix-padding-on-downloads-view (#123)
Browse files Browse the repository at this point in the history
Adjust padding size of video card and title on Downloads view
  • Loading branch information
cbetul authored Dec 13, 2023
1 parent 82a253d commit dd6d5b8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 21 deletions.
1 change: 1 addition & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class App extends ConsumerWidget {
]);
}
}

Widget _getHomeScreen(User? user) {
return user == null ? const WelcomeScreen() : const CourseOverview();
}
Expand Down
15 changes: 9 additions & 6 deletions lib/views/components/base_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@ class BaseView extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(
title,
style: Theme.of(context).textTheme.titleMedium?.copyWith(
color: Colors.black,
),
textAlign: TextAlign.center,
title: Padding(
padding: const EdgeInsets.all(8.0), // Padding for the AppBar
child: Text(
title,
style: Theme.of(context).textTheme.titleMedium?.copyWith(
color: Colors.black,
),
textAlign: TextAlign.center,
),
),
titleSpacing: 0.0,
actions: actions, // Use the actions here
Expand Down
27 changes: 12 additions & 15 deletions lib/views/video_view/video_card_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,40 +19,37 @@ class VideoCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
return InkWell(
// Wrap the Card with InkWell
onTap: onTap, // Use the onTap callback
onTap: onTap,
child: Card(
clipBehavior: Clip.antiAlias,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, // To reduce the height of the card
mainAxisSize: MainAxisSize.min,
children: [
Stack(
alignment: Alignment.bottomRight,
// Aligns the timestamp to the bottom right of the image
children: [
AspectRatio(
aspectRatio: 16 / 9,
child: Image.asset(
imageName,
fit: BoxFit
.cover, // This will cover the entire space of the Stack
Padding(
// Add padding to the Image
padding: const EdgeInsets.all(8.0),
child: AspectRatio(
aspectRatio: 16 / 9,
child: Image.asset(
imageName,
fit: BoxFit.cover,
),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
// Padding for the duration chip inside the stack
child: Container(
padding: const EdgeInsets.symmetric(
horizontal: 8.0,
vertical: 4.0,
),
decoration: BoxDecoration(
color: Colors.black.withOpacity(0.6),
// Semi-transparent black background
borderRadius: BorderRadius.circular(
4.0,
), // Rounded corners for the chip
borderRadius: BorderRadius.circular(4.0),
),
child: Text(
duration,
Expand Down

0 comments on commit dd6d5b8

Please sign in to comment.