This commit is contained in:
2025-01-28 19:05:19 +05:30
parent b9cd807bbc
commit 3121e0ee36
24 changed files with 1347 additions and 1446 deletions

View File

@@ -1,8 +1,10 @@
import 'package:flutter/material.dart';
import 'package:grocery_app/src/common_widget/network_image.dart';
import 'package:grocery_app/src/data/product_model.dart';
import 'package:grocery_app/src/ui/header.dart';
import 'package:grocery_app/src/ui/widgets/custom_title.dart';
import 'package:grocery_app/utils/constants/color_constant.dart';
import 'package:grocery_app/utils/extensions/uicontext.dart';
class FavouriteScreen extends StatefulWidget {
@override
@@ -37,117 +39,126 @@ class _FavouriteScreenState extends State<FavouriteScreen>
@override
Widget build(BuildContext context) {
return Column(
children: [
CustomTitle(title: 'Favourite'),
Expanded(
child: ListView.separated(
itemCount: _favProducts.length,
shrinkWrap: true,
padding: const EdgeInsets.all(16),
itemBuilder: (_, index)
{
_animation = Tween<double>(begin: 0.0, end: 1.0).animate(
CurvedAnimation(
parent: _animationController,
curve: Interval(
(0.5 / _favProducts.length) * index,
1,
curve: Curves.easeOut,
),
),
);
_animationController.forward(from: 0);
return AnimatedBuilder(
animation: _animationController,
builder: (_, child) {
return FadeTransition(
opacity: _animation,
child: Transform(
transform: Matrix4.translationValues(
0.0,
50 * (1.0 - _animation.value),
0.0,
return SafeArea(
child: Scaffold(
body: Padding(
padding: context.bodyAllPadding.copyWith(
top: 0,
),
child: Column(
children: [
Header(),
// CustomTitle(title: 'Favourite'),
Expanded(
child: ListView.separated(
itemCount: _favProducts.length,
shrinkWrap: true,
padding: const EdgeInsets.all(16),
itemBuilder: (_, index) {
_animation = Tween<double>(begin: 0.0, end: 1.0).animate(
CurvedAnimation(
parent: _animationController,
curve: Interval(
(0.5 / _favProducts.length) * index,
1,
curve: Curves.easeOut,
),
),
child: child,
),
);
},
child: ListTile(
onTap: () {},
leading: Container(
decoration: BoxDecoration(
color: Colors.greenAccent.withOpacity(0.1),
borderRadius: BorderRadius.circular(5),
),
child: AppNetworkImage(
height: 80,
width: 80,
imageUrl:
'https://i.pinimg.com/originals/a5/f3/5f/a5f35fb23e942809da3df91b23718e8d.png',
backGroundColor: APPCOLOR.bgGrey,
radius: 10,
),
),
// Image.asset(_favProducts[index].productImage),
title: Text(_favProducts[index].productName),
subtitle: Text(_favProducts[index].quantity),
trailing: Row(
mainAxisSize: MainAxisSize.min,
children: [
Text(_favProducts[index].amount),
Icon(
Icons.navigate_next_rounded,
size: 32,
color: APPCOLOR.gray,
)
],
),
),
);
},
separatorBuilder: (_, index) {
_animation = Tween<double>(begin: 0.0, end: 1.0).animate(
CurvedAnimation(
parent: _animationController,
curve: Interval(
(0.5 / _favProducts.length) * index,
1,
curve: Curves.easeOut,
),
),
);
_animationController.forward(from: 0);
return AnimatedBuilder(
animation: _animationController,
builder: (_, child) {
return FadeTransition(
opacity: _animation,
child: Transform(
transform: Matrix4.translationValues(
0.0,
50 * (1.0 - _animation.value),
0.0,
);
_animationController.forward(from: 0);
return AnimatedBuilder(
animation: _animationController,
builder: (_, child) {
return FadeTransition(
opacity: _animation,
child: Transform(
transform: Matrix4.translationValues(
0.0,
50 * (1.0 - _animation.value),
0.0,
),
child: child,
),
);
},
child: ListTile(
onTap: () {},
leading: Container(
decoration: BoxDecoration(
color: Colors.greenAccent.withOpacity(0.1),
borderRadius: BorderRadius.circular(5),
),
child: AppNetworkImage(
height: 80,
width: 80,
imageUrl:
'https://i.pinimg.com/originals/a5/f3/5f/a5f35fb23e942809da3df91b23718e8d.png',
backGroundColor: APPCOLOR.bgGrey,
radius: 10,
),
),
// Image.asset(_favProducts[index].productImage),
title: Text(_favProducts[index].productName),
subtitle: Text(_favProducts[index].quantity),
trailing: Row(
mainAxisSize: MainAxisSize.min,
children: [
Text(_favProducts[index].amount),
Icon(
Icons.navigate_next_rounded,
size: 32,
color: APPCOLOR.gray,
)
],
),
),
child: child,
),
);
},
child: Divider(),
);
},
);
},
separatorBuilder: (_, index) {
_animation = Tween<double>(begin: 0.0, end: 1.0).animate(
CurvedAnimation(
parent: _animationController,
curve: Interval(
(0.5 / _favProducts.length) * index,
1,
curve: Curves.easeOut,
),
),
);
_animationController.forward(from: 0);
return AnimatedBuilder(
animation: _animationController,
builder: (_, child) {
return FadeTransition(
opacity: _animation,
child: Transform(
transform: Matrix4.translationValues(
0.0,
50 * (1.0 - _animation.value),
0.0,
),
child: child,
),
);
},
child: Divider(),
);
},
),
),
// Padding(
// padding:
// const EdgeInsets.only(left: 16, right: 16, top: 16, bottom: 78),
// child: NectarButton(
// onPressed: () {},
// text: 'Add All To Cart',
// ),
// ),
],
),
),
// Padding(
// padding:
// const EdgeInsets.only(left: 16, right: 16, top: 16, bottom: 78),
// child: NectarButton(
// onPressed: () {},
// text: 'Add All To Cart',
// ),
// ),
],
),
);
}
}