Skip to content

Commit

Permalink
Merge pull request #25 from Divyakumar21202/uiUpdate
Browse files Browse the repository at this point in the history
UI update
  • Loading branch information
Divyakumar21202 authored Sep 20, 2024
2 parents 6fc78b3 + 64d8aec commit a58a303
Show file tree
Hide file tree
Showing 98 changed files with 4,341 additions and 553 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/build_apk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
on:
push:
branches:
- main
- uiUpdate
pull_request:
branches:
- uiUpdate
- main
jobs:
Build-Apk:
runs-on: ubuntu-latest
steps:
- name: Check-Repository
uses: actions/checkout@v1

- name: Set up .env file
run: echo "Base_URL=${{ secrets.BASE_URL }}" > .env

- name: Set-Up-Flutter
uses: subosito/flutter-action@v1
with:
flutter-version: '3.24.0'

- name: Clean-Gradle-Build
run: flutter clean

- name: Get-Dependencies
run: flutter pub get

- name: Build-Apk
run: flutter build apk --release
15 changes: 15 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}"
}
]
}
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"
}
}
Binary file modified README.md
Binary file not shown.
3 changes: 2 additions & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET" />
<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.
2 changes: 1 addition & 1 deletion android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pluginManagement {
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.3.0" apply false
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
id "org.jetbrains.kotlin.android" version "2.0.10" apply false
}

include ":app"
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.
1 change: 1 addition & 0 deletions assets/lottie/login_successfully.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"nm":"Untitled file","ddd":0,"h":500,"w":500,"meta":{"g":"@lottiefiles/creator 1.13.0"},"layers":[{"ty":4,"nm":"Shape Layer - SVG","sr":1,"st":0,"op":37,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[68.99984979629517,69]},"s":{"a":0,"k":[335.6589147286821,335.6589147286821]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[249.99984979629517,250]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}},"shapes":[{"ty":"gr","bm":0,"hd":false,"nm":"Group 1","it":[{"ty":"sh","bm":0,"hd":false,"nm":"Path 1","d":1,"ks":{"a":0,"k":{"c":false,"i":[[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0]],"v":[[47,66.5],[63.5,83],[91.5,55]]}}},{"ty":"st","bm":0,"hd":false,"nm":"Stroke","lc":1,"lj":1,"ml":4,"o":{"a":0,"k":100},"w":{"a":0,"k":8},"c":{"a":0,"k":[1,1,1]}},{"ty":"tm","bm":0,"hd":false,"nm":"Trim Path","e":{"a":1,"k":[{"o":{"x":0.65,"y":0},"i":{"x":0.36,"y":1},"s":[0],"t":8},{"s":[100],"t":21}]},"o":{"a":0,"k":0},"s":{"a":0,"k":0},"m":1},{"ty":"tr","a":{"a":0,"k":[69.25000000000001,69]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[69.25000000000001,69]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}}]},{"ty":"gr","bm":0,"hd":false,"nm":"Group 2","it":[{"ty":"sh","bm":0,"hd":false,"nm":"Path 2","d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"v":[[69,10],[84.3149,21.8656],[103.679,21.268],[109.095,39.8694],[125.112,50.768],[118.56,69],[125.112,87.232],[109.095,98.1306],[103.679,116.732],[84.3149,116.134],[69,128],[53.6851,116.134],[34.3207,116.732],[28.9051,98.1306],[12.8877,87.232],[19.44,69],[12.8877,50.768],[28.9051,39.8694],[34.3207,21.268],[53.6851,21.8656],[69,10]]}}},{"ty":"fl","bm":0,"hd":false,"nm":"Fill","c":{"a":0,"k":[0.0235,0.7176,0.3216]},"r":1,"o":{"a":0,"k":100}},{"ty":"tr","a":{"a":0,"k":[68.99984979629517,69]},"s":{"a":1,"k":[{"o":{"x":0,"y":0},"i":{"x":0.36,"y":1},"s":[0,0],"t":0},{"s":[100,100],"t":11}]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[68.99984979629517,69]},"r":{"a":1,"k":[{"o":{"x":0,"y":0},"i":{"x":0.36,"y":1},"s":[90],"t":2},{"s":[0],"t":16}]},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}}]}],"ind":1}],"v":"5.7.0","fr":30,"op":30,"ip":0,"assets":[]}
3 changes: 3 additions & 0 deletions devtools_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
description: This file stores settings for Dart & Flutter DevTools.
documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states
extensions:
Binary file removed flutter_01.png
Binary file not shown.
Binary file removed flutter_02.png
Binary file not shown.
Binary file removed flutter_03.png
Binary file not shown.
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.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
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),
),
),
],
),
);
}
}
10 changes: 10 additions & 0 deletions lib/Global/Functions/format_date.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
String formatCurrentDate() {
DateTime now = DateTime.now();

String year = now.year.toString();
String month = now.month.toString().padLeft(2, '0');
String day = now.day.toString().padLeft(2, '0');

String formattedDate = '$year-$month-$day';
return formattedDate;
}
84 changes: 42 additions & 42 deletions lib/Global/Functions/my_error_dialog.dart
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
import 'package:flutter/material.dart';
// import 'package:flutter/material.dart';

bool _errorDisplayed = false; // Global flag to track the display status
// 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
// void showMyMessage({required String message, required BuildContext context}) {
// if (_errorDisplayed) return; // Prevent showing multiple toasts

_errorDisplayed = true;
// _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),
),
],
),
),
),
),
);
// 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);
// overlay.insert(overlayEntry);

Future.delayed(Duration(seconds: 1, milliseconds: 10), () {
overlayEntry.remove();
_errorDisplayed = false; // Reset the flag after the toast disappears
});
}
// Future.delayed(const Duration(seconds: 1, milliseconds: 10), () {
// overlayEntry.remove();
// _errorDisplayed = false; // Reset the flag after the toast disappears
// });
// }
9 changes: 4 additions & 5 deletions lib/Global/Functions/screen_transition.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ 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 begin = Offset(1.0, 0.0);
const end = Offset(0.0, 0.0);
const curve = Curves.easeInOut;

var tween =
Expand All @@ -28,7 +28,6 @@ void navigateToNextScreen({
Navigator.push(context, createRoute());
}


void navigateAndPopToNextScreen({
required Widget nextScreen,
required BuildContext context,
Expand All @@ -37,8 +36,8 @@ 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 begin = Offset(1.0, 0.0);
const end = Offset(0.0, 0.0);
const curve = Curves.easeInOut;

var tween =
Expand Down
5 changes: 5 additions & 0 deletions lib/Global/Helper/API Helper/api_endpoints.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class ApiEndpoints {
static String get listApiEndpoint => 'list-coupon';
static String get createUserApiEndpoint => 'users';
static String get authenticateUserApiEndpoint => 'auth';
}
28 changes: 28 additions & 0 deletions lib/Global/Helper/API Helper/api_helper.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import 'package:flutter_dotenv/flutter_dotenv.dart';

class ApiHelper {
static final baseUrl = dotenv.env['Base_URL'] as String;
static Map<String, String> getApiHeader({required String? jwt}) {
if (jwt == null) {
Map<String, String> loginHeader = {
"content-type": "application/json",
};
return loginHeader;
}
Map<String, String> header = {
"content-type": "application/json",
"Authorization": "Bearer $jwt",
};

return header;
}

static Uri getUri({
Map<String, dynamic>? queryParams,
required String urlEndpoint,
}) {
final uri =
Uri.parse('$baseUrl$urlEndpoint').replace(queryParameters: queryParams);
return uri;
}
}
Loading

0 comments on commit a58a303

Please sign in to comment.