import 'package:farm_tpf/utils/const_color.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; class AppBarWidget extends StatelessWidget implements PreferredSizeWidget { final bool isBack; AppBarWidget({this.isBack = true}); @override Widget build(BuildContext context) { return Container( child: AppBar( backgroundColor: Colors.white, elevation: 0, centerTitle: false, title: isBack ? InkWell( child: Row( mainAxisSize: MainAxisSize.min, children: [ Icon( Icons.keyboard_arrow_left, color: AppColors.YELLOW, size: 35, ), Text( 'Quay lại', maxLines: 1, style: TextStyle( color: AppColors.YELLOW, fontWeight: FontWeight.normal), ), ], ), onTap: () { if (Get.isSnackbarOpen) Get.back(); Get.back(); }, ) : SizedBox(), automaticallyImplyLeading: false, ), ); } @override Size get preferredSize => AppBar().preferredSize; }