location has been enabled in addition to sending the domain

This commit is contained in:
Daniah Ayad Al-sultani
2026-02-22 14:06:02 +03:00
parent f616a2c104
commit 8b0d849f1b
22 changed files with 312 additions and 43 deletions

View File

@@ -855,6 +855,7 @@ import 'package:flutter_svg/flutter_svg.dart';
import '../widgets/settings_bar.dart';
import '../../core/di/injection_container.dart';
import '../../core/location/location_service.dart';
import '../../domain/models/attendance_login_request.dart';
import '../../domain/models/attendance_logout_request.dart';
import '../../domain/usecases/attendance_login_usecase.dart';
@@ -1061,6 +1062,12 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
if (!mounted) return;
// Fetch device location
final position =
await sl<LocationService>().getCurrentPosition();
if (!mounted) return;
final result = await Navigator.of(context).push(
MaterialPageRoute(
builder:
@@ -1077,6 +1084,8 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
employeeId: employeeId,
faceImage: imageFile,
localAuth: localAuth, // ✅
latitude: position?.latitude,
longitude: position?.longitude,
),
);
},
@@ -1170,6 +1179,12 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
if (!mounted) return;
// Fetch device location
final position =
await sl<LocationService>().getCurrentPosition();
if (!mounted) return;
final result = await Navigator.of(context).push(
MaterialPageRoute(
builder:
@@ -1187,6 +1202,8 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
employeeId: employeeId,
faceImage: imageFile,
localAuth: localAuth, // ✅
latitude: position?.latitude,
longitude: position?.longitude,
),
);
},

View File

@@ -1,5 +1,7 @@
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/app_background.dart';
import '../widgets/auth_form.dart';
import '../../core/di/injection_container.dart';
@@ -19,17 +21,30 @@ class AuthScreen extends StatelessWidget {
child: Column(
children: [
const SizedBox(height: 60),
// Logo
// Center(child: Image.asset("assets/images/logo2.png", width: 200)),
const Center(
child: Text(
'LOGO',
style: TextStyle(
fontSize: 36,
fontWeight: FontWeight.bold,
color: Colors.white,
letterSpacing: 2,
),
// Dynamic Logo from backend
Center(
child: 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',
style: TextStyle(
fontSize: 36,
fontWeight: FontWeight.bold,
color: Colors.white,
letterSpacing: 2,
),
);
},
),
),
// const SizedBox(height: 15),

View File

@@ -1,6 +1,9 @@
import 'dart:async';
import 'package:coda_project/presentation/screens/auth_screen.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_button.dart';
@@ -88,15 +91,28 @@ class _OnboardingScreenState extends State<OnboardingScreen> {
Column(
children: [
const SizedBox(height: 70),
// Image.asset("assets/images/logo2.png", width: 200),
const Text(
'LOGO',
style: TextStyle(
fontSize: 36,
fontWeight: FontWeight.bold,
color: Colors.white,
letterSpacing: 2,
),
// Dynamic Logo from backend
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',
style: TextStyle(
fontSize: 36,
fontWeight: FontWeight.bold,
color: Colors.white,
letterSpacing: 2,
),
);
},
),
/// PAGEVIEW (SVG + TEXT ONLY)

View File

@@ -1,5 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.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 'main_screen.dart';
import '../../core/di/injection_container.dart';
@@ -65,16 +68,28 @@ class _SplashScreenState extends State<SplashScreen> {
fit: BoxFit.cover,
),
),
// child: Center(child: Image.asset("assets/images/logo.png", width: 200)),
child: const Center(
child: Text(
'LOGO',
style: TextStyle(
fontSize: 36,
fontWeight: FontWeight.bold,
color: Colors.white,
letterSpacing: 2,
),
child: Center(
child: 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',
style: TextStyle(
fontSize: 36,
fontWeight: FontWeight.bold,
color: Colors.white,
letterSpacing: 2,
),
);
},
),
),
),

View File

@@ -1,5 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_svg/flutter_svg.dart';
import '../blocs/theme/theme_cubit.dart';
import '../blocs/theme/theme_state.dart';
class SettingsBar extends StatelessWidget {
final int selectedIndex;
@@ -25,15 +28,28 @@ class SettingsBar extends StatelessWidget {
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
// Text Logo
const Text(
'LOGO',
style: TextStyle(
fontSize: 28,
fontWeight: FontWeight.bold,
color: Colors.white,
letterSpacing: 2,
),
// Dynamic Logo from backend
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',
style: TextStyle(
fontSize: 28,
fontWeight: FontWeight.bold,
color: Colors.white,
letterSpacing: 2,
),
);
},
),
Row(
children: [