baseproject
This commit is contained in:
44
base_project/lib/widgets/app_bar/appbar_image.dart
Normal file
44
base_project/lib/widgets/app_bar/appbar_image.dart
Normal file
@@ -0,0 +1,44 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '/widgets/custom_image_view.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class AppbarImage extends StatelessWidget {
|
||||
AppbarImage(
|
||||
{super.key, required this.height,
|
||||
required this.width,
|
||||
this.imagePath,
|
||||
this.svgPath,
|
||||
this.margin,
|
||||
this.onTap});
|
||||
|
||||
double height;
|
||||
|
||||
double width;
|
||||
|
||||
String? imagePath;
|
||||
|
||||
String? svgPath;
|
||||
|
||||
EdgeInsetsGeometry? margin;
|
||||
|
||||
Function? onTap;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
onTap?.call();
|
||||
},
|
||||
child: Padding(
|
||||
padding: margin ?? EdgeInsets.zero,
|
||||
child: CustomImageView(
|
||||
svgPath: svgPath,
|
||||
imagePath: imagePath,
|
||||
height: height,
|
||||
width: width,
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../core/app_export.dart';
|
||||
import '../../utils/image_constant.dart';
|
||||
import '../custom_icon_button.dart'; // ignore: must_be_immutable
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
// ignore_for_file: must_be_immutable
|
||||
class AppbarLeadingIconbutton extends StatelessWidget {
|
||||
AppbarLeadingIconbutton({super.key, this.imagePath, this.margin, this.onTap});
|
||||
|
||||
String? imagePath;
|
||||
|
||||
EdgeInsetsGeometry? margin;
|
||||
|
||||
Function? onTap;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
onTap?.call();
|
||||
},
|
||||
child: Padding(
|
||||
padding: margin ?? EdgeInsets.zero,
|
||||
child: CustomIconButton(
|
||||
height: 32.adaptSize,
|
||||
width: 32.adaptSize,
|
||||
decoration: IconButtonStyleHelper.outlineIndigo,
|
||||
child: CustomImageView(
|
||||
imagePath: ImageConstant.imgArrowleft,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
35
base_project/lib/widgets/app_bar/appbar_title.dart
Normal file
35
base_project/lib/widgets/app_bar/appbar_title.dart
Normal file
@@ -0,0 +1,35 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../utils/color_constants.dart';
|
||||
import '../../theme/app_style.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class AppbarTitle extends StatelessWidget {
|
||||
AppbarTitle({super.key, required this.text, this.margin, this.onTap});
|
||||
|
||||
String text;
|
||||
|
||||
EdgeInsetsGeometry? margin;
|
||||
|
||||
Function? onTap;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
onTap?.call();
|
||||
},
|
||||
child: Padding(
|
||||
padding: margin ?? EdgeInsets.zero,
|
||||
child: Text(
|
||||
text,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
textAlign: TextAlign.left,
|
||||
style: AppStyle.txtGilroySemiBold24.copyWith(
|
||||
color: ColorConstant.blueGray900,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
56
base_project/lib/widgets/app_bar/custom_app_bar.dart
Normal file
56
base_project/lib/widgets/app_bar/custom_app_bar.dart
Normal file
@@ -0,0 +1,56 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../utils/size_utils.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
|
||||
CustomAppBar(
|
||||
{super.key, required this.height,
|
||||
this.leadingWidth,
|
||||
this.leading,
|
||||
this.title,
|
||||
this.bottom,
|
||||
this.flexibleSpace,
|
||||
this.centerTitle,
|
||||
this.actions});
|
||||
|
||||
double height;
|
||||
|
||||
double? leadingWidth;
|
||||
|
||||
Widget? leading;
|
||||
|
||||
Widget? title;
|
||||
|
||||
PreferredSize? flexibleSpace;
|
||||
|
||||
TabBar? bottom;
|
||||
|
||||
bool? centerTitle;
|
||||
|
||||
List<Widget>? actions;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppBar(
|
||||
elevation: 0,
|
||||
toolbarHeight: height,
|
||||
automaticallyImplyLeading: false,
|
||||
backgroundColor: Colors.transparent,
|
||||
leadingWidth: leadingWidth ?? 0,
|
||||
leading: leading,
|
||||
title: title,
|
||||
bottom: bottom,
|
||||
flexibleSpace: flexibleSpace,
|
||||
titleSpacing: 0,
|
||||
centerTitle: centerTitle ?? false,
|
||||
actions: actions,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Size get preferredSize => Size(
|
||||
size.width,
|
||||
height,
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user