I want to run a tag animation horizontal one time only when user want to see detail of product there is a Tag of sale but nothing happen. I've looked all solutions but couldn't solve myself.
This is the GIF,
and this is image of stack I want to move like in gif a line is moving
return SafeArea(
child: Scaffold(
backgroundColor: fBackgroundColor,
appBar: PreferredSize(
preferredSize: const Size.fromHeight(50),
child: subAppBarMain(context)),
body: Column(
children: [
Expanded(
child: ListView(
children: [
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10.0, vertical: 10.0),
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(10.0)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 10.0,
),
Center(
child: Image.asset(
widget.listModel.image!,
),
),
TweenAnimationBuilder(
tween: Tween<double>(
begin: 0.0,
end: MediaQuery.of(context).size.width),
duration: const Duration(milliseconds: 4000),
builder: (context, double i, _) {
return Stack(
children: [
SizedBox(
height: 20,
width: 115,
child: CustomPaint(
painter: PriceTagPaint(),
child: Center(
child: Padding(
padding: const EdgeInsets.only(
right: 16.0),
child: Align(
alignment: Alignment.centerRight,
child: Text(
widget.listModel.sale!,
textAlign: TextAlign.center,
style: const TextStyle(
fontSize: 10,
fontWeight: FontWeight.bold,
color: Colors.white),
),
),
),
),
),
),
Container(
width: 50,
height: 20,
color: Colors.black,
child: const Center(
child: Text(
"SALE",
style: TextStyle(
fontSize: 10,
fontWeight: FontWeight.w500,
color: Colors.white),
),
),
),
],
);
}),
SizedBox(
height: 20,
width: 65,
child: CustomPaint(
painter: ExpressPaint(),
child: Center(
child: Text(
widget.listModel.express!,
style: const TextStyle(
fontSize: 10,
fontWeight: FontWeight.bold,
color: Colors.black),
),
),
),
),
Where I'm making mistake?