Skip to content

Commit

Permalink
Merge pull request #43 from andannn/profile
Browse files Browse the repository at this point in the history
Some change loading widget
  • Loading branch information
andannn authored Oct 26, 2023
2 parents 8430ee6 + 80c1d7c commit 10685d0
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
13 changes: 8 additions & 5 deletions lib/core/design_system/widget/media_preview_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@ class MediaPreviewItem extends StatelessWidget {
this.isFollowing = false,
super.key,
this.width,
this.textStyle});
this.textStyle,
this.titleVerticalPadding = 0});

final VoidCallback onClick;
final double? width;
final TextStyle? textStyle;
final String coverImage;
final String title;
final bool isFollowing;
final double titleVerticalPadding;

@override
Widget build(BuildContext context) {
Expand All @@ -41,17 +43,18 @@ class MediaPreviewItem extends StatelessWidget {
),
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(
padding: EdgeInsets.symmetric(
horizontal: 4.0,
vertical: 4.0,
vertical: titleVerticalPadding,
),
child: Center(
child: Text(
title,
textAlign: TextAlign.center,
style: textStyle?.copyWith(
color:
Theme.of(context).colorScheme.onSurfaceVariant),
color: Theme.of(context)
.colorScheme
.onSurfaceVariant),
maxLines: 2,
softWrap: true,
),
Expand Down
6 changes: 5 additions & 1 deletion lib/feature/discover/discover.dart
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ class _MediaCategoryPreview extends StatelessWidget {
coverImage: model.coverImage,
title: model.title!.getLocalTitle(context),
isFollowing: model.isFollowing,
titleVerticalPadding: 5,
onClick: () => onAnimeClick?.call(model.id),
);
}
Expand All @@ -170,7 +171,10 @@ class _MediaCategoryPreview extends StatelessWidget {
const SizedBox(height: 4),
Container(
child: isLoading && animeModels.isEmpty
? _buildLoadingDummyWidget()
? Container(
constraints: const BoxConstraints(maxHeight: 260),
child: _buildLoadingDummyWidget(),
)
: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Padding(
Expand Down
2 changes: 1 addition & 1 deletion lib/feature/media_page/media_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class _MediaListPageContent extends StatelessWidget {
pagingState: pagingState,
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
childAspectRatio: 3.0 / 5.0,
childAspectRatio: 3.0 / 5.2,
),
onBuildItem: (context, model) => _buildGridItems(context, model),
onRequestNewPage: () {
Expand Down
2 changes: 1 addition & 1 deletion lib/feature/profile/sub_favorite/profile_favorite.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class _ProfileFavoriteTabPageState extends State<ProfileFavoriteTabPage> {
itemCount: items.length,
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
childAspectRatio: 3.0 / 5.0,
childAspectRatio: 3.0 / 5.2,
),
itemBuilder: (context, index) {
return _buildGridItems(context, type, items[index]);
Expand Down

0 comments on commit 10685d0

Please sign in to comment.