top_control_app_bar.dart 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. import 'package:auto_route/auto_route.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:immich_mobile/shared/models/immich_asset.model.dart';
  4. class TopControlAppBar extends StatelessWidget with PreferredSizeWidget {
  5. const TopControlAppBar({Key? key, required this.asset, required this.onMoreInfoPressed}) : super(key: key);
  6. final ImmichAsset asset;
  7. final Function onMoreInfoPressed;
  8. @override
  9. Widget build(BuildContext context) {
  10. double iconSize = 18.0;
  11. return AppBar(
  12. foregroundColor: Colors.grey[100],
  13. toolbarHeight: 60,
  14. backgroundColor: Colors.black,
  15. leading: IconButton(
  16. onPressed: () {
  17. AutoRouter.of(context).pop();
  18. },
  19. icon: const Icon(
  20. Icons.arrow_back_ios_new_rounded,
  21. size: 20.0,
  22. ),
  23. ),
  24. actions: [
  25. IconButton(
  26. iconSize: iconSize,
  27. splashRadius: iconSize,
  28. onPressed: () {
  29. print("backup");
  30. },
  31. icon: const Icon(Icons.backup_outlined),
  32. ),
  33. IconButton(
  34. iconSize: iconSize,
  35. splashRadius: iconSize,
  36. onPressed: () {
  37. print("favorite");
  38. },
  39. icon: asset.isFavorite ? const Icon(Icons.favorite_rounded) : const Icon(Icons.favorite_border_rounded),
  40. ),
  41. IconButton(
  42. iconSize: iconSize,
  43. splashRadius: iconSize,
  44. onPressed: () {
  45. onMoreInfoPressed();
  46. },
  47. icon: const Icon(Icons.more_horiz_rounded))
  48. ],
  49. );
  50. }
  51. @override
  52. Size get preferredSize => const Size.fromHeight(kToolbarHeight);
  53. }