Skip to content

Commit

Permalink
Chore: uiUpdate has been merged and tested locally
Browse files Browse the repository at this point in the history
  • Loading branch information
Divyakumar21202 committed Aug 24, 2024
1 parent 3fafd61 commit 4787844
Show file tree
Hide file tree
Showing 8 changed files with 392 additions and 84 deletions.
6 changes: 6 additions & 0 deletions assets/svg_image/isVeg.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
130 changes: 68 additions & 62 deletions lib/Global/widgets/custom_list_tile.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:mess_mgmt/Global/models/coupon_data_model.dart';
import 'package:mess_mgmt/Global/widgets/my_list_tile.dart';

class GlassyListTile extends StatelessWidget {
final CouponDataModel coupon;
Expand All @@ -10,68 +11,73 @@ class GlassyListTile extends StatelessWidget {
required this.coupon,
required this.i,
});

@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(8.0),
child: Card(
color: Colors.blueAccent,
elevation: 5,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
),
child: Container(
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.2),
borderRadius: BorderRadius.circular(20),
border: Border.all(
color: Colors.white.withOpacity(0.3),
width: 1.5,
),
),
child: ListTile(
contentPadding:
const EdgeInsets.symmetric(vertical: 10.0, horizontal: 20.0),
title: Text(
coupon.createdBy?.fName ?? '',
style: const TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 18,
),
),
subtitle: Text(
"Floor: ${coupon.couponFloor}",
style: const TextStyle(
color: Colors.white70,
),
),
trailing: Column(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"Rs ${coupon.price}",
style: const TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 16,
),
),
const SizedBox(height: 5),
Text(
coupon.isVeg ? 'Veg' : 'Non-Veg',
style: const TextStyle(
color: Colors.white70,
fontSize: 14,
),
),
],
),
),
),
),
);
return MyListTile(coupon: coupon);
}
}

// @override
// Widget build(BuildContext context) {
// return Padding(
// padding: const EdgeInsets.all(8.0),
// child: Card(
// color: Colors.blueAccent,
// elevation: 5,
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(20),
// ),
// child: Container(
// decoration: BoxDecoration(
// color: Colors.white.withOpacity(0.2),
// borderRadius: BorderRadius.circular(20),
// border: Border.all(
// color: Colors.white.withOpacity(0.3),
// width: 1.5,
// ),
// ),
// child: ListTile(
// contentPadding:
// const EdgeInsets.symmetric(vertical: 10.0, horizontal: 20.0),
// title: Text(
// coupon.createdBy?.fName ?? '',
// style: const TextStyle(
// color: Colors.white,
// fontWeight: FontWeight.bold,
// fontSize: 18,
// ),
// ),
// subtitle: Text(
// "Floor: ${coupon.couponFloor}",
// style: const TextStyle(
// color: Colors.white70,
// ),
// ),
// trailing: Column(
// crossAxisAlignment: CrossAxisAlignment.end,
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// Text(
// "Rs ${coupon.price}",
// style: const TextStyle(
// color: Colors.white,
// fontWeight: FontWeight.bold,
// fontSize: 16,
// ),
// ),
// const SizedBox(height: 5),
// Text(
// coupon.isVeg ? 'Veg' : 'Non-Veg',
// style: const TextStyle(
// color: Colors.white70,
// fontSize: 14,
// ),
// ),
// ],
// ),
// ),
// ),
// ),
// );
// }
// }
}
44 changes: 44 additions & 0 deletions lib/Global/widgets/custom_shimmer_container
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import 'package:flutter/material.dart';
import 'package:shimmer/shimmer.dart';

class ShimmerContainer extends StatelessWidget {
final double? width;
final double? height;
final double? borderRadius;
final EdgeInsetsGeometry? margin;
final Color? baseColor;
final Color? highlightColor;
final BoxShape shape;

const ShimmerContainer({
super.key,
this.width,
this.height,
this.borderRadius,
this.margin,
this.baseColor,
this.highlightColor,
this.shape = BoxShape.rectangle,
});

@override
Widget build(BuildContext context) {
return Shimmer.fromColors(
baseColor: baseColor ?? Colors.grey.shade100, // Default base color
highlightColor:
highlightColor ?? Colors.grey.shade200, // Default highlight color
child: Container(
width: width ?? double.infinity, // Default width (full width)
height: height ?? 100.0, // Default height
margin: margin ?? const EdgeInsets.all(8.0), // Default margin
decoration: BoxDecoration(
color: Colors.grey, // Background color of the container
borderRadius: shape == BoxShape.rectangle
? BorderRadius.circular(borderRadius ?? 8.0)
: null, // Optional rounded corners
shape: shape, // Allow for circular or rectangular shape
),
),
);
}
}
90 changes: 90 additions & 0 deletions lib/Global/widgets/custom_shimmerlist_tile.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
//import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:mess_mgmt/Global/widgets/custom_shimmer_container';

class ShimmerListTile extends StatelessWidget {
const ShimmerListTile({super.key});

@override
Widget build(BuildContext context) {
return Card(
child: Row(
children: [
Container(
height: 120,
padding: const EdgeInsets.fromLTRB(14, 8, 14, 8),
decoration: BoxDecoration(
color: const Color.fromARGB(255, 224, 216, 216),
borderRadius: BorderRadius.circular(12)),
child: const Center(
child: ShimmerContainer(
height: 110,
width: 25,
),
)),
const SizedBox(width: 2),
Expanded(
child: Container(
height: 120,
padding: const EdgeInsets.fromLTRB(14, 10, 14, 10),
decoration: BoxDecoration(
color: const Color.fromARGB(255, 224, 216, 216),
borderRadius: BorderRadius.circular(12)),
child: const Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ShimmerContainer(
width: 170,
height: 30,
margin: EdgeInsets.all(0),
),
ShimmerContainer(
width: 170,
height: 18,
margin: EdgeInsets.fromLTRB(1, 6, 0, 6),
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ShimmerContainer(
width: 35,
height: 35,
margin: EdgeInsets.all(2),
),
SizedBox(
width: 10,
),
ShimmerContainer(
width: 35,
height: 35,
margin: EdgeInsets.all(2),
)
],
),
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
ShimmerContainer(
height: 36,
width: 80,
),
ShimmerContainer(
height: 32,
width: 32,
)
],
),
],
),
)),
],
),
);
}
}
Loading

0 comments on commit 4787844

Please sign in to comment.