fetchFigmaFile method

Future<Map<String, dynamic>> fetchFigmaFile({
  1. required String fileId,
  2. required String token,
})

Fetches Figma file data

Implementation

Future<Map<String, dynamic>> fetchFigmaFile(
    {required String fileId, required String token}) async {
  try {
    final response = await dio.get(
      'https://api.figma.com/v1/files/$fileId',
      options: Options(
        headers: {
          'X-FIGMA-TOKEN': token,
        },
      ),
    );
    return response.data;
  } catch (e) {
    logger.log('Error fetching Figma file: $e');
    return {};
  }
}