import 'dart:convert';

import 'package:zhiying_base_widget/widgets/home/home_notice/bloc/bloc.dart';
import 'package:zhiying_base_widget/widgets/home/home_notice/model/home_notice_model.dart';
import 'package:zhiying_comm/zhiying_comm.dart';

class HomeNoticeRepository {
  /// 获取父页面的数据
  Future<HomeNoticeModel> fetchParentData(HomeNoticeInitEvent event) async {
    try {
      String jsonStr = event.model['data'];
      return HomeNoticeModel.fromJson(jsonDecode(jsonStr));
    } catch (e) {
      Logger.log(e);
    }
    return null;
  }
}
