sharing_sliver_appbar.dart 2.9 KB

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