You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.3KB

  1. import 'package:farm_tpf/utils/const_color.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:get/get.dart';
  4. class AppBarWidget extends StatelessWidget implements PreferredSizeWidget {
  5. final bool isBack;
  6. AppBarWidget({this.isBack = true});
  7. @override
  8. Widget build(BuildContext context) {
  9. return Container(
  10. child: AppBar(
  11. backgroundColor: Colors.white,
  12. elevation: 0,
  13. centerTitle: false,
  14. title: isBack
  15. ? InkWell(
  16. child: Row(
  17. mainAxisSize: MainAxisSize.min,
  18. children: [
  19. Icon(
  20. Icons.keyboard_arrow_left,
  21. color: AppColors.YELLOW,
  22. size: 35,
  23. ),
  24. Text(
  25. 'Quay lại',
  26. maxLines: 1,
  27. style: TextStyle(
  28. color: AppColors.YELLOW,
  29. fontWeight: FontWeight.normal),
  30. ),
  31. ],
  32. ),
  33. onTap: () {
  34. if (Get.isSnackbarOpen) Get.back();
  35. Get.back();
  36. },
  37. )
  38. : SizedBox(),
  39. automaticallyImplyLeading: false,
  40. ),
  41. );
  42. }
  43. @override
  44. Size get preferredSize => AppBar().preferredSize;
  45. }