file_info_collection_widget.dart 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import 'package:flutter/material.dart';
  2. import 'package:photos/ente_theme_data.dart';
  3. class FileInfoCollectionWidget extends StatelessWidget {
  4. final String? name;
  5. final Function? onTap;
  6. const FileInfoCollectionWidget({this.name, this.onTap, Key? key})
  7. : super(key: key);
  8. @override
  9. Widget build(BuildContext context) {
  10. return GestureDetector(
  11. onTap: onTap as void Function()?,
  12. child: Container(
  13. margin: const EdgeInsets.only(
  14. top: 10,
  15. bottom: 18,
  16. right: 8,
  17. ),
  18. decoration: BoxDecoration(
  19. color: Theme.of(context)
  20. .colorScheme
  21. .inverseBackgroundColor
  22. .withOpacity(0.025),
  23. borderRadius: const BorderRadius.all(
  24. Radius.circular(8),
  25. ),
  26. ),
  27. child: Center(
  28. child: Padding(
  29. padding: const EdgeInsets.symmetric(horizontal: 8),
  30. child: Text(
  31. name!,
  32. style: Theme.of(context).textTheme.subtitle2,
  33. overflow: TextOverflow.ellipsis,
  34. ),
  35. ),
  36. ),
  37. ),
  38. );
  39. }
  40. }