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.

45 lines
1.2KB

  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: InkWell(
  15. child: Row(
  16. mainAxisSize: MainAxisSize.min,
  17. children: [
  18. Icon(
  19. Icons.keyboard_arrow_left,
  20. color: AppColors.YELLOW,
  21. size: 35,
  22. ),
  23. Text(
  24. 'Quay lại',
  25. maxLines: 1,
  26. style: TextStyle(
  27. color: AppColors.YELLOW, fontWeight: FontWeight.normal),
  28. ),
  29. ],
  30. ),
  31. onTap: () {
  32. if (Get.isSnackbarOpen) Get.back();
  33. Get.back();
  34. },
  35. ),
  36. automaticallyImplyLeading: false,
  37. ),
  38. );
  39. }
  40. @override
  41. Size get preferredSize => AppBar().preferredSize;
  42. }