Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I've resolved the issue regarding to Pagination Logic with Applied Filter #31

Merged
merged 21 commits into from
Sep 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
d427c0d
Pubspec.lock
ekansh0unofficial Aug 18, 2024
bdcbf49
Adding Shimmer Functionality in my Code
ekansh0unofficial Aug 18, 2024
040b4f3
Changing Ui for my List Tile
ekansh0unofficial Aug 19, 2024
39f7ac3
Forgot to commit changes of pubspec
ekansh0unofficial Aug 19, 2024
fcc7162
Merge pull request #18 from ekansh0unofficial/uiUpdate
Divyakumar21202 Aug 21, 2024
b29d6ad
Updating Ui for CustomTextTile & Changing GIF for Login Page
ekansh0unofficial Aug 23, 2024
165f1b1
Error Handling Ui in Login Page ,Navigation for SignUp PageUi for pas…
ekansh0unofficial Aug 23, 2024
ed3e119
Adding better navigation to signup pages; TODO : SignUp2 to 1 data tr…
ekansh0unofficial Aug 24, 2024
6fc78b3
Merge pull request #24 from ekansh0unofficial/uiUpdate
Divyakumar21202 Aug 24, 2024
56f2e9f
Chore Updated error handling in Signup Page
Divyakumar21202 Aug 25, 2024
1ed10fc
Chore : Minor Changes
Divyakumar21202 Aug 25, 2024
0c94071
Chore : Merged the uiUpdate branch with main and tested
Divyakumar21202 Aug 25, 2024
99b41cf
Chore Merges the main branch to uiUpdate
Divyakumar21202 Aug 26, 2024
64d8aec
Update README.md
Divyakumar21202 Aug 26, 2024
723bf09
Merge pull request #2 from Divyakumar21202/uiUpdate
Divyakumar21202 Aug 26, 2024
851cff6
Chore created v1.0.0 release
Divyakumar21202 Sep 3, 2024
078ea5f
Merge branch 'main' of https://github.com/divyakumar21202/coupon-aggr…
Divyakumar21202 Sep 3, 2024
edec0db
Chore : Corrected the Pagination Logic with AppliedFilter
Divyakumar21202 Sep 20, 2024
819ecdc
Merge branch 'uiUpdate' of https://github.com/divyakumar21202/coupon-…
Divyakumar21202 Sep 20, 2024
9b81da9
Merge branch 'main' into uiUpdate
Divyakumar21202 Sep 20, 2024
3013bde
Merge branch 'main' into main
Divyakumar21202 Sep 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ Service made to allow transactions of mess coupons between IIIT-Bh Students.

<h2>To setup locally</h2>

