top_control_app_bar.dart 1.6 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}) : super(key: key);
  6. final ImmichAsset asset;
  7. @override
  8. Widget build(BuildContext context) {
  9. double iconSize = 18.0;
  10. return AppBar(
  11. foregroundColor: Colors.grey[100],
  12. toolbarHeight: 60,
  13. backgroundColor: Colors.black,
  14. leading: IconButton(
  15. onPressed: () {
  16. AutoRouter.of(context).pop();
  17. },
  18. icon: const Icon(
  19. Icons.arrow_back_ios_new_rounded,
  20. size: 20.0,
  21. ),
  22. ),
  23. actions: [
  24. IconButton(
  25. iconSize: iconSize,
  26. splashRadius: iconSize,
  27. onPressed: () {
  28. print("backup");
  29. },
  30. icon: const Icon(Icons.backup_outlined),
  31. ),
  32. IconButton(
  33. iconSize: iconSize,
  34. splashRadius: iconSize,
  35. onPressed: () {
  36. print("favorite");
  37. },
  38. icon: asset.isFavorite ? const Icon(Icons.favorite_rounded) : const Icon(Icons.favorite_border_rounded),
  39. ),
  40. IconButton(
  41. iconSize: iconSize,
  42. splashRadius: iconSize,
  43. onPressed: () {
  44. print("show modal");
  45. },
  46. icon: const Icon(Icons.more_horiz_rounded))
  47. ],
  48. );
  49. }
  50. @override
  51. Size get preferredSize => const Size.fromHeight(kToolbarHeight);
  52. }