-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Set up album services * Album support * test * Implement album support * Update dependencies * Improvement * Fix google drive album thumbnail load * Fix google drive album thumbnail * Add preview on albums * Album screen * Album preview * test * Fix pop error * Fix hero animation * Add new selection menu * Add new selection menu * push build * publish build * Minor fix * Album support * Album improvement * Album support * Dispose unused streams * Update home list issue --------- Co-authored-by: Sneha Canopas <[email protected]>
- Loading branch information
1 parent
53b9c31
commit 8bc55ec
Showing
62 changed files
with
5,531 additions
and
406 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
import 'package:data/models/media/media.dart'; | ||
import 'package:flutter/cupertino.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:style/extensions/context_extensions.dart'; | ||
import 'package:style/text/app_text_style.dart'; | ||
import '../domain/formatter/duration_formatter.dart'; | ||
import 'thumbnail_builder.dart'; | ||
|
||
class AppMediaThumbnail extends StatelessWidget { | ||
final AppMedia media; | ||
final String heroTag; | ||
final void Function()? onTap; | ||
final void Function()? onLongTap; | ||
final bool selected; | ||
|
||
const AppMediaThumbnail({ | ||
super.key, | ||
required this.media, | ||
required this.heroTag, | ||
this.onTap, | ||
this.onLongTap, | ||
this.selected = false, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return LayoutBuilder( | ||
builder: (context, constraints) => GestureDetector( | ||
onTap: onTap, | ||
onLongPress: onLongTap, | ||
child: Stack( | ||
alignment: Alignment.bottomLeft, | ||
children: [ | ||
AnimatedOpacity( | ||
curve: Curves.easeInOut, | ||
duration: const Duration(milliseconds: 100), | ||
opacity: selected ? 0.6 : 1, | ||
child: AppMediaImage( | ||
radius: selected ? 4 : 0, | ||
size: constraints.biggest, | ||
media: media, | ||
heroTag: heroTag, | ||
), | ||
), | ||
if (media.type.isVideo) _videoDuration(context), | ||
if (selected) | ||
Align( | ||
alignment: Alignment.topLeft, | ||
child: Container( | ||
margin: const EdgeInsets.all(4), | ||
padding: const EdgeInsets.all(4), | ||
decoration: BoxDecoration( | ||
shape: BoxShape.circle, | ||
color: context.colorScheme.primary, | ||
), | ||
child: const Icon( | ||
CupertinoIcons.checkmark_alt, | ||
color: Colors.white, | ||
size: 14, | ||
), | ||
), | ||
), | ||
], | ||
), | ||
), | ||
); | ||
} | ||
|
||
Widget _videoDuration(BuildContext context) => Align( | ||
alignment: Alignment.topCenter, | ||
child: Container( | ||
decoration: BoxDecoration( | ||
gradient: LinearGradient( | ||
stops: [0.0, 0.9], | ||
begin: Alignment.topRight, | ||
end: Alignment.bottomRight, | ||
colors: [ | ||
Colors.black.withValues(alpha: 0.4), | ||
Colors.transparent, | ||
], | ||
), | ||
), | ||
padding: const EdgeInsets.all(4).copyWith(bottom: 8), | ||
child: Row( | ||
mainAxisAlignment: MainAxisAlignment.end, | ||
children: [ | ||
Text( | ||
(media.videoDuration ?? Duration.zero).format, | ||
style: AppTextStyles.caption.copyWith( | ||
color: Colors.white, | ||
fontSize: 12, | ||
shadows: [ | ||
Shadow( | ||
color: Colors.grey.shade400, | ||
blurRadius: 5, | ||
), | ||
], | ||
), | ||
), | ||
const SizedBox(width: 2), | ||
Icon( | ||
CupertinoIcons.play_fill, | ||
color: Colors.white, | ||
size: 14, | ||
shadows: [ | ||
Shadow( | ||
color: Colors.grey.shade400, | ||
blurRadius: 5, | ||
), | ||
], | ||
), | ||
], | ||
), | ||
), | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.