Skip to content

Commit

Permalink
Chore Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Divyakumar21202 committed Aug 24, 2024
1 parent 895580f commit 3fafd61
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 41 deletions.
1 change: 1 addition & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<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}"
Expand Down
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"
8 changes: 3 additions & 5 deletions lib/features/auth/repository/auth_repo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,10 @@ class AuthRepository {
static Future<http.Response?> userRegister({
required Map<String, dynamic> data,
}) async {
try {
final uri = ApiHelper.getUri(urlEndpoint: ApiEndpoints.createUserApiEndpoint);
var res = await http.post(uri, body: data);
var res = await http.post(uri, body: data)
.timeout(const Duration(seconds: 7));
return res;
} catch (e) {
throw Exception(e);
}

}
}
22 changes: 11 additions & 11 deletions lib/features/auth/screens/signup_screen_2.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ class _SignupScreenTwoState extends State<SignupScreenTwo> {
final _pwdController = TextEditingController(text: authStore.password);

void login() {
navigateToNextScreen(nextScreen: const LoginScreen(), context: context);
navigateToNextScreen(nextScreen: const LoginScreen(), context: context);
}

void signupNow() async {
void signupNow() {
if (!isValidate(_phoneNumberController.text)) {
showMessage(message: 'Please Enter Valid Phone Number', context: context);
return;
Expand All @@ -46,24 +46,25 @@ class _SignupScreenTwoState extends State<SignupScreenTwo> {
context: context);
return;
}
await authStore.userSignUp();
authStore.userSignUp();
}

void showValidateDialog(BuildContext context, Builder builder) {
showDialog(
context: context,
builder: (BuildContext context) {
return Dialog(
backgroundColor: Colors.transparent, child: BackdropFilter(
filter:
ImageFilter.blur(sigmaX: 10, sigmaY: 10), child: Container(
backgroundColor: Colors.transparent,
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10),
child: Container(
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: Colors.white
.withOpacity(0.2), borderRadius: BorderRadius.circular(20),
color: Colors.white.withOpacity(0.2),
borderRadius: BorderRadius.circular(20),
border: Border.all(
color: Colors.white
.withOpacity(0.3), width: 1.5,
color: Colors.white.withOpacity(0.3),
width: 1.5,
),
),
child: const Text("Account created"),
Expand Down Expand Up @@ -118,7 +119,6 @@ class _SignupScreenTwoState extends State<SignupScreenTwo> {
return Scaffold(
appBar: AppBar(
centerTitle: true,

title: const Text('One more step'),
leading: IconButton(
onPressed: () {
Expand Down
6 changes: 3 additions & 3 deletions lib/features/auth/stores/auth_store.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ abstract class Auth with Store {
@observable
bool isLoading = false;


@observable
bool isSuccessfullyLoggedin = false;

Expand Down Expand Up @@ -63,7 +62,7 @@ abstract class Auth with Store {
final userJson = data['user'];
appState.currentUser = User.fromJson(userJson);
final userJsonString = jsonEncode(userJson);
sp.setString('userJsonString', userJsonString);
sp.setString('userJsonString', userJsonString);
final expire = data['authentication']['payload']['exp'] as int;
isSuccessfullyLoggedin = true;
await sp.setInt('exp', expire);
Expand All @@ -88,6 +87,7 @@ abstract class Auth with Store {
appState.authError = const AuthErrorUnknownIssue();
} finally {
isLoading = false;
isSuccessfullyLoggedin = false;
}
}

Expand All @@ -103,7 +103,7 @@ abstract class Auth with Store {
"mobileNumber": mobileNumber,
});
if (res != null && res.statusCode == 201) {
currentAuthScreen = AuthScreens.loginScreen;
currentAuthScreen = AuthScreens.loginScreen;
} else if (res != null && res.statusCode == 409) {
appState.currentUser = null;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class MyApp extends StatelessWidget {
final isSuccess = authStore.isSuccessfullyLoggedin;
if (!isLoading && authError != null) {
showError(context, authError.errorDescription,
authError.errorString);
authError.errorString,);
appState.authError = null;
}
if (isSuccess) {
Expand Down
53 changes: 33 additions & 20 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,23 @@ packages:
dependency: transitive
description:
name: _fe_analyzer_shared
sha256: "0b2f2bd91ba804e53a61d757b986f89f1f9eaed5b11e4b2f5a2468d86d6c9fc7"
sha256: f256b0c0ba6c7577c15e2e4e114755640a875e885099367bf6e012b19314c834
url: "https://pub.dev"
source: hosted
version: "67.0.0"
version: "72.0.0"
_macros:
dependency: transitive
description: dart
source: sdk
version: "0.3.2"
analyzer:
dependency: transitive
description:
name: analyzer
sha256: "37577842a27e4338429a1cbc32679d508836510b056f1eedf0c8d20e39c1383d"
sha256: b652861553cd3990d8ed361f7979dc6d7053a9ac8843fa73820ab68ce5410139
url: "https://pub.dev"
source: hosted
version: "6.4.1"
version: "6.7.0"
archive:
dependency: transitive
description:
Expand Down Expand Up @@ -85,18 +90,18 @@ packages:
dependency: "direct dev"
description:
name: build_runner
sha256: "644dc98a0f179b872f612d3eb627924b578897c629788e858157fa5e704ca0c7"
sha256: dd09dd4e2b078992f42aac7f1a622f01882a8492fef08486b27ddde929c19f04
url: "https://pub.dev"
source: hosted
version: "2.4.11"
version: "2.4.12"
build_runner_core:
dependency: transitive
description:
name: build_runner_core
sha256: e3c79f69a64bdfcd8a776a3c28db4eb6e3fb5356d013ae5eb2e52007706d5dbe
sha256: f8126682b87a7282a339b871298cc12009cb67109cfa1614d6436fb0289193e0
url: "https://pub.dev"
source: hosted
version: "7.3.1"
version: "7.3.2"
built_collection:
dependency: transitive
description:
Expand Down Expand Up @@ -165,10 +170,10 @@ packages:
dependency: transitive
description:
name: crypto
sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab
sha256: ec30d999af904f33454ba22ed9a86162b35e52b44ac4807d1d93c288041d7d27
url: "https://pub.dev"
source: hosted
version: "3.0.3"
version: "3.0.5"
cupertino_icons:
dependency: "direct main"
description:
Expand Down Expand Up @@ -197,10 +202,10 @@ packages:
dependency: transitive
description:
name: ffi
sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21"
sha256: "16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6"
url: "https://pub.dev"
source: hosted
version: "2.1.2"
version: "2.1.3"
file:
dependency: transitive
description:
Expand Down Expand Up @@ -384,6 +389,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.1.2"
macros:
dependency: transitive
description:
name: macros
sha256: "0acaed5d6b7eab89f63350bccd82119e6c602df0f391260d0e32b5e23db79536"
url: "https://pub.dev"
source: hosted
version: "0.1.2-main.4"
matcher:
dependency: transitive
description:
Expand Down Expand Up @@ -540,10 +553,10 @@ packages:
dependency: "direct main"
description:
name: shared_preferences
sha256: c272f9cabca5a81adc9b0894381e9c1def363e980f960fa903c604c471b22f68
sha256: "746e5369a43170c25816cc472ee016d3a66bc13fcf430c0bc41ad7b4b2922051"
url: "https://pub.dev"
source: hosted
version: "2.3.1"
version: "2.3.2"
shared_preferences_android:
dependency: transitive
description:
Expand All @@ -556,10 +569,10 @@ packages:
dependency: transitive
description:
name: shared_preferences_foundation
sha256: "776786cff96324851b656777648f36ac772d88bc4c669acff97b7fce5de3c849"
sha256: c4b35f6cb8f63c147312c054ce7c2254c8066745125264f0c88739c417fc9d9f
url: "https://pub.dev"
source: hosted
version: "2.5.1"
version: "2.5.2"
shared_preferences_linux:
dependency: transitive
description:
Expand Down Expand Up @@ -729,10 +742,10 @@ packages:
dependency: transitive
description:
name: url_launcher_android
sha256: "94d8ad05f44c6d4e2ffe5567ab4d741b82d62e3c8e288cc1fcea45965edf47c9"
sha256: e35a698ac302dd68e41f73250bd9517fe3ab5fa4f18fe4647a0872db61bacbab
url: "https://pub.dev"
source: hosted
version: "6.3.8"
version: "6.3.10"
url_launcher_ios:
dependency: transitive
description:
Expand Down Expand Up @@ -846,5 +859,5 @@ packages:
source: hosted
version: "3.1.2"
sdks:
dart: ">=3.4.0 <4.0.0"
flutter: ">=3.22.0"
dart: ">=3.5.0 <4.0.0"
flutter: ">=3.24.0"

0 comments on commit 3fafd61

Please sign in to comment.