app bar deleted

This commit is contained in:
Rajshinde046
2024-04-16 16:41:39 +05:30
parent a67c26f724
commit 487dac014e
2 changed files with 0 additions and 213 deletions

View File

@@ -1,101 +0,0 @@
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 => const Size.fromHeight(70);
const CommonAppbar({
Key? key,
required this.titleTxt,
this.showLeading = true,
this.customActionWidget,
this.onCustomActionPressed,
// this.calendarWidget = true,
required Size preferredSize,
this.showEdit = false,
this.customBack,
this.editPageName,
this.customleading,
}) : super(key: key);
final String titleTxt;
final bool? showLeading;
final Widget? customActionWidget;
final Widget? customleading;
// final bool? calendarWidget;
final VoidCallback? onCustomActionPressed;
final bool? showEdit;
final bool? customBack;
final String? editPageName;
@override
Widget build(BuildContext context) {
return AppBar(
scrolledUnderElevation: 0.0,
backgroundColor: Colors.black,
elevation: 0,
automaticallyImplyLeading: false,
titleSpacing: 0,
title: 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: 'DM Sans',
fontSize: 18.sp,
fontWeight: FontWeight.w500,
color: Color(0xFF090909),
),
),
),
],
),
),
leading: showLeading!
? InkWell(
onTap: () {
Get.back();
},
child: Icon(
Icons.arrow_back,
color: Color(0xFFFFFFFF),
size: 27,
),
)
: customleading,
actions: [
// if (calendarWidget == true)
// InkWell(
// onTap: onCustomActionPressed,
// child: Padding(
// padding: EdgeInsets.only(right: 14.w),
// child: Icon(
// Icons.calendar_month_outlined,
// color: Color(0xFF3192D8),
// size: 28,
// ),
// ),
// ),
if (customActionWidget != null)
InkWell(
onTap: onCustomActionPressed,
child: Padding(
padding: EdgeInsets.only(right: 14.w),
child: customActionWidget,
),
),
],
);
}
}

View File

@@ -1,112 +0,0 @@
// 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';
import 'package:traderscircuit/Utils/text.dart';
class CommonAppbar extends StatelessWidget implements PreferredSizeWidget {
@override
Size get preferredSize => Size.fromHeight(height!);
const CommonAppbar(
{Key? key,
required this.titleTxt,
this.suffixIcon,
this.showLeading = true,
this.customBack,
this.backPageName = '',
this.customActionWidget,
this.onCustomActionPressed,
this.height = 105})
: super(key: key);
final String titleTxt;
final String? suffixIcon;
final bool? showLeading;
final bool? customBack;
final String? backPageName;
final Widget? customActionWidget;
final VoidCallback? onCustomActionPressed;
final double? height;
@override
Widget build(BuildContext context) {
return PreferredSize(
preferredSize: Size.fromHeight(height ?? 130),
child: AppBar(
scrolledUnderElevation: 0.0,
backgroundColor: Colors.black,
elevation: 0,
leadingWidth: 56.w,
leading: Padding(
padding: EdgeInsets.only(left: 16.w, top: 20.h),
child: GestureDetector(
onTap: () {
customBack ?? false ? Get.toNamed(backPageName!) : Get.back();
},
child: Padding(
padding: EdgeInsets.only(left: 8.w),
child: Icon(
Icons.arrow_back_ios,
color: Colors.white,
size: 25.r,
),
),
),
),
flexibleSpace: FlexibleSpaceBar(
centerTitle: false,
titlePadding: EdgeInsets.all(0),
title: Padding(
padding: EdgeInsets.only(left: 16.w, right: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.end,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
titleTxt,
style: TextStyle(
color: Colors.white,
fontSize: 24.sp,
fontWeight: FontWeight.w500,
fontFamily: 'hiragino'),
maxLines: 2,
softWrap: true,
),
],
),
// newTextfield(
// FontWeight.w400, 0)
],
),
),
),
actions: [
// if (calendarWidget == true)
// InkWell(
// onTap: onCustomActionPressed,
// child: Padding(
// padding: EdgeInsets.only(right: 14.w),
// child: Icon(
// Icons.calendar_month_outlined,
// color: Color(0xFF3192D8),
// size: 28,
// ),
// ),
// ),
if (customActionWidget != null)
InkWell(
onTap: onCustomActionPressed,
child: Padding(
padding: EdgeInsets.only(right: 14.w),
child: customActionWidget,
),
),
],
),
);
}
}