From 1dd98ce96b3e6ba075701f8c0f8b3841b3bcce9e Mon Sep 17 00:00:00 2001 From: Mo Kweon Date: Fri, 11 Jun 2021 12:25:39 -0700 Subject: [PATCH] fix: some padding issues It's throwing an error as it's going beyond the screensize. --- client/lib/screens/detail_screen.dart | 2 +- client/lib/widgets/pr12video.dart | 87 +++++++++++++-------------- 2 files changed, 44 insertions(+), 45 deletions(-) diff --git a/client/lib/screens/detail_screen.dart b/client/lib/screens/detail_screen.dart index 24d69ad9..19501607 100644 --- a/client/lib/screens/detail_screen.dart +++ b/client/lib/screens/detail_screen.dart @@ -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), diff --git a/client/lib/widgets/pr12video.dart b/client/lib/widgets/pr12video.dart index 4c2fc38b..52064071 100644 --- a/client/lib/widgets/pr12video.dart +++ b/client/lib/widgets/pr12video.dart @@ -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 keywords) { - if (keywords.isEmpty) { - return ""; - } - - return keywords[0]; + return keywords.join(", "); } List getCategoryWidgets(Category category) {