file_icons_widget.dart 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. import 'package:flutter/material.dart';
  2. import 'package:photos/ente_theme_data.dart';
  3. import 'package:photos/models/trash_file.dart';
  4. import 'package:photos/utils/date_time_util.dart';
  5. class ThumbnailPlaceHolder extends StatelessWidget {
  6. const ThumbnailPlaceHolder({Key key}) : super(key: key);
  7. @override
  8. Widget build(BuildContext context) {
  9. // debugPrint("building placeHolder for thumbnail");
  10. return Container(
  11. alignment: Alignment.center,
  12. color: Theme.of(context).colorScheme.galleryThumbBackgroundColor,
  13. );
  14. }
  15. }
  16. class UnSyncedIcon extends StatelessWidget {
  17. const UnSyncedIcon({Key key}) : super(key: key);
  18. @override
  19. Widget build(BuildContext context) {
  20. return Container(
  21. decoration: BoxDecoration(
  22. gradient: LinearGradient(
  23. begin: Alignment.topCenter,
  24. end: Alignment.bottomCenter,
  25. colors: [
  26. Colors.transparent,
  27. Colors.black.withOpacity(0.6),
  28. ],
  29. stops: const [0.75, 1],
  30. ),
  31. ),
  32. child: Align(
  33. alignment: Alignment.bottomRight,
  34. child: Padding(
  35. padding: const EdgeInsets.only(right: 8, bottom: 4),
  36. child: Icon(
  37. Icons.cloud_off_outlined,
  38. size: 18,
  39. color: Colors.white.withOpacity(0.9),
  40. ),
  41. ),
  42. ),
  43. );
  44. }
  45. }
  46. class VideoOverlayIcon extends StatelessWidget {
  47. const VideoOverlayIcon({Key key}) : super(key: key);
  48. @override
  49. Widget build(BuildContext context) {
  50. return const SizedBox(
  51. height: 64,
  52. child: Icon(
  53. Icons.play_circle_outline,
  54. size: 40,
  55. color: Colors.white70,
  56. ),
  57. );
  58. }
  59. }
  60. class LivePhotoOverlayIcon extends StatelessWidget {
  61. const LivePhotoOverlayIcon({Key key}) : super(key: key);
  62. @override
  63. Widget build(BuildContext context) {
  64. return Align(
  65. alignment: Alignment.topRight,
  66. child: Padding(
  67. padding: const EdgeInsets.only(right: 8, top: 4),
  68. child: Icon(
  69. Icons.wb_sunny_outlined,
  70. size: 14,
  71. color: Colors.white.withOpacity(0.9),
  72. ),
  73. ),
  74. );
  75. }
  76. }
  77. class TrashedFileOverlayText extends StatelessWidget {
  78. final TrashFile file;
  79. const TrashedFileOverlayText(this.file, {Key key}) : super(key: key);
  80. @override
  81. Widget build(BuildContext context) {
  82. return Container(
  83. decoration: BoxDecoration(
  84. gradient: LinearGradient(
  85. begin: Alignment.bottomCenter,
  86. end: Alignment.topCenter,
  87. colors: [Colors.black.withOpacity(0.33), Colors.transparent],
  88. ),
  89. ),
  90. alignment: Alignment.bottomCenter,
  91. padding: const EdgeInsets.only(bottom: 5),
  92. child: Text(
  93. daysLeft(file.deleteBy),
  94. style: Theme.of(context)
  95. .textTheme
  96. .subtitle2
  97. .copyWith(color: Colors.white), //same for both themes
  98. ),
  99. );
  100. }
  101. }
  102. class ArchiveOverlayIcon extends StatelessWidget {
  103. const ArchiveOverlayIcon({Key key}) : super(key: key);
  104. @override
  105. Widget build(BuildContext context) {
  106. return Align(
  107. alignment: Alignment.bottomRight,
  108. child: Padding(
  109. padding: const EdgeInsets.only(right: 8, bottom: 8),
  110. child: Icon(
  111. Icons.visibility_off,
  112. size: 24,
  113. color: Colors.white.withOpacity(0.9),
  114. ),
  115. ),
  116. );
  117. }
  118. }