// profile_cubit.dart
import 'package:flutter_bloc/flutter_bloc.dart';

import '../viewmodel/profile_viewmodel.dart';


class ProfileCubit extends Cubit<ProfileState> {
  ProfileCubit() : super(const ProfileState()) {
    loadProfile();
  }

  void loadProfile() async {
    emit(state.copyWith(isLoading: true));

    // Simulate API call delay
    await Future.delayed(Duration(seconds: 1));

    emit(state.copyWith(
      name: 'Lila Hart',
      phone: '(+971) 050 4245 564',
      role: 'Ticket Counter Staff',
      email: 'support@citycards.com',
      lastLogin: '21, November 2024',
      isLoading: false,
    ));
  }

  void logout() {
    // Handle logout logic here
    print("User logged out");
  }
}
