Skip to content

Commit

Permalink
fix: some padding issues
Browse files Browse the repository at this point in the history
It's throwing an error as it's going beyond the screensize.
  • Loading branch information
kkweon committed Jun 11, 2021
1 parent c30f6af commit 1dd98ce
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 45 deletions.
2 changes: 1 addition & 1 deletion client/lib/screens/detail_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class DetailScreen extends StatelessWidget {
margin: const EdgeInsets.only(top: 5, left: 10, right: 10),
child: Column(
children: [
HeaderWidget(video: args.video),
FittedBox(child: HeaderWidget(video: args.video)),
const SizedBox(height: 10),
getHorizontalLine(),
const SizedBox(height: 10),
Expand Down
87 changes: 43 additions & 44 deletions client/lib/widgets/pr12video.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,56 +12,55 @@ class PR12Video extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Card(
child: Stack(
children: [
ListTile(
key: ValueKey("ListTile-$index"),
leading: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: getCategoryWidgets(video.category)),
title: Text(
video.title,
overflow: TextOverflow.ellipsis,
maxLines: 3,
child: ListTile(
key: ValueKey("ListTile-$index"),
leading: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: getCategoryWidgets(video.category)),
title: Text(
video.title,
overflow: TextOverflow.ellipsis,
maxLines: 3,
),
contentPadding: const EdgeInsets.all(20),
subtitle: Column(
children: [
Row(children: [
Text(
video.presenter,
textAlign: TextAlign.start,
),
]),
const SizedBox(height: 10),
Row(
children: [
Text(
getKeywords(video.keywords),
style: const TextStyle(fontStyle: FontStyle.italic),
overflow: TextOverflow.ellipsis,
),
],
),
subtitle: Padding(
padding: const EdgeInsets.only(top: 10),
child: Row(children: [
Text(
video.presenter,
textAlign: TextAlign.start,
),
const SizedBox(width: 20),
Text(getKeywords(video.keywords),
style: const TextStyle(fontStyle: FontStyle.italic),
overflow: TextOverflow.ellipsis)
])),
onTap: () {
Navigator.pushNamed(
context,
DetailScreen.routeName,
arguments: DetailScreenArguments(video),
);
},
),
const Positioned(
right: 3,
child: Icon(
Icons.bookmark,
size: 30,
color: Colors.blue,
))
],
],
),
onTap: () {
Navigator.pushNamed(
context,
DetailScreen.routeName,
arguments: DetailScreenArguments(video),
);
},
trailing: const Icon(
Icons.bookmark,
size: 23,
color: Colors.blue,
),
));
}
}

String getKeywords(List<String> keywords) {
if (keywords.isEmpty) {
return "";
}

return keywords[0];
return keywords.join(", ");
}

List<Widget> getCategoryWidgets(Category category) {
Expand Down

0 comments on commit 1dd98ce

Please sign in to comment.