sharing_sliver_appbar.dart 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. import 'package:auto_route/auto_route.dart';
  2. import 'package:easy_localization/easy_localization.dart';
  3. import 'package:flutter/material.dart';
  4. import 'package:immich_mobile/routing/router.dart';
  5. class SharingSliverAppBar extends StatelessWidget {
  6. const SharingSliverAppBar({
  7. Key? key,
  8. }) : super(key: key);
  9. @override
  10. Widget build(BuildContext context) {
  11. return SliverAppBar(
  12. centerTitle: true,
  13. floating: false,
  14. pinned: true,
  15. snap: false,
  16. automaticallyImplyLeading: false,
  17. // leading: Container(),
  18. // elevation: 0,
  19. title: Text(
  20. 'IMMICH',
  21. style: TextStyle(
  22. fontFamily: 'SnowburstOne',
  23. fontWeight: FontWeight.bold,
  24. fontSize: 22,
  25. color: Theme.of(context).primaryColor,
  26. ),
  27. ),
  28. bottom: PreferredSize(
  29. preferredSize: const Size.fromHeight(50.0),
  30. child: Padding(
  31. padding: const EdgeInsets.symmetric(horizontal: 12.0),
  32. child: Row(
  33. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  34. children: [
  35. Expanded(
  36. child: Padding(
  37. padding: const EdgeInsets.only(right: 4.0),
  38. child: TextButton.icon(
  39. style: ButtonStyle(
  40. backgroundColor: MaterialStateProperty.all(
  41. Theme.of(context).primaryColor.withAlpha(20)),
  42. // foregroundColor: MaterialStateProperty.all(Colors.white),
  43. ),
  44. onPressed: () {
  45. AutoRouter.of(context)
  46. .push(const CreateSharedAlbumRoute());
  47. },
  48. icon: const Icon(
  49. Icons.photo_album_outlined,
  50. size: 20,
  51. ),
  52. label: const Text(
  53. "sharing_silver_appbar_create_shared_album",
  54. style:
  55. TextStyle(fontWeight: FontWeight.bold, fontSize: 12),
  56. ).tr(),
  57. ),
  58. ),
  59. ),
  60. Expanded(
  61. child: Padding(
  62. padding: const EdgeInsets.only(left: 4.0),
  63. child: TextButton.icon(
  64. style: ButtonStyle(
  65. backgroundColor: MaterialStateProperty.all(
  66. Theme.of(context).primaryColor.withAlpha(20)),
  67. // foregroundColor: MaterialStateProperty.all(Colors.white),
  68. ),
  69. onPressed: null,
  70. icon: const Icon(
  71. Icons.swap_horizontal_circle_outlined,
  72. size: 20,
  73. ),
  74. label: const Text(
  75. "sharing_silver_appbar_share_partner",
  76. style:
  77. TextStyle(fontWeight: FontWeight.bold, fontSize: 12),
  78. ).tr(),
  79. ),
  80. ),
  81. )
  82. ],
  83. ),
  84. ),
  85. ),
  86. );
  87. }
  88. }