import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import '../../../size_config.dart';
class CustomAppBar extends PreferredSize {
final double rating;
const CustomAppBar({Key? key, required this.rating}) : super(key: key);**error appears here**
@override
// AppBar().preferredSize.height provide us the height that apply on our app bar
Size get preferredSize => Size.fromHeight(AppBar().preferredSize.height);
@override
Widget build(BuildContext context) {
return SafeArea(
child: Padding(
padding:
EdgeInsets.symmetric(horizontal: getProportionateScreenWidth(20)),
child: Row(
children: [
SizedBox(
height: getProportionateScreenWidth(40),
width: getProportionateScreenWidth(40),
child: TextButton(
style: TextButton.styleFrom(
padding: EdgeInsets.zero,
textStyle: const TextStyle(
color: Colors.white,
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(60),
),
),
onPressed: () => Navigator.pop(context),
child: SvgPicture.asset(
"assets/icons/Back ICon.svg",
height: 15,
),
),
),
const Spacer(),
Container(
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 5),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(14),
),
child: Row(
children: [
Text(
"$rating",
style: const TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
),
),
const SizedBox(width: 5),
SvgPicture.asset("assets/icons/Star Icon.svg"),
],
),
)
],
),
),
);
}
}
Try adding the required argument but I failed