auth_state.freezed.dart 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487
  1. // coverage:ignore-file
  2. // GENERATED CODE - DO NOT MODIFY BY HAND
  3. // 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, invalid_annotation_target
  4. part of 'auth_state.dart';
  5. // **************************************************************************
  6. // FreezedGenerator
  7. // **************************************************************************
  8. T _$identity<T>(T value) => value;
  9. final _privateConstructorUsedError = UnsupportedError(
  10. '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');
  11. /// @nodoc
  12. class _$AuthStateTearOff {
  13. const _$AuthStateTearOff();
  14. Authenticated authenticated(UserProfile userProfile) {
  15. return Authenticated(
  16. userProfile,
  17. );
  18. }
  19. Unauthenticated unauthenticated(FlowyError error) {
  20. return Unauthenticated(
  21. error,
  22. );
  23. }
  24. _Initial initial() {
  25. return const _Initial();
  26. }
  27. }
  28. /// @nodoc
  29. const $AuthState = _$AuthStateTearOff();
  30. /// @nodoc
  31. mixin _$AuthState {
  32. @optionalTypeArgs
  33. TResult when<TResult extends Object?>({
  34. required TResult Function(UserProfile userProfile) authenticated,
  35. required TResult Function(FlowyError error) unauthenticated,
  36. required TResult Function() initial,
  37. }) =>
  38. throw _privateConstructorUsedError;
  39. @optionalTypeArgs
  40. TResult? whenOrNull<TResult extends Object?>({
  41. TResult Function(UserProfile userProfile)? authenticated,
  42. TResult Function(FlowyError error)? unauthenticated,
  43. TResult Function()? initial,
  44. }) =>
  45. throw _privateConstructorUsedError;
  46. @optionalTypeArgs
  47. TResult maybeWhen<TResult extends Object?>({
  48. TResult Function(UserProfile userProfile)? authenticated,
  49. TResult Function(FlowyError error)? unauthenticated,
  50. TResult Function()? initial,
  51. required TResult orElse(),
  52. }) =>
  53. throw _privateConstructorUsedError;
  54. @optionalTypeArgs
  55. TResult map<TResult extends Object?>({
  56. required TResult Function(Authenticated value) authenticated,
  57. required TResult Function(Unauthenticated value) unauthenticated,
  58. required TResult Function(_Initial value) initial,
  59. }) =>
  60. throw _privateConstructorUsedError;
  61. @optionalTypeArgs
  62. TResult? mapOrNull<TResult extends Object?>({
  63. TResult Function(Authenticated value)? authenticated,
  64. TResult Function(Unauthenticated value)? unauthenticated,
  65. TResult Function(_Initial value)? initial,
  66. }) =>
  67. throw _privateConstructorUsedError;
  68. @optionalTypeArgs
  69. TResult maybeMap<TResult extends Object?>({
  70. TResult Function(Authenticated value)? authenticated,
  71. TResult Function(Unauthenticated value)? unauthenticated,
  72. TResult Function(_Initial value)? initial,
  73. required TResult orElse(),
  74. }) =>
  75. throw _privateConstructorUsedError;
  76. }
  77. /// @nodoc
  78. abstract class $AuthStateCopyWith<$Res> {
  79. factory $AuthStateCopyWith(AuthState value, $Res Function(AuthState) then) =
  80. _$AuthStateCopyWithImpl<$Res>;
  81. }
  82. /// @nodoc
  83. class _$AuthStateCopyWithImpl<$Res> implements $AuthStateCopyWith<$Res> {
  84. _$AuthStateCopyWithImpl(this._value, this._then);
  85. final AuthState _value;
  86. // ignore: unused_field
  87. final $Res Function(AuthState) _then;
  88. }
  89. /// @nodoc
  90. abstract class $AuthenticatedCopyWith<$Res> {
  91. factory $AuthenticatedCopyWith(
  92. Authenticated value, $Res Function(Authenticated) then) =
  93. _$AuthenticatedCopyWithImpl<$Res>;
  94. $Res call({UserProfile userProfile});
  95. }
  96. /// @nodoc
  97. class _$AuthenticatedCopyWithImpl<$Res> extends _$AuthStateCopyWithImpl<$Res>
  98. implements $AuthenticatedCopyWith<$Res> {
  99. _$AuthenticatedCopyWithImpl(
  100. Authenticated _value, $Res Function(Authenticated) _then)
  101. : super(_value, (v) => _then(v as Authenticated));
  102. @override
  103. Authenticated get _value => super._value as Authenticated;
  104. @override
  105. $Res call({
  106. Object? userProfile = freezed,
  107. }) {
  108. return _then(Authenticated(
  109. userProfile == freezed
  110. ? _value.userProfile
  111. : userProfile // ignore: cast_nullable_to_non_nullable
  112. as UserProfile,
  113. ));
  114. }
  115. }
  116. /// @nodoc
  117. class _$Authenticated implements Authenticated {
  118. const _$Authenticated(this.userProfile);
  119. @override
  120. final UserProfile userProfile;
  121. @override
  122. String toString() {
  123. return 'AuthState.authenticated(userProfile: $userProfile)';
  124. }
  125. @override
  126. bool operator ==(dynamic other) {
  127. return identical(this, other) ||
  128. (other is Authenticated &&
  129. (identical(other.userProfile, userProfile) ||
  130. const DeepCollectionEquality()
  131. .equals(other.userProfile, userProfile)));
  132. }
  133. @override
  134. int get hashCode =>
  135. runtimeType.hashCode ^ const DeepCollectionEquality().hash(userProfile);
  136. @JsonKey(ignore: true)
  137. @override
  138. $AuthenticatedCopyWith<Authenticated> get copyWith =>
  139. _$AuthenticatedCopyWithImpl<Authenticated>(this, _$identity);
  140. @override
  141. @optionalTypeArgs
  142. TResult when<TResult extends Object?>({
  143. required TResult Function(UserProfile userProfile) authenticated,
  144. required TResult Function(FlowyError error) unauthenticated,
  145. required TResult Function() initial,
  146. }) {
  147. return authenticated(userProfile);
  148. }
  149. @override
  150. @optionalTypeArgs
  151. TResult? whenOrNull<TResult extends Object?>({
  152. TResult Function(UserProfile userProfile)? authenticated,
  153. TResult Function(FlowyError error)? unauthenticated,
  154. TResult Function()? initial,
  155. }) {
  156. return authenticated?.call(userProfile);
  157. }
  158. @override
  159. @optionalTypeArgs
  160. TResult maybeWhen<TResult extends Object?>({
  161. TResult Function(UserProfile userProfile)? authenticated,
  162. TResult Function(FlowyError error)? unauthenticated,
  163. TResult Function()? initial,
  164. required TResult orElse(),
  165. }) {
  166. if (authenticated != null) {
  167. return authenticated(userProfile);
  168. }
  169. return orElse();
  170. }
  171. @override
  172. @optionalTypeArgs
  173. TResult map<TResult extends Object?>({
  174. required TResult Function(Authenticated value) authenticated,
  175. required TResult Function(Unauthenticated value) unauthenticated,
  176. required TResult Function(_Initial value) initial,
  177. }) {
  178. return authenticated(this);
  179. }
  180. @override
  181. @optionalTypeArgs
  182. TResult? mapOrNull<TResult extends Object?>({
  183. TResult Function(Authenticated value)? authenticated,
  184. TResult Function(Unauthenticated value)? unauthenticated,
  185. TResult Function(_Initial value)? initial,
  186. }) {
  187. return authenticated?.call(this);
  188. }
  189. @override
  190. @optionalTypeArgs
  191. TResult maybeMap<TResult extends Object?>({
  192. TResult Function(Authenticated value)? authenticated,
  193. TResult Function(Unauthenticated value)? unauthenticated,
  194. TResult Function(_Initial value)? initial,
  195. required TResult orElse(),
  196. }) {
  197. if (authenticated != null) {
  198. return authenticated(this);
  199. }
  200. return orElse();
  201. }
  202. }
  203. abstract class Authenticated implements AuthState {
  204. const factory Authenticated(UserProfile userProfile) = _$Authenticated;
  205. UserProfile get userProfile => throw _privateConstructorUsedError;
  206. @JsonKey(ignore: true)
  207. $AuthenticatedCopyWith<Authenticated> get copyWith =>
  208. throw _privateConstructorUsedError;
  209. }
  210. /// @nodoc
  211. abstract class $UnauthenticatedCopyWith<$Res> {
  212. factory $UnauthenticatedCopyWith(
  213. Unauthenticated value, $Res Function(Unauthenticated) then) =
  214. _$UnauthenticatedCopyWithImpl<$Res>;
  215. $Res call({FlowyError error});
  216. }
  217. /// @nodoc
  218. class _$UnauthenticatedCopyWithImpl<$Res> extends _$AuthStateCopyWithImpl<$Res>
  219. implements $UnauthenticatedCopyWith<$Res> {
  220. _$UnauthenticatedCopyWithImpl(
  221. Unauthenticated _value, $Res Function(Unauthenticated) _then)
  222. : super(_value, (v) => _then(v as Unauthenticated));
  223. @override
  224. Unauthenticated get _value => super._value as Unauthenticated;
  225. @override
  226. $Res call({
  227. Object? error = freezed,
  228. }) {
  229. return _then(Unauthenticated(
  230. error == freezed
  231. ? _value.error
  232. : error // ignore: cast_nullable_to_non_nullable
  233. as FlowyError,
  234. ));
  235. }
  236. }
  237. /// @nodoc
  238. class _$Unauthenticated implements Unauthenticated {
  239. const _$Unauthenticated(this.error);
  240. @override
  241. final FlowyError error;
  242. @override
  243. String toString() {
  244. return 'AuthState.unauthenticated(error: $error)';
  245. }
  246. @override
  247. bool operator ==(dynamic other) {
  248. return identical(this, other) ||
  249. (other is Unauthenticated &&
  250. (identical(other.error, error) ||
  251. const DeepCollectionEquality().equals(other.error, error)));
  252. }
  253. @override
  254. int get hashCode =>
  255. runtimeType.hashCode ^ const DeepCollectionEquality().hash(error);
  256. @JsonKey(ignore: true)
  257. @override
  258. $UnauthenticatedCopyWith<Unauthenticated> get copyWith =>
  259. _$UnauthenticatedCopyWithImpl<Unauthenticated>(this, _$identity);
  260. @override
  261. @optionalTypeArgs
  262. TResult when<TResult extends Object?>({
  263. required TResult Function(UserProfile userProfile) authenticated,
  264. required TResult Function(FlowyError error) unauthenticated,
  265. required TResult Function() initial,
  266. }) {
  267. return unauthenticated(error);
  268. }
  269. @override
  270. @optionalTypeArgs
  271. TResult? whenOrNull<TResult extends Object?>({
  272. TResult Function(UserProfile userProfile)? authenticated,
  273. TResult Function(FlowyError error)? unauthenticated,
  274. TResult Function()? initial,
  275. }) {
  276. return unauthenticated?.call(error);
  277. }
  278. @override
  279. @optionalTypeArgs
  280. TResult maybeWhen<TResult extends Object?>({
  281. TResult Function(UserProfile userProfile)? authenticated,
  282. TResult Function(FlowyError error)? unauthenticated,
  283. TResult Function()? initial,
  284. required TResult orElse(),
  285. }) {
  286. if (unauthenticated != null) {
  287. return unauthenticated(error);
  288. }
  289. return orElse();
  290. }
  291. @override
  292. @optionalTypeArgs
  293. TResult map<TResult extends Object?>({
  294. required TResult Function(Authenticated value) authenticated,
  295. required TResult Function(Unauthenticated value) unauthenticated,
  296. required TResult Function(_Initial value) initial,
  297. }) {
  298. return unauthenticated(this);
  299. }
  300. @override
  301. @optionalTypeArgs
  302. TResult? mapOrNull<TResult extends Object?>({
  303. TResult Function(Authenticated value)? authenticated,
  304. TResult Function(Unauthenticated value)? unauthenticated,
  305. TResult Function(_Initial value)? initial,
  306. }) {
  307. return unauthenticated?.call(this);
  308. }
  309. @override
  310. @optionalTypeArgs
  311. TResult maybeMap<TResult extends Object?>({
  312. TResult Function(Authenticated value)? authenticated,
  313. TResult Function(Unauthenticated value)? unauthenticated,
  314. TResult Function(_Initial value)? initial,
  315. required TResult orElse(),
  316. }) {
  317. if (unauthenticated != null) {
  318. return unauthenticated(this);
  319. }
  320. return orElse();
  321. }
  322. }
  323. abstract class Unauthenticated implements AuthState {
  324. const factory Unauthenticated(FlowyError error) = _$Unauthenticated;
  325. FlowyError get error => throw _privateConstructorUsedError;
  326. @JsonKey(ignore: true)
  327. $UnauthenticatedCopyWith<Unauthenticated> get copyWith =>
  328. throw _privateConstructorUsedError;
  329. }
  330. /// @nodoc
  331. abstract class _$InitialCopyWith<$Res> {
  332. factory _$InitialCopyWith(_Initial value, $Res Function(_Initial) then) =
  333. __$InitialCopyWithImpl<$Res>;
  334. }
  335. /// @nodoc
  336. class __$InitialCopyWithImpl<$Res> extends _$AuthStateCopyWithImpl<$Res>
  337. implements _$InitialCopyWith<$Res> {
  338. __$InitialCopyWithImpl(_Initial _value, $Res Function(_Initial) _then)
  339. : super(_value, (v) => _then(v as _Initial));
  340. @override
  341. _Initial get _value => super._value as _Initial;
  342. }
  343. /// @nodoc
  344. class _$_Initial implements _Initial {
  345. const _$_Initial();
  346. @override
  347. String toString() {
  348. return 'AuthState.initial()';
  349. }
  350. @override
  351. bool operator ==(dynamic other) {
  352. return identical(this, other) || (other is _Initial);
  353. }
  354. @override
  355. int get hashCode => runtimeType.hashCode;
  356. @override
  357. @optionalTypeArgs
  358. TResult when<TResult extends Object?>({
  359. required TResult Function(UserProfile userProfile) authenticated,
  360. required TResult Function(FlowyError error) unauthenticated,
  361. required TResult Function() initial,
  362. }) {
  363. return initial();
  364. }
  365. @override
  366. @optionalTypeArgs
  367. TResult? whenOrNull<TResult extends Object?>({
  368. TResult Function(UserProfile userProfile)? authenticated,
  369. TResult Function(FlowyError error)? unauthenticated,
  370. TResult Function()? initial,
  371. }) {
  372. return initial?.call();
  373. }
  374. @override
  375. @optionalTypeArgs
  376. TResult maybeWhen<TResult extends Object?>({
  377. TResult Function(UserProfile userProfile)? authenticated,
  378. TResult Function(FlowyError error)? unauthenticated,
  379. TResult Function()? initial,
  380. required TResult orElse(),
  381. }) {
  382. if (initial != null) {
  383. return initial();
  384. }
  385. return orElse();
  386. }
  387. @override
  388. @optionalTypeArgs
  389. TResult map<TResult extends Object?>({
  390. required TResult Function(Authenticated value) authenticated,
  391. required TResult Function(Unauthenticated value) unauthenticated,
  392. required TResult Function(_Initial value) initial,
  393. }) {
  394. return initial(this);
  395. }
  396. @override
  397. @optionalTypeArgs
  398. TResult? mapOrNull<TResult extends Object?>({
  399. TResult Function(Authenticated value)? authenticated,
  400. TResult Function(Unauthenticated value)? unauthenticated,
  401. TResult Function(_Initial value)? initial,
  402. }) {
  403. return initial?.call(this);
  404. }
  405. @override
  406. @optionalTypeArgs
  407. TResult maybeMap<TResult extends Object?>({
  408. TResult Function(Authenticated value)? authenticated,
  409. TResult Function(Unauthenticated value)? unauthenticated,
  410. TResult Function(_Initial value)? initial,
  411. required TResult orElse(),
  412. }) {
  413. if (initial != null) {
  414. return initial(this);
  415. }
  416. return orElse();
  417. }
  418. }
  419. abstract class _Initial implements AuthState {
  420. const factory _Initial() = _$_Initial;
  421. }