import 'package:didvan/models/ai/info_model.dart';
import 'package:didvan/models/enums.dart';
import 'package:didvan/providers/core.dart';
import 'package:didvan/services/network/request.dart';
import 'package:didvan/services/network/request_helper.dart';

class InfoState extends CoreProvier {
  late InfoModel infoModel;
  void getTools() async {
    appState = AppState.busy;
    update();

    final service = RequestService(
      RequestHelper.info(),
    );
    await service.httpGet();
    if (service.isSuccess) {
      infoModel = InfoModel.fromJson(service.result);
      appState = AppState.idle;
      update();
      return;
    }
    appState = AppState.failed;
    update();
  }
}
