import 'package:json_annotation/json_annotation.dart';

part 'base_list_model.g.dart';

@JsonSerializable()
class BaseListModel<T> {
  final int code;
  final String msg;
  final List data;

  BaseListModel({
    required this.code,
    required this.msg,
    required this.data,
  });

  factory BaseListModel.fromJson(Map<String, dynamic> json) =>
      _$BaseListModelFromJson(json);

  List get nullSafetyList {
    if (data.isEmpty) {
      return [];
    } else if (data.isEmpty) {
      return [];
    } else {
      return data;
    }
  }


}

