// GENERATED CODE - DO NOT MODIFY BY HAND part of 'game_pad.dart'; // ************************************************************************** // JsonModelGenerator // ************************************************************************** @generatedSerializable class Gamepad extends _Gamepad { Gamepad( {@required List buttons, @required 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) { if (map['buttons'] == null) { throw new FormatException("Missing required field 'buttons' on Gamepad."); } if (map['dynamic_map'] == null) { throw new FormatException( "Missing required field 'dynamic_map' on Gamepad."); } return new Gamepad( buttons: map['buttons'] is Iterable ? (map['buttons'] as Iterable).cast().toList() : null, dynamicMap: map['dynamic_map'] is Map ? (map['dynamic_map'] as Map).cast() : null); } static Map toMap(_Gamepad model) { if (model == null) { return null; } if (model.buttons == null) { throw new FormatException("Missing required field 'buttons' on Gamepad."); } if (model.dynamicMap == null) { throw new FormatException( "Missing required field 'dynamic_map' on Gamepad."); } return {'buttons': model.buttons, 'dynamic_map': model.dynamicMap}; } } abstract class GamepadFields { static const List allFields = [buttons, dynamicMap]; static const String buttons = 'buttons'; static const String dynamicMap = 'dynamic_map'; }