auth_state.freezed.dart 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412
  1. // GENERATED CODE - DO NOT MODIFY BY HAND
  2. // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides
  3. part of 'auth_state.dart';
  4. // **************************************************************************
  5. // FreezedGenerator
  6. // **************************************************************************
  7. T _$identity<T>(T value) => value;
  8. final _privateConstructorUsedError = UnsupportedError(
  9. 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods');
  10. /// @nodoc
  11. class _$AuthStateTearOff {
  12. const _$AuthStateTearOff();
  13. Authenticated authenticated(UserDetail userDetail) {
  14. return Authenticated(
  15. userDetail,
  16. );
  17. }
  18. Unauthenticated unauthenticated(UserError error) {
  19. return Unauthenticated(
  20. error,
  21. );
  22. }
  23. _Initial initial() {
  24. return const _Initial();
  25. }
  26. }
  27. /// @nodoc
  28. const $AuthState = _$AuthStateTearOff();
  29. /// @nodoc
  30. mixin _$AuthState {
  31. @optionalTypeArgs
  32. TResult when<TResult extends Object?>({
  33. required TResult Function(UserDetail userDetail) authenticated,
  34. required TResult Function(UserError error) unauthenticated,
  35. required TResult Function() initial,
  36. }) =>
  37. throw _privateConstructorUsedError;
  38. @optionalTypeArgs
  39. TResult maybeWhen<TResult extends Object?>({
  40. TResult Function(UserDetail userDetail)? authenticated,
  41. TResult Function(UserError error)? unauthenticated,
  42. TResult Function()? initial,
  43. required TResult orElse(),
  44. }) =>
  45. throw _privateConstructorUsedError;
  46. @optionalTypeArgs
  47. TResult map<TResult extends Object?>({
  48. required TResult Function(Authenticated value) authenticated,
  49. required TResult Function(Unauthenticated value) unauthenticated,
  50. required TResult Function(_Initial value) initial,
  51. }) =>
  52. throw _privateConstructorUsedError;
  53. @optionalTypeArgs
  54. TResult maybeMap<TResult extends Object?>({
  55. TResult Function(Authenticated value)? authenticated,
  56. TResult Function(Unauthenticated value)? unauthenticated,
  57. TResult Function(_Initial value)? initial,
  58. required TResult orElse(),
  59. }) =>
  60. throw _privateConstructorUsedError;
  61. }
  62. /// @nodoc
  63. abstract class $AuthStateCopyWith<$Res> {
  64. factory $AuthStateCopyWith(AuthState value, $Res Function(AuthState) then) =
  65. _$AuthStateCopyWithImpl<$Res>;
  66. }
  67. /// @nodoc
  68. class _$AuthStateCopyWithImpl<$Res> implements $AuthStateCopyWith<$Res> {
  69. _$AuthStateCopyWithImpl(this._value, this._then);
  70. final AuthState _value;
  71. // ignore: unused_field
  72. final $Res Function(AuthState) _then;
  73. }
  74. /// @nodoc
  75. abstract class $AuthenticatedCopyWith<$Res> {
  76. factory $AuthenticatedCopyWith(
  77. Authenticated value, $Res Function(Authenticated) then) =
  78. _$AuthenticatedCopyWithImpl<$Res>;
  79. $Res call({UserDetail userDetail});
  80. }
  81. /// @nodoc
  82. class _$AuthenticatedCopyWithImpl<$Res> extends _$AuthStateCopyWithImpl<$Res>
  83. implements $AuthenticatedCopyWith<$Res> {
  84. _$AuthenticatedCopyWithImpl(
  85. Authenticated _value, $Res Function(Authenticated) _then)
  86. : super(_value, (v) => _then(v as Authenticated));
  87. @override
  88. Authenticated get _value => super._value as Authenticated;
  89. @override
  90. $Res call({
  91. Object? userDetail = freezed,
  92. }) {
  93. return _then(Authenticated(
  94. userDetail == freezed
  95. ? _value.userDetail
  96. : userDetail // ignore: cast_nullable_to_non_nullable
  97. as UserDetail,
  98. ));
  99. }
  100. }
  101. /// @nodoc
  102. class _$Authenticated implements Authenticated {
  103. const _$Authenticated(this.userDetail);
  104. @override
  105. final UserDetail userDetail;
  106. @override
  107. String toString() {
  108. return 'AuthState.authenticated(userDetail: $userDetail)';
  109. }
  110. @override
  111. bool operator ==(dynamic other) {
  112. return identical(this, other) ||
  113. (other is Authenticated &&
  114. (identical(other.userDetail, userDetail) ||
  115. const DeepCollectionEquality()
  116. .equals(other.userDetail, userDetail)));
  117. }
  118. @override
  119. int get hashCode =>
  120. runtimeType.hashCode ^ const DeepCollectionEquality().hash(userDetail);
  121. @JsonKey(ignore: true)
  122. @override
  123. $AuthenticatedCopyWith<Authenticated> get copyWith =>
  124. _$AuthenticatedCopyWithImpl<Authenticated>(this, _$identity);
  125. @override
  126. @optionalTypeArgs
  127. TResult when<TResult extends Object?>({
  128. required TResult Function(UserDetail userDetail) authenticated,
  129. required TResult Function(UserError error) unauthenticated,
  130. required TResult Function() initial,
  131. }) {
  132. return authenticated(userDetail);
  133. }
  134. @override
  135. @optionalTypeArgs
  136. TResult maybeWhen<TResult extends Object?>({
  137. TResult Function(UserDetail userDetail)? authenticated,
  138. TResult Function(UserError error)? unauthenticated,
  139. TResult Function()? initial,
  140. required TResult orElse(),
  141. }) {
  142. if (authenticated != null) {
  143. return authenticated(userDetail);
  144. }
  145. return orElse();
  146. }
  147. @override
  148. @optionalTypeArgs
  149. TResult map<TResult extends Object?>({
  150. required TResult Function(Authenticated value) authenticated,
  151. required TResult Function(Unauthenticated value) unauthenticated,
  152. required TResult Function(_Initial value) initial,
  153. }) {
  154. return authenticated(this);
  155. }
  156. @override
  157. @optionalTypeArgs
  158. TResult maybeMap<TResult extends Object?>({
  159. TResult Function(Authenticated value)? authenticated,
  160. TResult Function(Unauthenticated value)? unauthenticated,
  161. TResult Function(_Initial value)? initial,
  162. required TResult orElse(),
  163. }) {
  164. if (authenticated != null) {
  165. return authenticated(this);
  166. }
  167. return orElse();
  168. }
  169. }
  170. abstract class Authenticated implements AuthState {
  171. const factory Authenticated(UserDetail userDetail) = _$Authenticated;
  172. UserDetail get userDetail => throw _privateConstructorUsedError;
  173. @JsonKey(ignore: true)
  174. $AuthenticatedCopyWith<Authenticated> get copyWith =>
  175. throw _privateConstructorUsedError;
  176. }
  177. /// @nodoc
  178. abstract class $UnauthenticatedCopyWith<$Res> {
  179. factory $UnauthenticatedCopyWith(
  180. Unauthenticated value, $Res Function(Unauthenticated) then) =
  181. _$UnauthenticatedCopyWithImpl<$Res>;
  182. $Res call({UserError error});
  183. }
  184. /// @nodoc
  185. class _$UnauthenticatedCopyWithImpl<$Res> extends _$AuthStateCopyWithImpl<$Res>
  186. implements $UnauthenticatedCopyWith<$Res> {
  187. _$UnauthenticatedCopyWithImpl(
  188. Unauthenticated _value, $Res Function(Unauthenticated) _then)
  189. : super(_value, (v) => _then(v as Unauthenticated));
  190. @override
  191. Unauthenticated get _value => super._value as Unauthenticated;
  192. @override
  193. $Res call({
  194. Object? error = freezed,
  195. }) {
  196. return _then(Unauthenticated(
  197. error == freezed
  198. ? _value.error
  199. : error // ignore: cast_nullable_to_non_nullable
  200. as UserError,
  201. ));
  202. }
  203. }
  204. /// @nodoc
  205. class _$Unauthenticated implements Unauthenticated {
  206. const _$Unauthenticated(this.error);
  207. @override
  208. final UserError error;
  209. @override
  210. String toString() {
  211. return 'AuthState.unauthenticated(error: $error)';
  212. }
  213. @override
  214. bool operator ==(dynamic other) {
  215. return identical(this, other) ||
  216. (other is Unauthenticated &&
  217. (identical(other.error, error) ||
  218. const DeepCollectionEquality().equals(other.error, error)));
  219. }
  220. @override
  221. int get hashCode =>
  222. runtimeType.hashCode ^ const DeepCollectionEquality().hash(error);
  223. @JsonKey(ignore: true)
  224. @override
  225. $UnauthenticatedCopyWith<Unauthenticated> get copyWith =>
  226. _$UnauthenticatedCopyWithImpl<Unauthenticated>(this, _$identity);
  227. @override
  228. @optionalTypeArgs
  229. TResult when<TResult extends Object?>({
  230. required TResult Function(UserDetail userDetail) authenticated,
  231. required TResult Function(UserError error) unauthenticated,
  232. required TResult Function() initial,
  233. }) {
  234. return unauthenticated(error);
  235. }
  236. @override
  237. @optionalTypeArgs
  238. TResult maybeWhen<TResult extends Object?>({
  239. TResult Function(UserDetail userDetail)? authenticated,
  240. TResult Function(UserError error)? unauthenticated,
  241. TResult Function()? initial,
  242. required TResult orElse(),
  243. }) {
  244. if (unauthenticated != null) {
  245. return unauthenticated(error);
  246. }
  247. return orElse();
  248. }
  249. @override
  250. @optionalTypeArgs
  251. TResult map<TResult extends Object?>({
  252. required TResult Function(Authenticated value) authenticated,
  253. required TResult Function(Unauthenticated value) unauthenticated,
  254. required TResult Function(_Initial value) initial,
  255. }) {
  256. return unauthenticated(this);
  257. }
  258. @override
  259. @optionalTypeArgs
  260. TResult maybeMap<TResult extends Object?>({
  261. TResult Function(Authenticated value)? authenticated,
  262. TResult Function(Unauthenticated value)? unauthenticated,
  263. TResult Function(_Initial value)? initial,
  264. required TResult orElse(),
  265. }) {
  266. if (unauthenticated != null) {
  267. return unauthenticated(this);
  268. }
  269. return orElse();
  270. }
  271. }
  272. abstract class Unauthenticated implements AuthState {
  273. const factory Unauthenticated(UserError error) = _$Unauthenticated;
  274. UserError get error => throw _privateConstructorUsedError;
  275. @JsonKey(ignore: true)
  276. $UnauthenticatedCopyWith<Unauthenticated> get copyWith =>
  277. throw _privateConstructorUsedError;
  278. }
  279. /// @nodoc
  280. abstract class _$InitialCopyWith<$Res> {
  281. factory _$InitialCopyWith(_Initial value, $Res Function(_Initial) then) =
  282. __$InitialCopyWithImpl<$Res>;
  283. }
  284. /// @nodoc
  285. class __$InitialCopyWithImpl<$Res> extends _$AuthStateCopyWithImpl<$Res>
  286. implements _$InitialCopyWith<$Res> {
  287. __$InitialCopyWithImpl(_Initial _value, $Res Function(_Initial) _then)
  288. : super(_value, (v) => _then(v as _Initial));
  289. @override
  290. _Initial get _value => super._value as _Initial;
  291. }
  292. /// @nodoc
  293. class _$_Initial implements _Initial {
  294. const _$_Initial();
  295. @override
  296. String toString() {
  297. return 'AuthState.initial()';
  298. }
  299. @override
  300. bool operator ==(dynamic other) {
  301. return identical(this, other) || (other is _Initial);
  302. }
  303. @override
  304. int get hashCode => runtimeType.hashCode;
  305. @override
  306. @optionalTypeArgs
  307. TResult when<TResult extends Object?>({
  308. required TResult Function(UserDetail userDetail) authenticated,
  309. required TResult Function(UserError error) unauthenticated,
  310. required TResult Function() initial,
  311. }) {
  312. return initial();
  313. }
  314. @override
  315. @optionalTypeArgs
  316. TResult maybeWhen<TResult extends Object?>({
  317. TResult Function(UserDetail userDetail)? authenticated,
  318. TResult Function(UserError error)? unauthenticated,
  319. TResult Function()? initial,
  320. required TResult orElse(),
  321. }) {
  322. if (initial != null) {
  323. return initial();
  324. }
  325. return orElse();
  326. }
  327. @override
  328. @optionalTypeArgs
  329. TResult map<TResult extends Object?>({
  330. required TResult Function(Authenticated value) authenticated,
  331. required TResult Function(Unauthenticated value) unauthenticated,
  332. required TResult Function(_Initial value) initial,
  333. }) {
  334. return initial(this);
  335. }
  336. @override
  337. @optionalTypeArgs
  338. TResult maybeMap<TResult extends Object?>({
  339. TResult Function(Authenticated value)? authenticated,
  340. TResult Function(Unauthenticated value)? unauthenticated,
  341. TResult Function(_Initial value)? initial,
  342. required TResult orElse(),
  343. }) {
  344. if (initial != null) {
  345. return initial(this);
  346. }
  347. return orElse();
  348. }
  349. }
  350. abstract class _Initial implements AuthState {
  351. const factory _Initial() = _$_Initial;
  352. }