@override Object toJson() => { if (state.isNotDefault) 'state': state.toJson(), 'error': ?error?.toJson(), };