1.Clone or Fork this repository along with [Coupon Aggregator backend](https://github.com/p-society/coupon-aggregator-server).
<h3>1.Clone or Fork this repository along with [Coupon Aggregator backend](https://github.com/p-society/coupon-aggregator-server).</h3>

2.Start the Coupon Aggregator server.
<h3>2.Start the Coupon Aggregator server.</h3>

3.Create a .env file.
<h3>3.Create a .env file.</h3>

4.Place the following in it.
<h3>4.Place the following in it.</h3>
```bash
Base_URL="http://10.0.2.2:3030/"
```
Expand Down Expand Up @@ -81,3 +81,7 @@ Made with [contributors-img](https://contributors-img.web.app).
# License <a name="License"></a>

GC-Server and GC-Client is licensed under [Apache License](https://github.com/p-society/coupon-aggregator-client/blob/master/LICENSE)


# C o n t r i b u t i o n
Contributions are welcome! Feel free to reach out with any queries regarding contributions.
48 changes: 48 additions & 0 deletions lib/Global/Functions/my_error_dialog.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// import 'package:flutter/material.dart';

// bool _errorDisplayed = false; // Global flag to track the display status

// void showMyMessage({required String message, required BuildContext context}) {
// if (_errorDisplayed) return; // Prevent showing multiple toasts

// _errorDisplayed = true;

// final overlay = Overlay.of(context);
// final overlayEntry = OverlayEntry(
// builder: (context) => Positioned(
// bottom: MediaQuery.of(context).size.height *
// 0.02, // Adjust the position as needed
// left: MediaQuery.of(context).size.width * 0.03,
// right: MediaQuery.of(context).size.width * 0.03,
// child: Material(
// color: Colors.transparent,
// child: Container(
// padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 10.0),
// decoration: BoxDecoration(
// color: Colors.red.withOpacity(0.9),
// borderRadius: BorderRadius.circular(8.0),
// ),
// child: Row(
// mainAxisSize: MainAxisSize.min,
// children: [
// const Icon(Icons.error_outline, color: Colors.white),
// const SizedBox(width: 10),
// Text(
// message,
// style: const TextStyle(
// color: Colors.white, fontWeight: FontWeight.bold),
// ),
// ],
// ),
// ),
// ),
// ),
// );

// overlay.insert(overlayEntry);

// Future.delayed(const Duration(seconds: 1, milliseconds: 10), () {
// overlayEntry.remove();
// _errorDisplayed = false; // Reset the flag after the toast disappears
// });
// }
8 changes: 6 additions & 2 deletions lib/Global/Functions/screen_transition.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ void navigateToNextScreen({
return PageRouteBuilder(
pageBuilder: (context, animation, secondaryAnimation) => nextScreen,
transitionsBuilder: (context, animation, secondaryAnimation, child) {
const begin = Offset(1.0, 0.0); const end = Offset(0.0, 0.0); const curve = Curves.easeInOut;
const begin = Offset(1.0, 0.0);
const end = Offset(0.0, 0.0);
const curve = Curves.easeInOut;

var tween =
Tween(begin: begin, end: end).chain(CurveTween(curve: curve));
Expand All @@ -34,7 +36,9 @@ void navigateAndPopToNextScreen({
return PageRouteBuilder(
pageBuilder: (context, animation, secondaryAnimation) => nextScreen,
transitionsBuilder: (context, animation, secondaryAnimation, child) {
const begin = Offset(1.0, 0.0); const end = Offset(0.0, 0.0); const curve = Curves.easeInOut;
const begin = Offset(1.0, 0.0);
const end = Offset(0.0, 0.0);
const curve = Curves.easeInOut;

var tween =
Tween(begin: begin, end: end).chain(CurveTween(curve: curve));
Expand Down
25 changes: 25 additions & 0 deletions lib/Global/effects/shimmer_widget.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import 'package:flutter/material.dart';
import 'package:mess_mgmt/Global/effects/shimmer_effect.dart';

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

@override
Widget build(BuildContext context) {
return ShimmerEffect(
child: Card(
margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
elevation: 8,
child: Container(
height: 180,
width: double.infinity,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
),
),
);
}
}
9 changes: 9 additions & 0 deletions lib/Global/enums/pagination_enum.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ extension PaginationEnumExtension on PaginationEnum {
return const SizedBox();
case PaginationEnum.initial:
return ElevatedButton.icon(
style: ButtonStyle(
shape: WidgetStatePropertyAll(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
8,
),
),
),
),
onPressed: onPressed,
label: const Text('Load More !'),
);
Expand Down
2 changes: 1 addition & 1 deletion lib/Global/theme/app_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class AppTheme {
static ThemeData lightTheme() {
return ThemeData(
scaffoldBackgroundColor: Colors.white,
primaryColor: primaryColor,
primaryColor: const Color.fromARGB(255, 21, 82, 187),
colorScheme: ColorScheme.fromSwatch().copyWith(
primary: primaryColor,
secondary: Colors.lightBlueAccent,
Expand Down
57 changes: 27 additions & 30 deletions lib/Global/widgets/custom_error_messenger.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';

showError(BuildContext context, String title, String subtitle) {
showError(BuildContext context,
{required String title, required String description}) {
final theme = Theme.of(context);

final snackBar = SnackBar(
Expand All @@ -12,43 +13,39 @@ import 'package:flutter/material.dart';
),
margin: const EdgeInsets.all(16),
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 16),
content: Row(
content: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Icon(Icons.error_outline, color: Colors.red.shade700, size: 28),
const SizedBox(width: 16),
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: theme.textTheme.titleMedium?.copyWith(
color: Colors.red.shade700,
fontWeight: FontWeight.bold,
),
),
const SizedBox(height: 6),
Text(
subtitle,
style: theme.textTheme.bodyMedium?.copyWith(
color: Colors.red.shade900,
),
),
],
Text(
title,
style: theme.textTheme.titleMedium?.copyWith(
color: Colors.red.shade700,
fontWeight: FontWeight.bold,
),
),
const SizedBox(height: 16),
Text(
description,
style: theme.textTheme.bodyMedium?.copyWith(
color: Colors.red.shade900,
),
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
SnackBarAction(
label: 'DISMISS',
textColor: Colors.red.shade700,
onPressed: () {
ScaffoldMessenger.of(context).hideCurrentSnackBar();
},
),
],
),
],
),
duration: const Duration(seconds: 5),
action: SnackBarAction(
label: 'DISMISS',
textColor: Colors.red.shade700,
onPressed: () {
ScaffoldMessenger.of(context).hideCurrentSnackBar();
},
),
);

ScaffoldMessenger.of(context).showSnackBar(snackBar);
Expand Down
74 changes: 49 additions & 25 deletions lib/Global/widgets/custom_pwd_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,48 @@ class CustomPwdTile extends StatefulWidget {
final TextInputType type;
final IconData icon;
final ValueChanged<String?> onChanged;
final bool isPassword;
final FormFieldValidator? validator;

const CustomPwdTile(
{super.key,
required this.hintText,
required this.controller,
required this.type,
required this.icon,
required this.onChanged,
required bool isPassword,
this.validator});
const CustomPwdTile({
super.key,
required this.hintText,
required this.controller,
required this.type,
required this.icon,
required this.onChanged,
this.isPassword = true, // Default to true since it's a password field
this.validator,
});

@override
State<CustomPwdTile> createState() => _CustomPwdTileState();
}

class _CustomPwdTileState extends State<CustomPwdTile> {
bool isObscure = true;
late bool _isObscure;

void pwdVisibility() {
setState(() {
isObscure = !isObscure;
});
@override
void initState() {
super.initState();
_isObscure = true; // Passwords are obscured by default
}

@override
Widget build(BuildContext context) {
final suffixIcon = widget.isPassword
? IconButton(
icon: _isObscure
? const Icon(Icons.visibility)
: const Icon(Icons.visibility_outlined),
onPressed: () {
setState(() {
_isObscure = !_isObscure;
});
},
)
: null;

return ConstrainedBox(
constraints: const BoxConstraints(
minHeight: 60.0,
Expand All @@ -43,32 +58,41 @@ class _CustomPwdTileState extends State<CustomPwdTile> {
width: 300,
child: TextFormField(
validator: widget.validator,
obscureText: isObscure,
obscureText: _isObscure,
controller: widget.controller,
onChanged: widget.onChanged,
decoration: InputDecoration(
prefixIcon: Icon(
widget.icon,
color: AppTheme.lightTheme().primaryColor,
),
border: OutlineInputBorder(
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: AppTheme.lightTheme().primaryColor,
),
borderRadius: BorderRadius.circular(10),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Colors.grey.shade400,
color: AppTheme.lightTheme().primaryColor,
width: 2.0,
),
borderRadius: BorderRadius.circular(10),
),
errorBorder: OutlineInputBorder(
borderSide: const BorderSide(
color: Colors.red,
width: 2.0,
),
borderRadius: BorderRadius.circular(10),
),
hintText: widget.hintText,
hintStyle:const TextStyle(fontSize: 18),
hintStyle: const TextStyle(fontSize: 15),
contentPadding: const EdgeInsets.symmetric(
horizontal: 10.0,
vertical: 5,
),
suffixIcon: IconButton(
icon: Icon(
isObscure ? Icons.visibility : Icons.visibility_off,
),
onPressed: pwdVisibility,
vertical: 15.0,
),
suffixIcon: suffixIcon,
),
keyboardType: widget.type,
),
Expand Down
Loading
Loading