Wallpaper-Genie/lib/common/components/navigation_bar/nested_bottom_bar.dart
fengshengxiong 5b152f66ee 1
2024-07-14 18:48:07 -07:00

65 lines
1.9 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:wallpaperx/applovin_max/applovin_manage.dart';
import 'package:wallpaperx/res/themes/app_colors.dart';
class NestedBottomBar extends StatelessWidget implements PreferredSizeWidget {
const NestedBottomBar(
this.title, {
super.key,
this.backgroundColor,
this.backWidget,
this.titleStyle,
this.onBackTap,
});
final Color? backgroundColor;
final Widget? backWidget;
final String title;
final TextStyle? titleStyle;
final Function()? onBackTap;
@override
Widget build(BuildContext context) {
return Container(
height: preferredSize.height,
padding: EdgeInsets.fromLTRB(16, ScreenUtil().statusBarHeight, 16, 0).w,
color: backgroundColor ?? seedColor,
child: Row(
children: [
Expanded(
child: Text(
title,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: titleStyle ??
TextStyle(
color: Colors.black,
fontSize: 20.sp,
fontWeight: FontWeight.w500,
),
),
),
backWidget ??
ClipOval(
child: Material(
color: Colors.transparent,
child: InkWell(
onTap: onBackTap ?? () {
Get.back();
// ApplovinManage().showAdIfReady(ApplovinManage().adUnitId3);
},
child: Icon(Icons.close,color: Colors.white,size: 24.sp),
),
),
),
],
),
);
}
@override
Size get preferredSize => Size.fromHeight(ScreenUtil().statusBarHeight + kToolbarHeight);
}