Files
tm_app/lib/views/shared/tender_app_bar.dart
T
amirrezaghabeli d8fc995804 some refactors
2025-09-01 18:18:46 +03:30

94 lines
2.4 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:tm_app/core/constants/assets.dart';
import 'package:tm_app/core/theme/colors.dart';
import 'package:tm_app/core/utils/size_config.dart';
PreferredSizeWidget tenderMobileAppBar({required String title}) {
return PreferredSize(
preferredSize: const Size.fromHeight(56),
child: AppBar(
backgroundColor: AppColors.backgroundColor,
elevation: 0,
titleSpacing: 0,
automaticallyImplyLeading: false,
actions: [
SvgPicture.asset(AssetsManager.logoSmall),
SizedBox(width: 24.0.w()),
],
title: Padding(
padding: EdgeInsetsDirectional.only(start: 24.0.w()),
child: Text(
title,
style: TextStyle(
color: AppColors.grey70,
fontWeight: FontWeight.w600,
fontSize: 20.0.sp(),
),
),
),
),
);
}
PreferredSizeWidget appBar({
required BuildContext context,
required String title,
}) {
return PreferredSize(
preferredSize: const Size.fromHeight(60),
child: AppBar(
backgroundColor: AppColors.backgroundColor,
elevation: 0,
titleSpacing: 0,
leading: IconButton(
icon: SvgPicture.asset(
AssetsManager.arrowLeft,
height: 24.0.w(),
width: 24.0.w(),
),
onPressed: () => Navigator.pop(context),
),
title: Text(
title,
style: TextStyle(
color: AppColors.grey70,
fontWeight: FontWeight.w600,
fontSize: 20.0.sp(),
),
),
),
);
}
PreferredSizeWidget tabletAppBar({
required String title,
required GlobalKey<ScaffoldState> key,
}) {
return PreferredSize(
preferredSize: const Size.fromHeight(64),
child: AppBar(
backgroundColor: AppColors.backgroundColor,
elevation: 0,
titleSpacing: 0,
leading: Padding(
padding: EdgeInsetsDirectional.only(start: 24.0.w()),
child: SvgPicture.asset(AssetsManager.logoSmall),
),
actions: [
IconButton(
icon: Padding(
padding: EdgeInsetsDirectional.only(end: 24.0.w()),
child: SvgPicture.asset(
AssetsManager.menu,
height: 32.0.w(),
width: 32.0.w(),
),
),
onPressed: () => key.currentState!.openDrawer(),
),
],
),
);
}