setPropsEquatable method

String setPropsEquatable(
  1. Map map, [
  2. bool isMultipart = false,
  3. List<String> paramPath = const []
])

Implementation

String setPropsEquatable(
  Map map, [
  bool isMultipart = false,
  List<String> paramPath = const [],
]) {
  final variable = map.keys;

  if (variable.isEmpty && paramPath.isEmpty && !isMultipart) {
    return '''@override
List<Object?> get props => [];''';
  }
  return '''@override
List<Object?> get props => [${isMultipart ? 'files,' : ''} ${paramPath.isEmpty ? '' : paramPath.map((e) => '${e.camelCase},').join()} ${variable.map((e) => '${e.toString().camelCase},').join()}];''';
}