Skip to content

Commit

Permalink
Merge pull request #22 from Divyakumar21202/main
Browse files Browse the repository at this point in the history
Chore : Updated Auth Error Part
  • Loading branch information
Divyakumar21202 committed Aug 22, 2024
2 parents 545251f + 786276e commit 5d4eea4
Show file tree
Hide file tree
Showing 65 changed files with 696 additions and 456 deletions.
6 changes: 4 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"cmake.sourceDirectory": "C:/Samarth Thaker/Flutter Projects/coupon_aggregator/linux",
"dart.flutterSdkPath": ".fvm/versions/3.22.3"

"dart.flutterSdkPath": ".fvm/versions/3.22.3",
"editor.codeActionsOnSave": {
"source.fixAll": "explicit"
}
}
2 changes: 1 addition & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<application
android:label="mess_mgmt"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
android:icon="@mipmap/launcher_icon">
<activity
android:name=".MainActivity"
android:exported="true"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/logo/applogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = AppIcon;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
Expand Down Expand Up @@ -484,7 +484,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = AppIcon;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
Expand Down
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
47 changes: 47 additions & 0 deletions lib/Global/Error Screen/network_error_screen.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import 'package:flutter/material.dart';

class OfflineRetryPage extends StatelessWidget {
final VoidCallback onRetry;

const OfflineRetryPage({super.key, required this.onRetry});

@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const Icon(
Icons.wifi_off,
size: 100,
color: Colors.grey,
),
const SizedBox(height: 24),
Text(
'You are currently offline',
style: Theme.of(context).textTheme.titleLarge,
textAlign: TextAlign.center,
),
const SizedBox(height: 16),
Text(
'Please check your internet connection and try again.',
style: Theme.of(context).textTheme.bodyMedium,
textAlign: TextAlign.center,
),
const SizedBox(height: 32),
ElevatedButton.icon(
onPressed: onRetry,
icon: const Icon(Icons.refresh),
label: const Text('Retry'),
style: ElevatedButton.styleFrom(
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12),
textStyle: const TextStyle(fontSize: 18),
),
),
],
),
);
}
}
8 changes: 2 additions & 6 deletions lib/Global/Functions/screen_transition.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ void navigateToNextScreen({
return PageRouteBuilder(
pageBuilder: (context, animation, secondaryAnimation) => nextScreen,
transitionsBuilder: (context, animation, secondaryAnimation, child) {
const begin = Offset(1.0, 0.0); // Start position (right side)
const end = Offset(0.0, 0.0); // End position (center screen)
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 @@ -36,9 +34,7 @@ void navigateAndPopToNextScreen({
return PageRouteBuilder(
pageBuilder: (context, animation, secondaryAnimation) => nextScreen,
transitionsBuilder: (context, animation, secondaryAnimation, child) {
const begin = Offset(1.0, 0.0); // Start position (right side)
const end = Offset(0.0, 0.0); // End position (center screen)
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
19 changes: 9 additions & 10 deletions lib/Global/dialogs/edit_coupon_dialog.dart
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import 'dart:ui';

import 'package:flutter/material.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:mess_mgmt/Global/store/app_state_store.dart';
import 'package:mess_mgmt/features/User%20Profile/store/user_profile_store.dart';
import 'package:mobx/mobx.dart';

import '../enums/enums.dart';
import '../models/coupon_data_model.dart';
import '../widgets/loader.dart';

void showEditCouponDialog(
{required BuildContext context, required CouponDataModel coupon}) {
userProfileStore.canDialogPop = false;
appState.canDialogPop = false;

showDialog(
context: context,
Expand Down Expand Up @@ -63,15 +62,15 @@ class _DialogWidgetState extends State<DialogWidget> {
return Dialog(
backgroundColor: Colors.transparent,
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), // Apply blur effect
filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10),
child: Container(
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.2), // Slightly opaque background
color: Colors.white.withOpacity(0.2),
borderRadius: BorderRadius.circular(20),
border: Border.all(
color: Colors.white
.withOpacity(0.3), // White border with slight opacity
.withOpacity(0.3),
width: 1.5,
),
),
Expand All @@ -85,7 +84,7 @@ class _DialogWidgetState extends State<DialogWidget> {
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: Colors.white, // Text color set to white for contrast
color: Colors.white,
),
),
const SizedBox(height: 16),
Expand All @@ -95,7 +94,7 @@ class _DialogWidgetState extends State<DialogWidget> {
labelText: "Floor",
labelStyle: TextStyle(
color: Colors.white,
), // Label color set to white
),
),
items: Floor.values.map((Floor value) {
return DropdownMenuItem<Floor>(
Expand All @@ -104,7 +103,7 @@ class _DialogWidgetState extends State<DialogWidget> {
value.intoString(),
style: const TextStyle(
color: Colors
.white), // Dropdown item color set to white
.white),
),
);
}).toList(),
Expand Down Expand Up @@ -207,7 +206,7 @@ class _DialogWidgetState extends State<DialogWidget> {
builder: (context) {
return autorun((_) {
final canDialogPop =
userProfileStore.canDialogPop;
appState.canDialogPop;
if (canDialogPop) {
Navigator.pop(context);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Global/effects/shimmer_effect.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class ShimmerEffect extends StatefulWidget {
const ShimmerEffect({super.key, required this.child});

@override
_ShimmerEffectState createState() => _ShimmerEffectState();
State<ShimmerEffect> createState() => _ShimmerEffectState();
}

class _ShimmerEffectState extends State<ShimmerEffect> with SingleTickerProviderStateMixin {
Expand Down
2 changes: 1 addition & 1 deletion lib/Global/models/coupon_data_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class CouponDataModel {
final String id;
final String? couponType; // "lunch"
final String? couponDate; // "2024-07-06T00:00:00.000Z",
final int? price; // 50,
final int price; // 50,
final int? couponFloor; // 1,
final bool isVeg; // true,
final String? status; // "active",
Expand Down
2 changes: 1 addition & 1 deletion lib/Global/models/coupon_data_model.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/Global/models/user_model.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions lib/Global/store/app_state_store.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ part 'app_state_store.g.dart';

final AppState appState = AppState();

class AppState = _AppStateStore with _$AppState;
class AppState = AppStateStore with _$AppState;

abstract class _AppStateStore with Store {
abstract class AppStateStore with Store {
@observable
String? jwt;

Expand All @@ -28,6 +28,9 @@ abstract class _AppStateStore with Store {
@observable
AuthError? authError;

@observable
bool canDialogPop = false;

@action
Future initialization() async {
await validateSession();
Expand Down
35 changes: 26 additions & 9 deletions lib/Global/store/app_state_store.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions lib/Global/theme/app_theme.dart
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
import 'package:flutter/material.dart';

class AppTheme {
static const Color primaryColor = Colors.blueAccent;
static ThemeData lightTheme() {
return ThemeData(
scaffoldBackgroundColor: Colors.white,
primaryColor: Colors.blueAccent,
primaryColor: primaryColor,
colorScheme: ColorScheme.fromSwatch().copyWith(
primary: Colors.blueAccent,
primary: primaryColor,
secondary: Colors.lightBlueAccent,
),
iconTheme: const IconThemeData(color: primaryColor),
appBarTheme: const AppBarTheme(
foregroundColor: Colors.white,
backgroundColor: Colors.blueAccent,
),
textTheme: const TextTheme(
titleLarge: TextStyle(color: Colors.black, fontWeight: FontWeight.bold),
titleMedium: TextStyle(color: Colors.black, fontSize: 20),
Expand Down
2 changes: 1 addition & 1 deletion lib/Global/widgets/custom_pwd_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CustomPwdTile extends StatefulWidget {
this.validator});

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

class _CustomPwdTileState extends State<CustomPwdTile> {
Expand Down
3 changes: 1 addition & 2 deletions lib/Global/widgets/custom_search_text_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ class CustomSearchTextField extends StatelessWidget {
@override
Widget build(BuildContext context) {
return TextField(
// controller: controller,
onChanged: (val) {},
onChanged: (val) {},
decoration: InputDecoration(
hintText: 'Search By Name',
hintStyle: Theme.of(context)
Expand Down
2 changes: 1 addition & 1 deletion lib/Global/widgets/custom_select_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class CustomSelectionDialog extends StatefulWidget {
});

@override
_CustomSelectionDialogState createState() => _CustomSelectionDialogState();
State<CustomSelectionDialog> createState() => _CustomSelectionDialogState();
}

class _CustomSelectionDialogState extends State<CustomSelectionDialog> {
Expand Down
3 changes: 1 addition & 2 deletions lib/Global/widgets/custom_successfully_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ class ContentBox extends StatelessWidget {
"Continue",
style: TextStyle(
fontSize: 18,
// color: Colors.deepPurple,
),
),
),
),
),
Expand Down
Loading

0 comments on commit 5d4eea4

Please sign in to comment.