Files
tm_app/lib/views/shared/tablet_desktop_appbar.dart
T
amirrezaghabeli 5689e98a43 refactors on codes
2025-09-18 10:27:16 +03:30

56 lines
1.4 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:go_router/go_router.dart';
import 'package:tm_app/core/utils/size_config.dart';
import '../../core/constants/assets.dart';
import '../../core/theme/colors.dart';
class TabletDesktopAppbar extends StatelessWidget {
const TabletDesktopAppbar({
required this.title,
this.haveFilter,
this.onFilterPressed,
super.key,
});
final String title;
final bool? haveFilter;
final VoidCallback? onFilterPressed;
@override
Widget build(BuildContext context) {
final isRtl = Directionality.of(context) == TextDirection.rtl;
return Row(
children: [
InkWell(
borderRadius: BorderRadius.circular(8),
onTap: () => context.pop(),
child: SvgPicture.asset(
isRtl ? AssetsManager.arrowRight : AssetsManager.arrowLeft,
),
),
SizedBox(width: 8.0.w()),
Text(
title,
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w600,
color: AppColors.grey70,
),
),
const Spacer(),
if (haveFilter == true)
IconButton(
icon: SvgPicture.asset(
AssetsManager.filter,
height: 24.0.w(),
width: 24.0.w(),
),
onPressed: onFilterPressed,
),
],
);
}
}