// GENERATED CODE - DO NOT MODIFY BY HAND part of 'game_pad.dart'; // ************************************************************************** // JsonModelGenerator // ************************************************************************** @generatedSerializable class Gamepad extends _Gamepad { Gamepad({List buttons, Map dynamicMap}) : this.buttons = new List.unmodifiable(buttons ?? []), this.dynamicMap = new Map.unmodifiable(dynamicMap ?? {}); @override final List buttons; @override final Map dynamicMap; Gamepad copyWith( {List buttons, Map dynamicMap}) { return new Gamepad( buttons: buttons ?? this.buttons, dynamicMap: dynamicMap ?? this.dynamicMap); } bool operator ==(other) { return other is _Gamepad && const ListEquality( const DefaultEquality()) .equals(other.buttons, buttons) && const MapEquality( keys: const DefaultEquality(), values: const DefaultEquality()) .equals(other.dynamicMap, dynamicMap); } @override int get hashCode { return hashObjects([buttons, dynamicMap]); } Map toJson() { return GamepadSerializer.toMap(this); } } // ************************************************************************** // SerializerGenerator // ************************************************************************** abstract class GamepadSerializer { static Gamepad fromMap(Map map) { return new Gamepad( buttons: map['buttons'] is Iterable ? new List.unmodifiable(((map['buttons'] as Iterable) .where((x) => x is Map) as Iterable) .map(GamepadButtonSerializer.fromMap)) : null, dynamicMap: map['dynamic_map'] is Map ? (map['dynamic_map'] as Map).cast() : null); } static Map toMap(_Gamepad model) { if (model == null) { return null; } return { 'buttons': model.buttons?.map((m) => GamepadButtonSerializer.toMap(m))?.toList(), 'dynamic_map': model.dynamicMap }; } } abstract class GamepadFields { static const List allFields = const [buttons, dynamicMap]; static const String buttons = 'buttons'; static const String dynamicMap = 'dynamic_map'; }