disable_multi_select_button.dart 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import 'package:flutter/material.dart';
  2. import 'package:hooks_riverpod/hooks_riverpod.dart';
  3. class DisableMultiSelectButton extends ConsumerWidget {
  4. const DisableMultiSelectButton({
  5. Key? key,
  6. required this.onPressed,
  7. required this.selectedItemCount,
  8. }) : super(key: key);
  9. final Function onPressed;
  10. final int selectedItemCount;
  11. @override
  12. Widget build(BuildContext context, WidgetRef ref) {
  13. return Positioned(
  14. top: 0,
  15. left: 0,
  16. child: Padding(
  17. padding: const EdgeInsets.only(left: 16.0, top: 46),
  18. child: Material(
  19. elevation: 20,
  20. borderRadius: BorderRadius.circular(35),
  21. child: Container(
  22. decoration: BoxDecoration(
  23. borderRadius: BorderRadius.circular(35),
  24. color: Colors.grey[100],
  25. ),
  26. child: Padding(
  27. padding: const EdgeInsets.symmetric(horizontal: 4.0),
  28. child: TextButton.icon(
  29. onPressed: () {
  30. onPressed();
  31. },
  32. icon: const Icon(Icons.close_rounded),
  33. label: Text(
  34. '$selectedItemCount',
  35. style: const TextStyle(
  36. fontWeight: FontWeight.w600,
  37. fontSize: 18,
  38. ),
  39. ),
  40. ),
  41. ),
  42. ),
  43. ),
  44. ),
  45. );
  46. }
  47. }