location has been enabled in addition to sending the domain
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||||
<uses-permission android:name="android.permission.CAMERA" />
|
<uses-permission android:name="android.permission.CAMERA" />
|
||||||
<uses-permission android:name="android.permission.USE_BIOMETRIC" />
|
<uses-permission android:name="android.permission.USE_BIOMETRIC" />
|
||||||
<uses-feature android:name="android.hardware.camera" android:required="false" />
|
<uses-feature android:name="android.hardware.camera" android:required="false" />
|
||||||
|
|||||||
16
lib/core/config/app_urls.dart
Normal file
16
lib/core/config/app_urls.dart
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
class AppUrls {
|
||||||
|
static const String themeLogoBase = 'https://hrm.go.iq/Images/';
|
||||||
|
|
||||||
|
static String buildThemeLogoUrl(String logoFileName) {
|
||||||
|
if (logoFileName.isEmpty) return '';
|
||||||
|
|
||||||
|
// If backend ever returns a full URL, keep it
|
||||||
|
final lower = logoFileName.toLowerCase();
|
||||||
|
if (lower.startsWith('http://') || lower.startsWith('https://')) {
|
||||||
|
return logoFileName;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Encode spaces/special chars (important!)
|
||||||
|
return themeLogoBase + Uri.encodeComponent(logoFileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -32,6 +32,12 @@ import '../../domain/usecases/get_salary_summary_usecase.dart';
|
|||||||
import '../../domain/usecases/change_password_usecase.dart';
|
import '../../domain/usecases/change_password_usecase.dart';
|
||||||
import '../../presentation/blocs/login/login_bloc.dart';
|
import '../../presentation/blocs/login/login_bloc.dart';
|
||||||
import '../../presentation/blocs/change_password/change_password_bloc.dart';
|
import '../../presentation/blocs/change_password/change_password_bloc.dart';
|
||||||
|
import '../../data/datasources/theme_remote_data_source.dart';
|
||||||
|
import '../../data/repositories/theme_repository_impl.dart';
|
||||||
|
import '../../domain/repositories/theme_repository.dart';
|
||||||
|
import '../../domain/usecases/get_theme_usecase.dart';
|
||||||
|
import '../../presentation/blocs/theme/theme_cubit.dart';
|
||||||
|
import '../location/location_service.dart';
|
||||||
|
|
||||||
final sl = GetIt.instance;
|
final sl = GetIt.instance;
|
||||||
|
|
||||||
@@ -124,4 +130,18 @@ Future<void> initializeDependencies() async {
|
|||||||
|
|
||||||
sl.registerLazySingleton(() => CreateAdvanceUseCase(repository: sl()));
|
sl.registerLazySingleton(() => CreateAdvanceUseCase(repository: sl()));
|
||||||
sl.registerLazySingleton(() => GetAdvancesUseCase(repository: sl()));
|
sl.registerLazySingleton(() => GetAdvancesUseCase(repository: sl()));
|
||||||
|
|
||||||
|
// Theme
|
||||||
|
sl.registerLazySingleton<ThemeRemoteDataSource>(
|
||||||
|
() => ThemeRemoteDataSourceImpl(apiClient: sl()),
|
||||||
|
);
|
||||||
|
|
||||||
|
sl.registerLazySingleton<ThemeRepository>(
|
||||||
|
() => ThemeRepositoryImpl(remote: sl()),
|
||||||
|
);
|
||||||
|
|
||||||
|
sl.registerLazySingleton(() => GetThemeUseCase(sl()));
|
||||||
|
sl.registerFactory(() => ThemeCubit(getThemeUseCase: sl()));
|
||||||
|
|
||||||
|
sl.registerLazySingleton<LocationService>(() => LocationService());
|
||||||
}
|
}
|
||||||
|
|||||||
24
lib/core/location/location_service.dart
Normal file
24
lib/core/location/location_service.dart
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
import 'package:geolocator/geolocator.dart';
|
||||||
|
|
||||||
|
class LocationService {
|
||||||
|
Future<Position?> getCurrentPosition() async {
|
||||||
|
// 1) service enabled?
|
||||||
|
final serviceEnabled = await Geolocator.isLocationServiceEnabled();
|
||||||
|
if (!serviceEnabled) return null;
|
||||||
|
|
||||||
|
// 2) permission
|
||||||
|
var permission = await Geolocator.checkPermission();
|
||||||
|
if (permission == LocationPermission.denied) {
|
||||||
|
permission = await Geolocator.requestPermission();
|
||||||
|
}
|
||||||
|
if (permission == LocationPermission.denied ||
|
||||||
|
permission == LocationPermission.deniedForever) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3) get location (geolocator v13+ API)
|
||||||
|
return Geolocator.getCurrentPosition(
|
||||||
|
locationSettings: const LocationSettings(accuracy: LocationAccuracy.high),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -14,12 +14,16 @@ abstract class AttendanceRemoteDataSource {
|
|||||||
required String employeeId,
|
required String employeeId,
|
||||||
required File faceImage,
|
required File faceImage,
|
||||||
bool localAuth = false,
|
bool localAuth = false,
|
||||||
|
double? latitude,
|
||||||
|
double? longitude,
|
||||||
});
|
});
|
||||||
|
|
||||||
Future<AttendanceResponseDto> logout({
|
Future<AttendanceResponseDto> logout({
|
||||||
required String employeeId,
|
required String employeeId,
|
||||||
required File faceImage,
|
required File faceImage,
|
||||||
bool localAuth = false,
|
bool localAuth = false,
|
||||||
|
double? latitude,
|
||||||
|
double? longitude,
|
||||||
});
|
});
|
||||||
|
|
||||||
Future<List<AttendanceRecordDto>> getAttendanceRecords({
|
Future<List<AttendanceRecordDto>> getAttendanceRecords({
|
||||||
@@ -46,12 +50,17 @@ class AttendanceRemoteDataSourceImpl implements AttendanceRemoteDataSource {
|
|||||||
required String employeeId,
|
required String employeeId,
|
||||||
required File faceImage,
|
required File faceImage,
|
||||||
bool localAuth = false,
|
bool localAuth = false,
|
||||||
|
double? latitude,
|
||||||
|
double? longitude,
|
||||||
}) async {
|
}) async {
|
||||||
try {
|
try {
|
||||||
final formData = FormData.fromMap({
|
final formData = FormData.fromMap({
|
||||||
'EmployeeId': employeeId,
|
'EmployeeId': employeeId,
|
||||||
'FaceImage': await MultipartFile.fromFile(faceImage.path),
|
'FaceImage': await MultipartFile.fromFile(faceImage.path),
|
||||||
'IsAuth': localAuth.toString(),
|
'IsAuth': localAuth.toString(),
|
||||||
|
'Domain': 'hrm.go.iq',
|
||||||
|
if (latitude != null) 'Latitude': latitude,
|
||||||
|
if (longitude != null) 'Longitude': longitude,
|
||||||
});
|
});
|
||||||
|
|
||||||
final response = await apiClient.post(
|
final response = await apiClient.post(
|
||||||
@@ -112,12 +121,16 @@ class AttendanceRemoteDataSourceImpl implements AttendanceRemoteDataSource {
|
|||||||
required String employeeId,
|
required String employeeId,
|
||||||
required File faceImage,
|
required File faceImage,
|
||||||
bool localAuth = false,
|
bool localAuth = false,
|
||||||
|
double? latitude,
|
||||||
|
double? longitude,
|
||||||
}) async {
|
}) async {
|
||||||
try {
|
try {
|
||||||
final formData = FormData.fromMap({
|
final formData = FormData.fromMap({
|
||||||
'EmployeeId': employeeId,
|
'EmployeeId': employeeId,
|
||||||
'FaceImage': await MultipartFile.fromFile(faceImage.path),
|
'FaceImage': await MultipartFile.fromFile(faceImage.path),
|
||||||
'IsAuth': localAuth.toString(),
|
'IsAuth': localAuth.toString(),
|
||||||
|
if (latitude != null) 'Latitude': latitude,
|
||||||
|
if (longitude != null) 'Longitude': longitude,
|
||||||
});
|
});
|
||||||
|
|
||||||
final response = await apiClient.post(
|
final response = await apiClient.post(
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ class AttendanceRepositoryImpl implements AttendanceRepository {
|
|||||||
employeeId: request.employeeId,
|
employeeId: request.employeeId,
|
||||||
faceImage: request.faceImage,
|
faceImage: request.faceImage,
|
||||||
localAuth: request.localAuth,
|
localAuth: request.localAuth,
|
||||||
|
latitude: request.latitude,
|
||||||
|
longitude: request.longitude,
|
||||||
);
|
);
|
||||||
|
|
||||||
return AttendanceResponseModel(
|
return AttendanceResponseModel(
|
||||||
@@ -36,6 +38,8 @@ class AttendanceRepositoryImpl implements AttendanceRepository {
|
|||||||
employeeId: request.employeeId,
|
employeeId: request.employeeId,
|
||||||
faceImage: request.faceImage,
|
faceImage: request.faceImage,
|
||||||
localAuth: request.localAuth,
|
localAuth: request.localAuth,
|
||||||
|
latitude: request.latitude,
|
||||||
|
longitude: request.longitude,
|
||||||
);
|
);
|
||||||
|
|
||||||
return AttendanceResponseModel(
|
return AttendanceResponseModel(
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'package:dartz/dartz.dart';
|
import 'package:dartz/dartz.dart';
|
||||||
|
import '../../core/config/app_urls.dart';
|
||||||
import '../../core/error/failures.dart';
|
import '../../core/error/failures.dart';
|
||||||
import '../../core/error/exceptions.dart';
|
import '../../core/error/exceptions.dart';
|
||||||
import '../../domain/models/theme_model.dart';
|
import '../../domain/models/theme_model.dart';
|
||||||
@@ -14,7 +15,14 @@ class ThemeRepositoryImpl implements ThemeRepository {
|
|||||||
Future<Either<Failure, ThemeModel>> getTheme() async {
|
Future<Either<Failure, ThemeModel>> getTheme() async {
|
||||||
try {
|
try {
|
||||||
final dto = await remote.getTheme();
|
final dto = await remote.getTheme();
|
||||||
return Right(ThemeModel(name: dto.name, logo: dto.logo));
|
|
||||||
|
return Right(
|
||||||
|
ThemeModel(
|
||||||
|
name: dto.name,
|
||||||
|
logo: dto.logo,
|
||||||
|
logoUrl: AppUrls.buildThemeLogoUrl(dto.logo),
|
||||||
|
),
|
||||||
|
);
|
||||||
} on ServerException catch (e) {
|
} on ServerException catch (e) {
|
||||||
return Left(ServerFailure(e.message));
|
return Left(ServerFailure(e.message));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
@@ -5,9 +5,15 @@ class AttendanceLoginRequest {
|
|||||||
final File faceImage;
|
final File faceImage;
|
||||||
final bool localAuth;
|
final bool localAuth;
|
||||||
|
|
||||||
|
// ✅ NEW
|
||||||
|
final double? latitude;
|
||||||
|
final double? longitude;
|
||||||
|
|
||||||
AttendanceLoginRequest({
|
AttendanceLoginRequest({
|
||||||
required this.employeeId,
|
required this.employeeId,
|
||||||
required this.faceImage,
|
required this.faceImage,
|
||||||
this.localAuth = false,
|
this.localAuth = false,
|
||||||
|
this.latitude,
|
||||||
|
this.longitude,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,9 +5,15 @@ class AttendanceLogoutRequest {
|
|||||||
final File faceImage;
|
final File faceImage;
|
||||||
final bool localAuth;
|
final bool localAuth;
|
||||||
|
|
||||||
|
// ✅ NEW
|
||||||
|
final double? latitude;
|
||||||
|
final double? longitude;
|
||||||
|
|
||||||
AttendanceLogoutRequest({
|
AttendanceLogoutRequest({
|
||||||
required this.employeeId,
|
required this.employeeId,
|
||||||
required this.faceImage,
|
required this.faceImage,
|
||||||
this.localAuth = false,
|
this.localAuth = false,
|
||||||
|
this.latitude,
|
||||||
|
this.longitude,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
8
lib/domain/models/location_payload.dart
Normal file
8
lib/domain/models/location_payload.dart
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
class LocationPayload {
|
||||||
|
final double lat;
|
||||||
|
final double lng;
|
||||||
|
|
||||||
|
const LocationPayload({required this.lat, required this.lng});
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {'latitude': lat, 'longitude': lng};
|
||||||
|
}
|
||||||
@@ -1,6 +1,11 @@
|
|||||||
class ThemeModel {
|
class ThemeModel {
|
||||||
final String name;
|
final String name;
|
||||||
final String logo; // filename or url
|
final String logo;
|
||||||
|
final String logoUrl;
|
||||||
|
|
||||||
const ThemeModel({required this.name, required this.logo});
|
const ThemeModel({
|
||||||
|
required this.name,
|
||||||
|
required this.logo,
|
||||||
|
required this.logoUrl,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:flutter_native_splash/flutter_native_splash.dart';
|
import 'package:flutter_native_splash/flutter_native_splash.dart';
|
||||||
|
|
||||||
import 'core/di/injection_container.dart';
|
import 'core/di/injection_container.dart';
|
||||||
|
import 'presentation/blocs/theme/theme_cubit.dart';
|
||||||
import 'presentation/screens/splash_screen.dart';
|
import 'presentation/screens/splash_screen.dart';
|
||||||
|
|
||||||
void main() async {
|
void main() async {
|
||||||
@@ -12,7 +14,12 @@ void main() async {
|
|||||||
// Initialize dependency injection
|
// Initialize dependency injection
|
||||||
await initializeDependencies();
|
await initializeDependencies();
|
||||||
|
|
||||||
runApp(const CodaApp());
|
runApp(
|
||||||
|
BlocProvider(
|
||||||
|
create: (_) => sl<ThemeCubit>()..loadTheme(),
|
||||||
|
child: const CodaApp(),
|
||||||
|
),
|
||||||
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
debugPrint('CRITICAL INITIALIZATION ERROR: $e');
|
debugPrint('CRITICAL INITIALIZATION ERROR: $e');
|
||||||
// If initialization fails, show a simple error screen instead of a broken app
|
// If initialization fails, show a simple error screen instead of a broken app
|
||||||
|
|||||||
@@ -855,6 +855,7 @@ import 'package:flutter_svg/flutter_svg.dart';
|
|||||||
import '../widgets/settings_bar.dart';
|
import '../widgets/settings_bar.dart';
|
||||||
|
|
||||||
import '../../core/di/injection_container.dart';
|
import '../../core/di/injection_container.dart';
|
||||||
|
import '../../core/location/location_service.dart';
|
||||||
import '../../domain/models/attendance_login_request.dart';
|
import '../../domain/models/attendance_login_request.dart';
|
||||||
import '../../domain/models/attendance_logout_request.dart';
|
import '../../domain/models/attendance_logout_request.dart';
|
||||||
import '../../domain/usecases/attendance_login_usecase.dart';
|
import '../../domain/usecases/attendance_login_usecase.dart';
|
||||||
@@ -1061,6 +1062,12 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
|
|||||||
|
|
||||||
if (!mounted) return;
|
if (!mounted) return;
|
||||||
|
|
||||||
|
// Fetch device location
|
||||||
|
final position =
|
||||||
|
await sl<LocationService>().getCurrentPosition();
|
||||||
|
|
||||||
|
if (!mounted) return;
|
||||||
|
|
||||||
final result = await Navigator.of(context).push(
|
final result = await Navigator.of(context).push(
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder:
|
builder:
|
||||||
@@ -1077,6 +1084,8 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
|
|||||||
employeeId: employeeId,
|
employeeId: employeeId,
|
||||||
faceImage: imageFile,
|
faceImage: imageFile,
|
||||||
localAuth: localAuth, // ✅
|
localAuth: localAuth, // ✅
|
||||||
|
latitude: position?.latitude,
|
||||||
|
longitude: position?.longitude,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@@ -1170,6 +1179,12 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
|
|||||||
|
|
||||||
if (!mounted) return;
|
if (!mounted) return;
|
||||||
|
|
||||||
|
// Fetch device location
|
||||||
|
final position =
|
||||||
|
await sl<LocationService>().getCurrentPosition();
|
||||||
|
|
||||||
|
if (!mounted) return;
|
||||||
|
|
||||||
final result = await Navigator.of(context).push(
|
final result = await Navigator.of(context).push(
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder:
|
builder:
|
||||||
@@ -1187,6 +1202,8 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
|
|||||||
employeeId: employeeId,
|
employeeId: employeeId,
|
||||||
faceImage: imageFile,
|
faceImage: imageFile,
|
||||||
localAuth: localAuth, // ✅
|
localAuth: localAuth, // ✅
|
||||||
|
latitude: position?.latitude,
|
||||||
|
longitude: position?.longitude,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
|
import '../blocs/theme/theme_cubit.dart';
|
||||||
|
import '../blocs/theme/theme_state.dart';
|
||||||
import '../widgets/app_background.dart';
|
import '../widgets/app_background.dart';
|
||||||
import '../widgets/auth_form.dart';
|
import '../widgets/auth_form.dart';
|
||||||
import '../../core/di/injection_container.dart';
|
import '../../core/di/injection_container.dart';
|
||||||
@@ -19,10 +21,21 @@ class AuthScreen extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
const SizedBox(height: 60),
|
const SizedBox(height: 60),
|
||||||
// Logo
|
// Dynamic Logo from backend
|
||||||
// Center(child: Image.asset("assets/images/logo2.png", width: 200)),
|
Center(
|
||||||
const Center(
|
child: BlocBuilder<ThemeCubit, ThemeState>(
|
||||||
child: Text(
|
builder: (context, state) {
|
||||||
|
if (state is ThemeLoaded) {
|
||||||
|
return Image.network(
|
||||||
|
state.logoUrl,
|
||||||
|
width: 62,
|
||||||
|
height: 62,
|
||||||
|
errorBuilder:
|
||||||
|
(_, __, ___) =>
|
||||||
|
const Icon(Icons.image_not_supported),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return const Text(
|
||||||
'LOGO',
|
'LOGO',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 36,
|
fontSize: 36,
|
||||||
@@ -30,6 +43,8 @@ class AuthScreen extends StatelessWidget {
|
|||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
letterSpacing: 2,
|
letterSpacing: 2,
|
||||||
),
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
// const SizedBox(height: 15),
|
// const SizedBox(height: 15),
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'package:coda_project/presentation/screens/auth_screen.dart';
|
import 'package:coda_project/presentation/screens/auth_screen.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
|
import '../blocs/theme/theme_cubit.dart';
|
||||||
|
import '../blocs/theme/theme_state.dart';
|
||||||
import '../widgets/onboarding_page.dart';
|
import '../widgets/onboarding_page.dart';
|
||||||
import '../widgets/onboarding_button.dart';
|
import '../widgets/onboarding_button.dart';
|
||||||
|
|
||||||
@@ -88,8 +91,19 @@ class _OnboardingScreenState extends State<OnboardingScreen> {
|
|||||||
Column(
|
Column(
|
||||||
children: [
|
children: [
|
||||||
const SizedBox(height: 70),
|
const SizedBox(height: 70),
|
||||||
// Image.asset("assets/images/logo2.png", width: 200),
|
// Dynamic Logo from backend
|
||||||
const Text(
|
BlocBuilder<ThemeCubit, ThemeState>(
|
||||||
|
builder: (context, state) {
|
||||||
|
if (state is ThemeLoaded) {
|
||||||
|
return Image.network(
|
||||||
|
state.logoUrl,
|
||||||
|
width: 62,
|
||||||
|
height: 62,
|
||||||
|
errorBuilder:
|
||||||
|
(_, __, ___) => const Icon(Icons.image_not_supported),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return const Text(
|
||||||
'LOGO',
|
'LOGO',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 36,
|
fontSize: 36,
|
||||||
@@ -97,6 +111,8 @@ class _OnboardingScreenState extends State<OnboardingScreen> {
|
|||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
letterSpacing: 2,
|
letterSpacing: 2,
|
||||||
),
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
|
|
||||||
/// PAGEVIEW (SVG + TEXT ONLY)
|
/// PAGEVIEW (SVG + TEXT ONLY)
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:flutter_native_splash/flutter_native_splash.dart';
|
import 'package:flutter_native_splash/flutter_native_splash.dart';
|
||||||
|
import '../blocs/theme/theme_cubit.dart';
|
||||||
|
import '../blocs/theme/theme_state.dart';
|
||||||
import 'onboarding_screen.dart';
|
import 'onboarding_screen.dart';
|
||||||
import 'main_screen.dart';
|
import 'main_screen.dart';
|
||||||
import '../../core/di/injection_container.dart';
|
import '../../core/di/injection_container.dart';
|
||||||
@@ -65,9 +68,19 @@ class _SplashScreenState extends State<SplashScreen> {
|
|||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
// child: Center(child: Image.asset("assets/images/logo.png", width: 200)),
|
child: Center(
|
||||||
child: const Center(
|
child: BlocBuilder<ThemeCubit, ThemeState>(
|
||||||
child: Text(
|
builder: (context, state) {
|
||||||
|
if (state is ThemeLoaded) {
|
||||||
|
return Image.network(
|
||||||
|
state.logoUrl,
|
||||||
|
width: 62,
|
||||||
|
height: 62,
|
||||||
|
errorBuilder:
|
||||||
|
(_, __, ___) => const Icon(Icons.image_not_supported),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return const Text(
|
||||||
'LOGO',
|
'LOGO',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 36,
|
fontSize: 36,
|
||||||
@@ -75,6 +88,8 @@ class _SplashScreenState extends State<SplashScreen> {
|
|||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
letterSpacing: 2,
|
letterSpacing: 2,
|
||||||
),
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:flutter_svg/flutter_svg.dart';
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
|
import '../blocs/theme/theme_cubit.dart';
|
||||||
|
import '../blocs/theme/theme_state.dart';
|
||||||
|
|
||||||
class SettingsBar extends StatelessWidget {
|
class SettingsBar extends StatelessWidget {
|
||||||
final int selectedIndex;
|
final int selectedIndex;
|
||||||
@@ -25,8 +28,19 @@ class SettingsBar extends StatelessWidget {
|
|||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
// Text Logo
|
// Dynamic Logo from backend
|
||||||
const Text(
|
BlocBuilder<ThemeCubit, ThemeState>(
|
||||||
|
builder: (context, state) {
|
||||||
|
if (state is ThemeLoaded) {
|
||||||
|
return Image.network(
|
||||||
|
state.logoUrl,
|
||||||
|
width: 62,
|
||||||
|
height: 62,
|
||||||
|
errorBuilder:
|
||||||
|
(_, __, ___) => const Icon(Icons.image_not_supported),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return const Text(
|
||||||
'LOGO',
|
'LOGO',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 28,
|
fontSize: 28,
|
||||||
@@ -34,6 +48,8 @@ class SettingsBar extends StatelessWidget {
|
|||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
letterSpacing: 2,
|
letterSpacing: 2,
|
||||||
),
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
|
|||||||
@@ -5,10 +5,12 @@
|
|||||||
import FlutterMacOS
|
import FlutterMacOS
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
|
import geolocator_apple
|
||||||
import local_auth_darwin
|
import local_auth_darwin
|
||||||
import shared_preferences_foundation
|
import shared_preferences_foundation
|
||||||
|
|
||||||
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||||
|
GeolocatorPlugin.register(with: registry.registrar(forPlugin: "GeolocatorPlugin"))
|
||||||
LocalAuthPlugin.register(with: registry.registrar(forPlugin: "LocalAuthPlugin"))
|
LocalAuthPlugin.register(with: registry.registrar(forPlugin: "LocalAuthPlugin"))
|
||||||
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
|
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
|
||||||
}
|
}
|
||||||
|
|||||||
64
pubspec.lock
64
pubspec.lock
@@ -209,6 +209,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "7.0.1"
|
version: "7.0.1"
|
||||||
|
fixnum:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: fixnum
|
||||||
|
sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.1.1"
|
||||||
flutter:
|
flutter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description: flutter
|
description: flutter
|
||||||
@@ -272,6 +280,54 @@ packages:
|
|||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
geolocator:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: geolocator
|
||||||
|
sha256: f62bcd90459e63210bbf9c35deb6a51c521f992a78de19a1fe5c11704f9530e2
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "13.0.4"
|
||||||
|
geolocator_android:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: geolocator_android
|
||||||
|
sha256: fcb1760a50d7500deca37c9a666785c047139b5f9ee15aa5469fae7dbbe3170d
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "4.6.2"
|
||||||
|
geolocator_apple:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: geolocator_apple
|
||||||
|
sha256: dbdd8789d5aaf14cf69f74d4925ad1336b4433a6efdf2fce91e8955dc921bf22
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.3.13"
|
||||||
|
geolocator_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: geolocator_platform_interface
|
||||||
|
sha256: "30cb64f0b9adcc0fb36f628b4ebf4f731a2961a0ebd849f4b56200205056fe67"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "4.2.6"
|
||||||
|
geolocator_web:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: geolocator_web
|
||||||
|
sha256: b1ae9bdfd90f861fde8fd4f209c37b953d65e92823cb73c7dee1fa021b06f172
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "4.1.3"
|
||||||
|
geolocator_windows:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: geolocator_windows
|
||||||
|
sha256: "175435404d20278ffd220de83c2ca293b73db95eafbdc8131fe8609be1421eb6"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.2.5"
|
||||||
get_it:
|
get_it:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -669,6 +725,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.3.1"
|
version: "2.3.1"
|
||||||
|
uuid:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: uuid
|
||||||
|
sha256: "1fef9e8e11e2991bb773070d4656b7bd5d850967a2456cfc83cf47925ba79489"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "4.5.3"
|
||||||
vector_graphics:
|
vector_graphics:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ dependencies:
|
|||||||
intl: ^0.19.0
|
intl: ^0.19.0
|
||||||
google_mlkit_face_detection: ^0.12.0
|
google_mlkit_face_detection: ^0.12.0
|
||||||
local_auth: ^2.1.8
|
local_auth: ^2.1.8
|
||||||
|
geolocator: ^13.0.1
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
|||||||
@@ -6,9 +6,12 @@
|
|||||||
|
|
||||||
#include "generated_plugin_registrant.h"
|
#include "generated_plugin_registrant.h"
|
||||||
|
|
||||||
|
#include <geolocator_windows/geolocator_windows.h>
|
||||||
#include <local_auth_windows/local_auth_plugin.h>
|
#include <local_auth_windows/local_auth_plugin.h>
|
||||||
|
|
||||||
void RegisterPlugins(flutter::PluginRegistry* registry) {
|
void RegisterPlugins(flutter::PluginRegistry* registry) {
|
||||||
|
GeolocatorWindowsRegisterWithRegistrar(
|
||||||
|
registry->GetRegistrarForPlugin("GeolocatorWindows"));
|
||||||
LocalAuthPluginRegisterWithRegistrar(
|
LocalAuthPluginRegisterWithRegistrar(
|
||||||
registry->GetRegistrarForPlugin("LocalAuthPlugin"));
|
registry->GetRegistrarForPlugin("LocalAuthPlugin"));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
list(APPEND FLUTTER_PLUGIN_LIST
|
list(APPEND FLUTTER_PLUGIN_LIST
|
||||||
|
geolocator_windows
|
||||||
local_auth_windows
|
local_auth_windows
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user