import 'package:cheminova/models/user_model.dart';
import 'package:cheminova/utils/common_api_service.dart';
import 'package:cheminova/utils/show_snackbar.dart';

class HomeService {
  Future<Map<String, dynamic>?> getUser({String? token}) async {
    try {
      final response = await commonApiService<Map<String,dynamic>>(
        method: "GET",
        url: "api/v1/user/details",
        fromJson: (json) => json,
        additionalHeaders: {  // Pass the token here
          'Authorization': 'Bearer $token',
        },
      );

      return response;
    } catch (e) {
      showSnackbar(e.toString());
    }
    return null;
  }


}
