You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hmg_nurses/lib/widgets/app_bar_widget.dart

49 lines
1.5 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:hmg_nurses/classes/colors.dart';
import 'package:hmg_nurses/config/routes.dart';
import 'package:hmg_nurses/extensions/int_extensions.dart';
import 'package:hmg_nurses/extensions/string_extensions.dart';
import 'package:hmg_nurses/extensions/widget_extensions.dart';
AppBar AppBarWidget(
BuildContext context, {
required String title,
String? image,
bool isNeedLeading = true,
List<Widget>? actions,
}) {
return AppBar(
leadingWidth: 0,
// leading: GestureDetector(
// behavior: HitTestBehavior.opaque,
// onTap: Feedback.wrapForTap(() => Navigator.maybePop(context), context),
// child: const Icon(Icons.arrow_back_ios, color: MyColors.darkIconColor),
// ),
//titleSpacing: -1.44,
title: Row(
children: [
if (isNeedLeading)
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: Feedback.wrapForTap(() => Navigator.maybePop(context), context),
child: const Icon(Icons.arrow_back_ios, color: MyColors.darkIconColor),
),
4.width,
if (image != null)
SvgPicture.asset(
image,
height: 40,
width: 40,
),
if (image != null) 14.width,
title.toText16(color: MyColors.darkTextColor, isBold: true).expanded,
],
),
centerTitle: false,
elevation: 0,
backgroundColor: Colors.white,
actions: actions,
);
}