marco.pms.mobile/lib/helpers/services/auth_service.dart
Vaibhav Surve 99902e743c Flutter application
- Created generated_plugin_registrant.cc and generated_plugin_registrant.h to manage plugin registration.
- Added generated_plugins.cmake for plugin configuration in CMake.
- Implemented CMakeLists.txt for the Windows runner, defining build settings and dependencies.
- Created Runner.rc for application resources including versioning and icons.
- Developed flutter_window.cpp and flutter_window.h to manage the Flutter window lifecycle.
- Implemented main.cpp as the entry point for the Windows application.
- Added resource.h for resource definitions.
- Included app icon in resources.
- Created runner.exe.manifest for application settings.
- Developed utils.cpp and utils.h for console management and command line argument handling.
- Implemented win32_window.cpp and win32_window.h for high DPI-aware window management.
2025-04-17 12:30:38 +05:30

23 lines
685 B
Dart

import 'package:marco/helpers/services/storage/local_storage.dart';
import 'package:marco/model/user.dart';
class AuthService {
static bool isLoggedIn = false;
static User get dummyUser => User(-1, "demo@example.com", "Denish", "Navadiya");
static Future<Map<String, String>?> loginUser(
Map<String, dynamic> data) async {
await Future.delayed(Duration(seconds: 1));
if (data['email'] != dummyUser.email) {
return {"email": "This email is not registered"};
} else if (data['password'] != "1234567") {
return {"password": "Password is incorrect"};
}
isLoggedIn = true;
await LocalStorage.setLoggedInUser(true);
return null;
}
}