For a couple of times now I've played around BackDropFilter() in Flutter and it looks like I can't seem to warp my head around how it works or maybe I feel I don't have the power I should have with it, lol. Can you put me in the right direction, please?
I want the backdrop only on the Container but instead, it goes beyond the Container to the cover image.
This image contains what I want
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ClipRRect(
borderRadius: const BorderRadius.only(
bottomLeft: Radius.circular(50),
bottomRight: Radius.circular(50),
),
child: Stack(
children: [
// Featured Image
Hero(
tag: product.id,
child: Container(
height: size.height * 0.6,
decoration: BoxDecoration(
image: DecorationImage(
fit: BoxFit.cover,
image: CachedNetworkImageProvider(
product.featuredImage!,
),
),
),
),
),
// App Bar
SafeArea(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 20,
vertical: 10,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
// Back Button
MenuButton(
onTap: () => Navigator.pop(context),
padding: const EdgeInsets.all(12),
icon: Icon(
Platform.isAndroid
? Ionicons.arrow_back
: CupertinoIcons.back,
color: Constants.iconColor,
),
),
// Add to fav button
MenuButton(
onTap: () {},
padding: const EdgeInsets.all(12),
icon: const Icon(
Ionicons.heart,
color: Constants.iconColor,
),
),
],
),
),
),
Positioned(
bottom: 0,
child: Container(
color: const Color.fromARGB(189, 49, 49, 49),
height: size.height * 0.2,
width: size.width,
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 3.5, sigmaY: 3.5),
child: Row(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
product.title!,
style: Theme.of(context).textTheme.headline4,
),
Text(
product.subtitle!,
style: Theme.of(context)
.textTheme
.headline5!
.copyWith(
fontSize: 16, color: Colors.white54),
),
// Rate
Expanded(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Icon(
Ionicons.star,
color: Constants.mainAppColor,
),
const SizedBox(width: 12),
Text(
product.rate.toString(),
style:
Theme.of(context).textTheme.headline5,
),
const SizedBox(width: 12),
Text(
'(${product.rate})',
style: Theme.of(context)
.textTheme
.headline6!
.copyWith(
color: Colors.white54,
fontSize: 15),
),
],
),
),
],
),
],
),
),
),
),
],
),
),
SizedBox(height: size.height * 0.02),
//
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Description",
style: Theme.of(context).textTheme.headline6!.copyWith(
fontSize: 18, color: Colors.white.withOpacity(0.7)),
),
SizedBox(height: size.height * 0.015),
RichText(
text: TextSpan(
children: [
TextSpan(text: '${product.description!}... '),
const TextSpan(
text: 'Read More',
style: TextStyle(color: Constants.mainAppColor),
),
],
style: Theme.of(context)
.textTheme
.headline6!
.copyWith(fontSize: 16),
),
maxLines: 2,
),
],
),
),
)
],
),