Files
Regroup/lib/Utils/Common/CommonAppbar.dart
2024-08-01 13:35:58 +05:30

268 lines
8.3 KiB
Dart

// // ignore_for_file: non_constant_identifier_names, file_names, prefer_const_constructors
// import 'package:flutter/material.dart';
// import 'package:flutter_screenutil/flutter_screenutil.dart';
// import 'package:get/get.dart';
// class CommonAppbar extends StatelessWidget implements PreferredSizeWidget {
// @override
// Size get preferredSize => Size.fromHeight(90);
// const CommonAppbar({
// Key? key,
// required this.titleTxt,
// this.showLeading = true,
// this.customBack,
// this.profileverifyback,
// this.backPageName = '',
// // this.height = 105
// }) : super(key: key);
// final String titleTxt;
// final bool? showLeading;
// final bool? customBack;
// import 'package:flutter/material.dart';
// import 'package:flutter_screenutil/flutter_screenutil.dart';
// import 'package:get/get.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:regroup/Common/CommonGlassmorphism.dart';
import 'package:regroup/Utils/Common/sized_box.dart';
class CommonAppbar extends StatelessWidget implements PreferredSizeWidget {
@override
Size get preferredSize => Size.fromHeight(height);
const CommonAppbar({
Key? key,
required this.titleTxt,
this.showLeading = true,
this.customActionWidget,
this.onCustomActionPressed,
this.showEdit = false,
this.customBack,
this.editPageName,
this.height = 80,
}) : super(key: key);
final String titleTxt;
final bool? showLeading;
final Widget? customActionWidget;
final VoidCallback? onCustomActionPressed;
final bool? showEdit;
final bool? customBack;
final String? editPageName;
final double height;
@override
Widget build(BuildContext context) {
return PreferredSize(
preferredSize: Size.fromHeight(80),
child: AppBar(
scrolledUnderElevation: 0.0,
backgroundColor: Color(0xFF222935).withOpacity(0.50),
elevation: 0,
automaticallyImplyLeading: false,
titleSpacing: 0,
title: showLeading!
? Padding(
padding: EdgeInsets.only(left: 16.w, right: 16.w, top: 10.h),
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Text(
titleTxt,
softWrap: true,
overflow: TextOverflow.visible,
textAlign: TextAlign.start,
style: TextStyle(
fontFamily: 'Helvetica',
fontSize: 20.sp,
fontWeight: FontWeight.w400,
color: Color(0xFFFCFCFC),
),
),
),
],
),
),
)
: SingleChildScrollView(
scrollDirection: Axis.horizontal,
padding: EdgeInsets.only(top: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Text(
titleTxt,
softWrap: true,
overflow: TextOverflow.visible,
textAlign: TextAlign.start,
style: TextStyle(
fontFamily: 'Helvetica',
fontSize: 20.sp,
fontWeight: FontWeight.w400,
color: Color(0xFFFCFCFC),
),
),
),
],
),
),
leading: showLeading!
? Padding(
padding: EdgeInsets.only(top: 10.h),
child: InkWell(
onTap: () {
Get.back();
},
child: Row(
children: [
sizedBoxWidth(10.w),
commonGlassUI(
borderwidth: 0.5,
width: 40.w,
height: 40.h,
borderRadius: BorderRadius.circular(100),
opacity1: 0.24,
opacity2: 0.24,
customWidget: Center(
child: Image.asset(
'assets/images/png/ph_arrow-up-thin.png',
height: 25.h,
width: 25.w,
)
// Icon(
// Icons.arrow_back,
// color: Colors.white,
// size: 20.sp,
// ),
),
),
],
)),
)
: null,
actions: [
if (customActionWidget != null)
InkWell(
onTap: onCustomActionPressed,
child: Padding(
padding: EdgeInsets.only(right: 14.w),
child: customActionWidget,
),
),
],
),
);
}
}
// class CommonAppbar extends StatelessWidget implements PreferredSizeWidget {
// @override
// Size get preferredSize => Size.fromHeight(height);
// const CommonAppbar(
// {Key? key,
// required this.titleTxt,
// this.showLeading = true,
// this.customBack,
// this.aifBack,
// this.profileverifyback,
// this.backPageName = '',
// this.height = 80})
// : super(key: key);
// final String titleTxt;
// final bool? showLeading;
// final bool? customBack;
// final bool? aifBack;
// final String? backPageName;
// final double height;
// final bool? profileverifyback;
// @override
// Widget build(BuildContext context) {
// return PreferredSize(
// preferredSize: Size.fromHeight(130),
// child: AppBar(
// scrolledUnderElevation: 0.0,
// backgroundColor: Color(0xFF222935),
// elevation: 0,
// leadingWidth: 56.w,
// leading: Padding(
// padding: EdgeInsets.only(left: 16.w, top: 20.h),
// child: GestureDetector(
// onTap: () {
// Get.back();
// },
// child: Container(
// height: 40.h,
// width: 40.w,
// decoration: const BoxDecoration(
// color: Color(0xFFFFE3BF),
// shape: BoxShape.circle,
// ),
// child: Padding(
// padding: EdgeInsets.only(left: 8.w),
// child: Icon(
// Icons.arrow_back_ios,
// color: Colors.black,
// size: 25.r,
// ),
// ),
// ),
// ),
// ),
// flexibleSpace: FlexibleSpaceBar(
// titlePadding: EdgeInsets.all(0),
// title: Padding(
// padding: EdgeInsets.only(left: 16.w),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisAlignment: MainAxisAlignment.end,
// children: [
// Text(
// titleTxt,
// style: TextStyle(
// color: Color(0xFF1A1A1A),
// fontSize: 22,
// fontFamily: 'Georgia'),
// maxLines: 2,
// softWrap: true,
// ),
// // newTextfield(
// // FontWeight.w400, 0)
// ],
// ),
// ),
// ),
// ),
// );
// }
// }