forked from eatvio/eatvio_app
Merge pull request 'main' (#212) from mso7nueh/eatvio_app:main into main
Reviewed-on: eatvio/eatvio_app#212
This commit is contained in:
@@ -68,7 +68,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build apk
|
- name: Build apk
|
||||||
run: |
|
run: |
|
||||||
flutter build apk
|
flutter build apk --profile
|
||||||
|
|
||||||
- name: Rename and move apk
|
- name: Rename and move apk
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ jobs:
|
|||||||
run: flutter test
|
run: flutter test
|
||||||
|
|
||||||
- name: Build apk
|
- name: Build apk
|
||||||
run: flutter build apk --release
|
run: flutter build apk --profile
|
||||||
|
|
||||||
- name: Rename and move apk
|
- name: Rename and move apk
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
82
android/.kotlin/errors/errors-1737375866289.log
Normal file
82
android/.kotlin/errors/errors-1737375866289.log
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
kotlin version: 2.0.21
|
||||||
|
error message: Daemon compilation failed: null
|
||||||
|
java.lang.Exception
|
||||||
|
at org.jetbrains.kotlin.daemon.common.CompileService$CallResult$Error.get(CompileService.kt:69)
|
||||||
|
at org.jetbrains.kotlin.daemon.common.CompileService$CallResult$Error.get(CompileService.kt:65)
|
||||||
|
at org.jetbrains.kotlin.compilerRunner.GradleKotlinCompilerWork.compileWithDaemon(GradleKotlinCompilerWork.kt:240)
|
||||||
|
at org.jetbrains.kotlin.compilerRunner.GradleKotlinCompilerWork.compileWithDaemonOrFallbackImpl(GradleKotlinCompilerWork.kt:159)
|
||||||
|
at org.jetbrains.kotlin.compilerRunner.GradleKotlinCompilerWork.run(GradleKotlinCompilerWork.kt:111)
|
||||||
|
at org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction.execute(GradleCompilerRunnerWithWorkers.kt:76)
|
||||||
|
at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:63)
|
||||||
|
at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:66)
|
||||||
|
at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:62)
|
||||||
|
at org.gradle.internal.classloader.ClassLoaderUtils.executeInClassloader(ClassLoaderUtils.java:100)
|
||||||
|
at org.gradle.workers.internal.NoIsolationWorkerFactory$1.lambda$execute$0(NoIsolationWorkerFactory.java:62)
|
||||||
|
at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:44)
|
||||||
|
at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:41)
|
||||||
|
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:209)
|
||||||
|
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
|
||||||
|
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
|
||||||
|
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
|
||||||
|
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:166)
|
||||||
|
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
|
||||||
|
at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
|
||||||
|
at org.gradle.workers.internal.AbstractWorker.executeWrappedInBuildOperation(AbstractWorker.java:41)
|
||||||
|
at org.gradle.workers.internal.NoIsolationWorkerFactory$1.execute(NoIsolationWorkerFactory.java:59)
|
||||||
|
at org.gradle.workers.internal.DefaultWorkerExecutor.lambda$submitWork$0(DefaultWorkerExecutor.java:174)
|
||||||
|
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
|
||||||
|
at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runExecution(DefaultConditionalExecutionQueue.java:194)
|
||||||
|
at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.access$700(DefaultConditionalExecutionQueue.java:127)
|
||||||
|
at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner$1.run(DefaultConditionalExecutionQueue.java:169)
|
||||||
|
at org.gradle.internal.Factories$1.create(Factories.java:31)
|
||||||
|
at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:263)
|
||||||
|
at org.gradle.internal.work.DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:127)
|
||||||
|
at org.gradle.internal.work.DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:132)
|
||||||
|
at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runBatch(DefaultConditionalExecutionQueue.java:164)
|
||||||
|
at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.run(DefaultConditionalExecutionQueue.java:133)
|
||||||
|
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
|
||||||
|
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
|
||||||
|
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
|
||||||
|
at org.gradle.internal.concurrent.AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:48)
|
||||||
|
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
|
||||||
|
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
|
||||||
|
at java.base/java.lang.Thread.run(Unknown Source)
|
||||||
|
Caused by: java.nio.file.DirectoryNotEmptyException: C:\Users\Alex\AppData\Local\Temp\kotlin-backups16986209765282043117
|
||||||
|
at java.base/sun.nio.fs.WindowsFileSystemProvider.implDelete(Unknown Source)
|
||||||
|
at java.base/sun.nio.fs.AbstractFileSystemProvider.delete(Unknown Source)
|
||||||
|
at java.base/java.nio.file.Files.delete(Unknown Source)
|
||||||
|
at org.jetbrains.kotlin.incremental.RecoverableCompilationTransaction$cleanupStash$2$1$1.invoke(CompilationTransaction.kt:244)
|
||||||
|
at org.jetbrains.kotlin.incremental.RecoverableCompilationTransaction$cleanupStash$2$1$1.invoke(CompilationTransaction.kt:244)
|
||||||
|
at org.jetbrains.kotlin.incremental.RecoverableCompilationTransaction.cleanupStash$lambda$11$lambda$10$lambda$9(CompilationTransaction.kt:244)
|
||||||
|
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source)
|
||||||
|
at java.base/java.util.ArrayList.forEach(Unknown Source)
|
||||||
|
at java.base/java.util.stream.SortedOps$RefSortingSink.end(Unknown Source)
|
||||||
|
at java.base/java.util.stream.Sink$ChainedReference.end(Unknown Source)
|
||||||
|
at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
|
||||||
|
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
|
||||||
|
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source)
|
||||||
|
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source)
|
||||||
|
at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
|
||||||
|
at java.base/java.util.stream.ReferencePipeline.forEach(Unknown Source)
|
||||||
|
at org.jetbrains.kotlin.incremental.RecoverableCompilationTransaction.cleanupStash(CompilationTransaction.kt:244)
|
||||||
|
at org.jetbrains.kotlin.incremental.RecoverableCompilationTransaction.close(CompilationTransaction.kt:254)
|
||||||
|
at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.tryCompileIncrementally(IncrementalCompilerRunner.kt:747)
|
||||||
|
at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compile(IncrementalCompilerRunner.kt:120)
|
||||||
|
at org.jetbrains.kotlin.daemon.CompileServiceImplBase.execIncrementalCompiler(CompileServiceImpl.kt:675)
|
||||||
|
at org.jetbrains.kotlin.daemon.CompileServiceImplBase.access$execIncrementalCompiler(CompileServiceImpl.kt:92)
|
||||||
|
at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1660)
|
||||||
|
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source)
|
||||||
|
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
|
||||||
|
at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
|
||||||
|
at java.rmi/sun.rmi.transport.Transport$1.run(Unknown Source)
|
||||||
|
at java.rmi/sun.rmi.transport.Transport$1.run(Unknown Source)
|
||||||
|
at java.base/java.security.AccessController.doPrivileged(Unknown Source)
|
||||||
|
at java.rmi/sun.rmi.transport.Transport.serviceCall(Unknown Source)
|
||||||
|
at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
|
||||||
|
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)
|
||||||
|
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(Unknown Source)
|
||||||
|
at java.base/java.security.AccessController.doPrivileged(Unknown Source)
|
||||||
|
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
|
||||||
|
... 3 more
|
||||||
|
|
||||||
|
|
||||||
@@ -50,6 +50,9 @@ android {
|
|||||||
debug {
|
debug {
|
||||||
signingConfig signingConfigs.debug
|
signingConfig signingConfigs.debug
|
||||||
}
|
}
|
||||||
|
profile {
|
||||||
|
signingConfig signingConfigs.debug
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
package="com.eatvioapp.app">
|
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET"/>
|
<uses-permission android:name="android.permission.INTERNET"/>
|
||||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||||
|
|||||||
3
assets/icons/go_to_arrow.svg
Normal file
3
assets/icons/go_to_arrow.svg
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<svg width="8" height="8" viewBox="0 0 8 8" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M0.0747132 0.909366C0.113849 0.973406 0.199235 1.05523 0.263275 1.09793C0.380682 1.16908 0.426933 1.16908 3.18776 1.16908L5.99484 1.16908L3.21267 3.95126C0.188562 6.98248 0.316641 6.83661 0.377123 7.1746C0.409143 7.35249 0.647514 7.59086 0.825403 7.62288C1.16339 7.68336 1.01752 7.81144 4.04518 4.78733L6.83092 2.00516L6.83092 4.81224C6.83092 7.58018 6.83092 7.61932 6.90563 7.73673C7.01236 7.91461 7.17958 8 7.40728 8C7.63853 8 7.80219 7.9075 7.91248 7.71538C7.98719 7.59086 7.98719 7.54816 7.99787 4.09357C8.00498 1.61736 7.99431 0.553589 7.96585 0.446856C7.91604 0.261852 7.73815 0.0839639 7.55314 0.0341549C7.44641 0.00569296 6.38264 -0.00498009 3.90643 0.0021348C0.451837 0.0128083 0.409143 0.0128083 0.284622 0.0875216C0.0889444 0.20137 0 0.36147 0 0.596282C0 0.735035 0.0213466 0.831095 0.0747132 0.909366Z" fill="#323F4B"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 940 B |
@@ -28,6 +28,7 @@ import 'package:eatvio_app/features/diary/repositories/diary_repository.dart';
|
|||||||
import 'package:eatvio_app/features/diary/services/diary_service.dart';
|
import 'package:eatvio_app/features/diary/services/diary_service.dart';
|
||||||
import 'package:eatvio_app/features/diets/presentation/cubit/about_diet_cubit.dart';
|
import 'package:eatvio_app/features/diets/presentation/cubit/about_diet_cubit.dart';
|
||||||
import 'package:eatvio_app/features/feed/presentation/bloc/comments_cubit/comments_cubit.dart';
|
import 'package:eatvio_app/features/feed/presentation/bloc/comments_cubit/comments_cubit.dart';
|
||||||
|
import 'package:eatvio_app/features/feed/presentation/bloc/consultants_cubit/consultants_cubit.dart';
|
||||||
import 'package:eatvio_app/features/feed/presentation/bloc/diets_cubit/diets_cubit.dart';
|
import 'package:eatvio_app/features/feed/presentation/bloc/diets_cubit/diets_cubit.dart';
|
||||||
import 'package:eatvio_app/features/feed/presentation/bloc/feed_cubit/feed_cubit.dart';
|
import 'package:eatvio_app/features/feed/presentation/bloc/feed_cubit/feed_cubit.dart';
|
||||||
import 'package:eatvio_app/features/feed/presentation/bloc/profile_cubit/profile_cubit.dart';
|
import 'package:eatvio_app/features/feed/presentation/bloc/profile_cubit/profile_cubit.dart';
|
||||||
@@ -100,6 +101,7 @@ Future<void> init() async {
|
|||||||
sl.registerFactory<MyDietsCubit>(() => MyDietsCubit(myDietsRepository: sl()));
|
sl.registerFactory<MyDietsCubit>(() => MyDietsCubit(myDietsRepository: sl()));
|
||||||
sl.registerFactory<MyPlansCubit>(() => MyPlansCubit(myPlansRepository: sl()));
|
sl.registerFactory<MyPlansCubit>(() => MyPlansCubit(myPlansRepository: sl()));
|
||||||
sl.registerFactory<UserDetailsCubit>(() => UserDetailsCubit(profileRepository: sl()));
|
sl.registerFactory<UserDetailsCubit>(() => UserDetailsCubit(profileRepository: sl()));
|
||||||
|
sl.registerFactory<ConsultantsCubit>(() => ConsultantsCubit(feedRepository: sl()));
|
||||||
|
|
||||||
// Repository
|
// Repository
|
||||||
sl.registerLazySingleton<ChatRepository>(() => ChatRepository(chatService: sl()));
|
sl.registerLazySingleton<ChatRepository>(() => ChatRepository(chatService: sl()));
|
||||||
|
|||||||
@@ -310,11 +310,15 @@ class _BlogPostScreenState extends State<BlogPostScreen> {
|
|||||||
SizedBox(width: 8),
|
SizedBox(width: 8),
|
||||||
_iconButton(
|
_iconButton(
|
||||||
icon: Icons.reply_rounded,
|
icon: Icons.reply_rounded,
|
||||||
onTap: () => Share.shareUri(
|
onTap: () {
|
||||||
Uri.parse(
|
final box = context.findRenderObject() as RenderBox?;
|
||||||
baseUrl + '/ru/blog_post/' + widget.blogPost.id.toString(),
|
Share.shareUri(
|
||||||
),
|
Uri.parse(
|
||||||
),
|
baseUrl + '/ru/blog_post/' + widget.blogPost.id.toString(),
|
||||||
|
),
|
||||||
|
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
Spacer(),
|
Spacer(),
|
||||||
Icon(
|
Icon(
|
||||||
|
|||||||
@@ -9,11 +9,7 @@ part of 'blog_post_service.dart';
|
|||||||
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
||||||
|
|
||||||
class _BlogPostService implements BlogPostService {
|
class _BlogPostService implements BlogPostService {
|
||||||
_BlogPostService(
|
_BlogPostService(this._dio, {this.baseUrl, this.errorLogger});
|
||||||
this._dio, {
|
|
||||||
this.baseUrl,
|
|
||||||
this.errorLogger,
|
|
||||||
});
|
|
||||||
|
|
||||||
final Dio _dio;
|
final Dio _dio;
|
||||||
|
|
||||||
@@ -27,23 +23,21 @@ class _BlogPostService implements BlogPostService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
final _data = formData;
|
final _data = formData;
|
||||||
final _options = _setStreamType<void>(Options(
|
final _options = _setStreamType<void>(
|
||||||
method: 'POST',
|
Options(
|
||||||
headers: _headers,
|
method: 'POST',
|
||||||
extra: _extra,
|
headers: _headers,
|
||||||
contentType: 'multipart/form-data',
|
extra: _extra,
|
||||||
)
|
contentType: 'multipart/form-data',
|
||||||
.compose(
|
)
|
||||||
_dio.options,
|
.compose(
|
||||||
'/api/blogPosts/create',
|
_dio.options,
|
||||||
queryParameters: queryParameters,
|
'/api/blogPosts/create',
|
||||||
data: _data,
|
queryParameters: queryParameters,
|
||||||
)
|
data: _data,
|
||||||
.copyWith(
|
)
|
||||||
baseUrl: _combineBaseUrls(
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
_dio.options.baseUrl,
|
);
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
await _dio.fetch<void>(_options);
|
await _dio.fetch<void>(_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,23 +50,21 @@ class _BlogPostService implements BlogPostService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
final _data = formData;
|
final _data = formData;
|
||||||
final _options = _setStreamType<void>(Options(
|
final _options = _setStreamType<void>(
|
||||||
method: 'POST',
|
Options(
|
||||||
headers: _headers,
|
method: 'POST',
|
||||||
extra: _extra,
|
headers: _headers,
|
||||||
contentType: 'multipart/form-data',
|
extra: _extra,
|
||||||
)
|
contentType: 'multipart/form-data',
|
||||||
.compose(
|
)
|
||||||
_dio.options,
|
.compose(
|
||||||
'/api/blogPosts/update/${id}',
|
_dio.options,
|
||||||
queryParameters: queryParameters,
|
'/api/blogPosts/update/${id}',
|
||||||
data: _data,
|
queryParameters: queryParameters,
|
||||||
)
|
data: _data,
|
||||||
.copyWith(
|
)
|
||||||
baseUrl: _combineBaseUrls(
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
_dio.options.baseUrl,
|
);
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
await _dio.fetch<void>(_options);
|
await _dio.fetch<void>(_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,22 +74,16 @@ class _BlogPostService implements BlogPostService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<void>(Options(
|
final _options = _setStreamType<void>(
|
||||||
method: 'POST',
|
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/blogPosts/delete/${id}',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/blogPosts/delete/${id}',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
await _dio.fetch<void>(_options);
|
await _dio.fetch<void>(_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,10 +100,7 @@ class _BlogPostService implements BlogPostService {
|
|||||||
return requestOptions;
|
return requestOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
String _combineBaseUrls(
|
String _combineBaseUrls(String dioBaseUrl, String? baseUrl) {
|
||||||
String dioBaseUrl,
|
|
||||||
String? baseUrl,
|
|
||||||
) {
|
|
||||||
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
||||||
return dioBaseUrl;
|
return dioBaseUrl;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,11 +9,7 @@ part of 'calendar_service.dart';
|
|||||||
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
||||||
|
|
||||||
class _CalendarService implements CalendarService {
|
class _CalendarService implements CalendarService {
|
||||||
_CalendarService(
|
_CalendarService(this._dio, {this.baseUrl, this.errorLogger});
|
||||||
this._dio, {
|
|
||||||
this.baseUrl,
|
|
||||||
this.errorLogger,
|
|
||||||
});
|
|
||||||
|
|
||||||
final Dio _dio;
|
final Dio _dio;
|
||||||
|
|
||||||
@@ -27,27 +23,23 @@ class _CalendarService implements CalendarService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<List<CalendarModel>>(Options(
|
final _options = _setStreamType<List<CalendarModel>>(
|
||||||
method: 'GET',
|
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/calendar/index',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/calendar/index',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<List<dynamic>>(_options);
|
final _result = await _dio.fetch<List<dynamic>>(_options);
|
||||||
late List<CalendarModel> _value;
|
late List<CalendarModel> _value;
|
||||||
try {
|
try {
|
||||||
_value = _result.data!
|
_value = _result.data!
|
||||||
.map((dynamic i) => CalendarModel.fromJson(i as Map<String, dynamic>))
|
.map(
|
||||||
|
(dynamic i) => CalendarModel.fromJson(i as Map<String, dynamic>),
|
||||||
|
)
|
||||||
.toList();
|
.toList();
|
||||||
} on Object catch (e, s) {
|
} on Object catch (e, s) {
|
||||||
errorLogger?.logError(e, s, _options);
|
errorLogger?.logError(e, s, _options);
|
||||||
@@ -69,10 +61,7 @@ class _CalendarService implements CalendarService {
|
|||||||
return requestOptions;
|
return requestOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
String _combineBaseUrls(
|
String _combineBaseUrls(String dioBaseUrl, String? baseUrl) {
|
||||||
String dioBaseUrl,
|
|
||||||
String? baseUrl,
|
|
||||||
) {
|
|
||||||
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
||||||
return dioBaseUrl;
|
return dioBaseUrl;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,11 +9,7 @@ part of 'chat_service.dart';
|
|||||||
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
||||||
|
|
||||||
class _ChatService implements ChatService {
|
class _ChatService implements ChatService {
|
||||||
_ChatService(
|
_ChatService(this._dio, {this.baseUrl, this.errorLogger});
|
||||||
this._dio, {
|
|
||||||
this.baseUrl,
|
|
||||||
this.errorLogger,
|
|
||||||
});
|
|
||||||
|
|
||||||
final Dio _dio;
|
final Dio _dio;
|
||||||
|
|
||||||
@@ -28,22 +24,16 @@ class _ChatService implements ChatService {
|
|||||||
queryParameters.removeWhere((k, v) => v == null);
|
queryParameters.removeWhere((k, v) => v == null);
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<ChatRoomPreviewModel>(Options(
|
final _options = _setStreamType<ChatRoomPreviewModel>(
|
||||||
method: 'GET',
|
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/chat/index',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/chat/index',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||||
late ChatRoomPreviewModel _value;
|
late ChatRoomPreviewModel _value;
|
||||||
try {
|
try {
|
||||||
@@ -61,27 +51,23 @@ class _ChatService implements ChatService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<Map<String, ChatRoomModel>>(Options(
|
final _options = _setStreamType<Map<String, ChatRoomModel>>(
|
||||||
method: 'GET',
|
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/chat/show/${id}',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/chat/show/${id}',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||||
late Map<String, ChatRoomModel> _value;
|
late Map<String, ChatRoomModel> _value;
|
||||||
try {
|
try {
|
||||||
_value = _result.data!.map((k, dynamic v) =>
|
_value = _result.data!.map(
|
||||||
MapEntry(k, ChatRoomModel.fromJson(v as Map<String, dynamic>)));
|
(k, dynamic v) =>
|
||||||
|
MapEntry(k, ChatRoomModel.fromJson(v as Map<String, dynamic>)),
|
||||||
|
);
|
||||||
} on Object catch (e, s) {
|
} on Object catch (e, s) {
|
||||||
errorLogger?.logError(e, s, _options);
|
errorLogger?.logError(e, s, _options);
|
||||||
rethrow;
|
rethrow;
|
||||||
@@ -101,31 +87,26 @@ class _ChatService implements ChatService {
|
|||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
final _data = FormData();
|
final _data = FormData();
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
_data.fields.add(MapEntry(
|
_data.fields.add(MapEntry('data', data));
|
||||||
'data',
|
|
||||||
data,
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
if (media_data != null) {
|
if (media_data != null) {
|
||||||
_data.files.addAll(media_data.map((i) => MapEntry('media_data[]', i)));
|
_data.files.addAll(media_data.map((i) => MapEntry('media_data[]', i)));
|
||||||
}
|
}
|
||||||
final _options = _setStreamType<void>(Options(
|
final _options = _setStreamType<void>(
|
||||||
method: 'POST',
|
Options(
|
||||||
headers: _headers,
|
method: 'POST',
|
||||||
extra: _extra,
|
headers: _headers,
|
||||||
contentType: 'multipart/form-data',
|
extra: _extra,
|
||||||
)
|
contentType: 'multipart/form-data',
|
||||||
.compose(
|
)
|
||||||
_dio.options,
|
.compose(
|
||||||
'/api/chat/${id}/message/send',
|
_dio.options,
|
||||||
queryParameters: queryParameters,
|
'/api/chat/${id}/message/send',
|
||||||
data: _data,
|
queryParameters: queryParameters,
|
||||||
)
|
data: _data,
|
||||||
.copyWith(
|
)
|
||||||
baseUrl: _combineBaseUrls(
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
_dio.options.baseUrl,
|
);
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
await _dio.fetch<void>(_options);
|
await _dio.fetch<void>(_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,22 +119,16 @@ class _ChatService implements ChatService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<ChatMessagesModel>(Options(
|
final _options = _setStreamType<ChatMessagesModel>(
|
||||||
method: 'GET',
|
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/chat/show/${id}/messages?page=${page}',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/chat/show/${id}/messages?page=${page}',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||||
late ChatMessagesModel _value;
|
late ChatMessagesModel _value;
|
||||||
try {
|
try {
|
||||||
@@ -171,22 +146,16 @@ class _ChatService implements ChatService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<WebsocketInfoModel>(Options(
|
final _options = _setStreamType<WebsocketInfoModel>(
|
||||||
method: 'GET',
|
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/profile/ws/params',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/profile/ws/params',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||||
late WebsocketInfoModel _value;
|
late WebsocketInfoModel _value;
|
||||||
try {
|
try {
|
||||||
@@ -204,22 +173,16 @@ class _ChatService implements ChatService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<ChatRoomModel>(Options(
|
final _options = _setStreamType<ChatRoomModel>(
|
||||||
method: 'GET',
|
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/chat/get_by_user/${user}',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/chat/get_by_user/${user}',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||||
late ChatRoomModel _value;
|
late ChatRoomModel _value;
|
||||||
try {
|
try {
|
||||||
@@ -244,10 +207,7 @@ class _ChatService implements ChatService {
|
|||||||
return requestOptions;
|
return requestOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
String _combineBaseUrls(
|
String _combineBaseUrls(String dioBaseUrl, String? baseUrl) {
|
||||||
String dioBaseUrl,
|
|
||||||
String? baseUrl,
|
|
||||||
) {
|
|
||||||
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
||||||
return dioBaseUrl;
|
return dioBaseUrl;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,11 +9,7 @@ part of 'consultant_service.dart';
|
|||||||
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
||||||
|
|
||||||
class _ConsultantService implements ConsultantService {
|
class _ConsultantService implements ConsultantService {
|
||||||
_ConsultantService(
|
_ConsultantService(this._dio, {this.baseUrl, this.errorLogger});
|
||||||
this._dio, {
|
|
||||||
this.baseUrl,
|
|
||||||
this.errorLogger,
|
|
||||||
});
|
|
||||||
|
|
||||||
final Dio _dio;
|
final Dio _dio;
|
||||||
|
|
||||||
@@ -22,28 +18,23 @@ class _ConsultantService implements ConsultantService {
|
|||||||
final ParseErrorLogger? errorLogger;
|
final ParseErrorLogger? errorLogger;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> consultantRegistration(
|
Future<void> consultantRegistration({
|
||||||
{required ConsultantProfileModel consultantModel}) async {
|
required ConsultantProfileModel consultantModel,
|
||||||
|
}) async {
|
||||||
final _extra = <String, dynamic>{};
|
final _extra = <String, dynamic>{};
|
||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
final _data = consultantModel;
|
final _data = consultantModel;
|
||||||
final _options = _setStreamType<void>(Options(
|
final _options = _setStreamType<void>(
|
||||||
method: 'POST',
|
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/consultant_request/registration',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/consultant_request/registration',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
await _dio.fetch<void>(_options);
|
await _dio.fetch<void>(_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,23 +48,21 @@ class _ConsultantService implements ConsultantService {
|
|||||||
if (photos != null) {
|
if (photos != null) {
|
||||||
_data.files.addAll(photos.map((i) => MapEntry('photos[]', i)));
|
_data.files.addAll(photos.map((i) => MapEntry('photos[]', i)));
|
||||||
}
|
}
|
||||||
final _options = _setStreamType<List<String>>(Options(
|
final _options = _setStreamType<List<String>>(
|
||||||
method: 'POST',
|
Options(
|
||||||
headers: _headers,
|
method: 'POST',
|
||||||
extra: _extra,
|
headers: _headers,
|
||||||
contentType: 'multipart/form-data',
|
extra: _extra,
|
||||||
)
|
contentType: 'multipart/form-data',
|
||||||
.compose(
|
)
|
||||||
_dio.options,
|
.compose(
|
||||||
'/api/consultant_request/photos/upload',
|
_dio.options,
|
||||||
queryParameters: queryParameters,
|
'/api/consultant_request/photos/upload',
|
||||||
data: _data,
|
queryParameters: queryParameters,
|
||||||
)
|
data: _data,
|
||||||
.copyWith(
|
)
|
||||||
baseUrl: _combineBaseUrls(
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
_dio.options.baseUrl,
|
);
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<List<dynamic>>(_options);
|
final _result = await _dio.fetch<List<dynamic>>(_options);
|
||||||
late List<String> _value;
|
late List<String> _value;
|
||||||
try {
|
try {
|
||||||
@@ -98,10 +87,7 @@ class _ConsultantService implements ConsultantService {
|
|||||||
return requestOptions;
|
return requestOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
String _combineBaseUrls(
|
String _combineBaseUrls(String dioBaseUrl, String? baseUrl) {
|
||||||
String dioBaseUrl,
|
|
||||||
String? baseUrl,
|
|
||||||
) {
|
|
||||||
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
||||||
return dioBaseUrl;
|
return dioBaseUrl;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,11 +9,7 @@ part of 'create_diet_service.dart';
|
|||||||
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
||||||
|
|
||||||
class _CreateDietService implements CreateDietService {
|
class _CreateDietService implements CreateDietService {
|
||||||
_CreateDietService(
|
_CreateDietService(this._dio, {this.baseUrl, this.errorLogger});
|
||||||
this._dio, {
|
|
||||||
this.baseUrl,
|
|
||||||
this.errorLogger,
|
|
||||||
});
|
|
||||||
|
|
||||||
final Dio _dio;
|
final Dio _dio;
|
||||||
|
|
||||||
@@ -39,81 +35,57 @@ class _CreateDietService implements CreateDietService {
|
|||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
final _data = FormData();
|
final _data = FormData();
|
||||||
if (name != null) {
|
if (name != null) {
|
||||||
_data.fields.add(MapEntry(
|
_data.fields.add(MapEntry('name', name));
|
||||||
'name',
|
|
||||||
name,
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
if (duration != null) {
|
if (duration != null) {
|
||||||
_data.fields.add(MapEntry(
|
_data.fields.add(MapEntry('duration', duration.toString()));
|
||||||
'duration',
|
|
||||||
duration.toString(),
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
if (state != null) {
|
if (state != null) {
|
||||||
_data.fields.add(MapEntry(
|
_data.fields.add(MapEntry('state', state));
|
||||||
'state',
|
|
||||||
state,
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
if (meatType != null) {
|
if (meatType != null) {
|
||||||
_data.fields.add(MapEntry(
|
_data.fields.add(MapEntry('type[meat]', meatType));
|
||||||
'type[meat]',
|
|
||||||
meatType,
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
if (carbType != null) {
|
if (carbType != null) {
|
||||||
_data.fields.add(MapEntry(
|
_data.fields.add(MapEntry('type[carb]', carbType));
|
||||||
'type[carb]',
|
|
||||||
carbType,
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
if (vegType != null) {
|
if (vegType != null) {
|
||||||
_data.fields.add(MapEntry(
|
_data.fields.add(MapEntry('type[veg]', vegType));
|
||||||
'type[veg]',
|
|
||||||
vegType,
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
if (lightType != null) {
|
if (lightType != null) {
|
||||||
_data.fields.add(MapEntry(
|
_data.fields.add(MapEntry('type[light]', lightType));
|
||||||
'type[light]',
|
|
||||||
lightType,
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
if (details != null) {
|
if (details != null) {
|
||||||
_data.fields.add(MapEntry(
|
_data.fields.add(MapEntry('details', details));
|
||||||
'details',
|
|
||||||
details,
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
if (image != null) {
|
if (image != null) {
|
||||||
if (image != null) {
|
if (image != null) {
|
||||||
_data.files.add(MapEntry(
|
_data.files.add(
|
||||||
'image',
|
MapEntry(
|
||||||
MultipartFile.fromFileSync(
|
'image',
|
||||||
image.path,
|
MultipartFile.fromFileSync(
|
||||||
filename: image.path.split(Platform.pathSeparator).last,
|
image.path,
|
||||||
|
filename: image.path.split(Platform.pathSeparator).last,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
));
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
final _options = _setStreamType<CreatedDiet>(Options(
|
final _options = _setStreamType<CreatedDiet>(
|
||||||
method: 'POST',
|
Options(
|
||||||
headers: _headers,
|
method: 'POST',
|
||||||
extra: _extra,
|
headers: _headers,
|
||||||
contentType: 'multipart/form-data',
|
extra: _extra,
|
||||||
)
|
contentType: 'multipart/form-data',
|
||||||
.compose(
|
)
|
||||||
_dio.options,
|
.compose(
|
||||||
'/api/diets/create',
|
_dio.options,
|
||||||
queryParameters: queryParameters,
|
'/api/diets/create',
|
||||||
data: _data,
|
queryParameters: queryParameters,
|
||||||
)
|
data: _data,
|
||||||
.copyWith(
|
)
|
||||||
baseUrl: _combineBaseUrls(
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
_dio.options.baseUrl,
|
);
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||||
late CreatedDiet _value;
|
late CreatedDiet _value;
|
||||||
try {
|
try {
|
||||||
@@ -135,22 +107,16 @@ class _CreateDietService implements CreateDietService {
|
|||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
final _data = <String, dynamic>{};
|
final _data = <String, dynamic>{};
|
||||||
_data.addAll(model);
|
_data.addAll(model);
|
||||||
final _options = _setStreamType<void>(Options(
|
final _options = _setStreamType<void>(
|
||||||
method: 'POST',
|
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/diets/create/${id}/daily_schedule',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/diets/create/${id}/daily_schedule',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
await _dio.fetch<void>(_options);
|
await _dio.fetch<void>(_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -167,10 +133,7 @@ class _CreateDietService implements CreateDietService {
|
|||||||
return requestOptions;
|
return requestOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
String _combineBaseUrls(
|
String _combineBaseUrls(String dioBaseUrl, String? baseUrl) {
|
||||||
String dioBaseUrl,
|
|
||||||
String? baseUrl,
|
|
||||||
) {
|
|
||||||
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
||||||
return dioBaseUrl;
|
return dioBaseUrl;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,11 +9,7 @@ part of 'create_plan_service.dart';
|
|||||||
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
||||||
|
|
||||||
class _CreatePlanService implements CreatePlanService {
|
class _CreatePlanService implements CreatePlanService {
|
||||||
_CreatePlanService(
|
_CreatePlanService(this._dio, {this.baseUrl, this.errorLogger});
|
||||||
this._dio, {
|
|
||||||
this.baseUrl,
|
|
||||||
this.errorLogger,
|
|
||||||
});
|
|
||||||
|
|
||||||
final Dio _dio;
|
final Dio _dio;
|
||||||
|
|
||||||
@@ -28,23 +24,21 @@ class _CreatePlanService implements CreatePlanService {
|
|||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
final _data = <String, dynamic>{};
|
final _data = <String, dynamic>{};
|
||||||
_data.addAll(model);
|
_data.addAll(model);
|
||||||
final _options = _setStreamType<void>(Options(
|
final _options = _setStreamType<void>(
|
||||||
method: 'POST',
|
Options(
|
||||||
headers: _headers,
|
method: 'POST',
|
||||||
extra: _extra,
|
headers: _headers,
|
||||||
contentType: 'multipart/form-data',
|
extra: _extra,
|
||||||
)
|
contentType: 'multipart/form-data',
|
||||||
.compose(
|
)
|
||||||
_dio.options,
|
.compose(
|
||||||
'/api/plans/create',
|
_dio.options,
|
||||||
queryParameters: queryParameters,
|
'/api/plans/create',
|
||||||
data: _data,
|
queryParameters: queryParameters,
|
||||||
)
|
data: _data,
|
||||||
.copyWith(
|
)
|
||||||
baseUrl: _combineBaseUrls(
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
_dio.options.baseUrl,
|
);
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
await _dio.fetch<void>(_options);
|
await _dio.fetch<void>(_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,22 +52,16 @@ class _CreatePlanService implements CreatePlanService {
|
|||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
final _data = <String, dynamic>{};
|
final _data = <String, dynamic>{};
|
||||||
_data.addAll(model);
|
_data.addAll(model);
|
||||||
final _options = _setStreamType<void>(Options(
|
final _options = _setStreamType<void>(
|
||||||
method: 'POST',
|
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/plans/create/${slug}/packet_option',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/plans/create/${slug}/packet_option',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
await _dio.fetch<void>(_options);
|
await _dio.fetch<void>(_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,22 +75,16 @@ class _CreatePlanService implements CreatePlanService {
|
|||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
final _data = <String, dynamic>{};
|
final _data = <String, dynamic>{};
|
||||||
_data.addAll(model);
|
_data.addAll(model);
|
||||||
final _options = _setStreamType<void>(Options(
|
final _options = _setStreamType<void>(
|
||||||
method: 'POST',
|
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/plans/create/${slug}/packet_options',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/plans/create/${slug}/packet_options',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
await _dio.fetch<void>(_options);
|
await _dio.fetch<void>(_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -119,10 +101,7 @@ class _CreatePlanService implements CreatePlanService {
|
|||||||
return requestOptions;
|
return requestOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
String _combineBaseUrls(
|
String _combineBaseUrls(String dioBaseUrl, String? baseUrl) {
|
||||||
String dioBaseUrl,
|
|
||||||
String? baseUrl,
|
|
||||||
) {
|
|
||||||
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
||||||
return dioBaseUrl;
|
return dioBaseUrl;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,11 +9,7 @@ part of 'diary_service.dart';
|
|||||||
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
||||||
|
|
||||||
class _DiaryService implements DiaryService {
|
class _DiaryService implements DiaryService {
|
||||||
_DiaryService(
|
_DiaryService(this._dio, {this.baseUrl, this.errorLogger});
|
||||||
this._dio, {
|
|
||||||
this.baseUrl,
|
|
||||||
this.errorLogger,
|
|
||||||
});
|
|
||||||
|
|
||||||
final Dio _dio;
|
final Dio _dio;
|
||||||
|
|
||||||
@@ -22,33 +18,30 @@ class _DiaryService implements DiaryService {
|
|||||||
final ParseErrorLogger? errorLogger;
|
final ParseErrorLogger? errorLogger;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<List<DiaryDayModel>> getDiaryIndexByDate(
|
Future<List<DiaryDayModel>> getDiaryIndexByDate({
|
||||||
{required String date}) async {
|
required String date,
|
||||||
|
}) async {
|
||||||
final _extra = <String, dynamic>{};
|
final _extra = <String, dynamic>{};
|
||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<List<DiaryDayModel>>(Options(
|
final _options = _setStreamType<List<DiaryDayModel>>(
|
||||||
method: 'GET',
|
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/diary/index/${date}',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/diary/index/${date}',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<List<dynamic>>(_options);
|
final _result = await _dio.fetch<List<dynamic>>(_options);
|
||||||
late List<DiaryDayModel> _value;
|
late List<DiaryDayModel> _value;
|
||||||
try {
|
try {
|
||||||
_value = _result.data!
|
_value = _result.data!
|
||||||
.map((dynamic i) => DiaryDayModel.fromJson(i as Map<String, dynamic>))
|
.map(
|
||||||
|
(dynamic i) => DiaryDayModel.fromJson(i as Map<String, dynamic>),
|
||||||
|
)
|
||||||
.toList();
|
.toList();
|
||||||
} on Object catch (e, s) {
|
} on Object catch (e, s) {
|
||||||
errorLogger?.logError(e, s, _options);
|
errorLogger?.logError(e, s, _options);
|
||||||
@@ -63,22 +56,16 @@ class _DiaryService implements DiaryService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<DiaryDayWrapperModel>(Options(
|
final _options = _setStreamType<DiaryDayWrapperModel>(
|
||||||
method: 'GET',
|
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/diary/${diary}/show',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/diary/${diary}/show',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||||
late DiaryDayWrapperModel _value;
|
late DiaryDayWrapperModel _value;
|
||||||
try {
|
try {
|
||||||
@@ -96,22 +83,16 @@ class _DiaryService implements DiaryService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<NutritionDataModel>(Options(
|
final _options = _setStreamType<NutritionDataModel>(
|
||||||
method: 'GET',
|
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/diary/${diary}/dailyNutritionData',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/diary/${diary}/dailyNutritionData',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||||
late NutritionDataModel _value;
|
late NutritionDataModel _value;
|
||||||
try {
|
try {
|
||||||
@@ -133,30 +114,30 @@ class _DiaryService implements DiaryService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
final _data = FormData();
|
final _data = FormData();
|
||||||
_data.files.add(MapEntry(
|
_data.files.add(
|
||||||
'photo',
|
MapEntry(
|
||||||
MultipartFile.fromFileSync(
|
'photo',
|
||||||
photo.path,
|
MultipartFile.fromFileSync(
|
||||||
filename: photo.path.split(Platform.pathSeparator).last,
|
photo.path,
|
||||||
|
filename: photo.path.split(Platform.pathSeparator).last,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
));
|
);
|
||||||
final _options = _setStreamType<void>(Options(
|
final _options = _setStreamType<void>(
|
||||||
method: 'POST',
|
Options(
|
||||||
headers: _headers,
|
method: 'POST',
|
||||||
extra: _extra,
|
headers: _headers,
|
||||||
contentType: 'multipart/form-data',
|
extra: _extra,
|
||||||
)
|
contentType: 'multipart/form-data',
|
||||||
.compose(
|
)
|
||||||
_dio.options,
|
.compose(
|
||||||
'/api/diary/${diary}/meals/${typeNo}/photo/upload',
|
_dio.options,
|
||||||
queryParameters: queryParameters,
|
'/api/diary/${diary}/meals/${typeNo}/photo/upload',
|
||||||
data: _data,
|
queryParameters: queryParameters,
|
||||||
)
|
data: _data,
|
||||||
.copyWith(
|
)
|
||||||
baseUrl: _combineBaseUrls(
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
_dio.options.baseUrl,
|
);
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
await _dio.fetch<void>(_options);
|
await _dio.fetch<void>(_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -170,22 +151,16 @@ class _DiaryService implements DiaryService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<void>(Options(
|
final _options = _setStreamType<void>(
|
||||||
method: 'DELETE',
|
Options(method: 'DELETE', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/diary/${diaryId}/meals/${typeNo}/photo/${userAttachment}/delete',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/diary/${diaryId}/meals/${typeNo}/photo/${userAttachment}/delete',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
await _dio.fetch<void>(_options);
|
await _dio.fetch<void>(_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -203,40 +178,27 @@ class _DiaryService implements DiaryService {
|
|||||||
queryParameters.removeWhere((k, v) => v == null);
|
queryParameters.removeWhere((k, v) => v == null);
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
final _data = FormData();
|
final _data = FormData();
|
||||||
_data.fields.add(MapEntry(
|
_data.fields.add(MapEntry('product_name', productName));
|
||||||
'product_name',
|
_data.fields.add(MapEntry('portion', portion));
|
||||||
productName,
|
_data.fields.add(MapEntry('quantity', quantity.toString()));
|
||||||
));
|
|
||||||
_data.fields.add(MapEntry(
|
|
||||||
'portion',
|
|
||||||
portion,
|
|
||||||
));
|
|
||||||
_data.fields.add(MapEntry(
|
|
||||||
'quantity',
|
|
||||||
quantity.toString(),
|
|
||||||
));
|
|
||||||
if (productNutritionalValueId != null) {
|
if (productNutritionalValueId != null) {
|
||||||
_data.fields.add(MapEntry(
|
_data.fields.add(
|
||||||
'product_nutritional_value_id',
|
MapEntry(
|
||||||
productNutritionalValueId.toString(),
|
'product_nutritional_value_id',
|
||||||
));
|
productNutritionalValueId.toString(),
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
final _options = _setStreamType<void>(Options(
|
final _options = _setStreamType<void>(
|
||||||
method: 'POST',
|
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/diary/${diary}/meals/${typeNo}/portion/create',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/diary/${diary}/meals/${typeNo}/portion/create',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
await _dio.fetch<void>(_options);
|
await _dio.fetch<void>(_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -252,22 +214,16 @@ class _DiaryService implements DiaryService {
|
|||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
final _data = <String, dynamic>{};
|
final _data = <String, dynamic>{};
|
||||||
_data.addAll(productInMeal);
|
_data.addAll(productInMeal);
|
||||||
final _options = _setStreamType<void>(Options(
|
final _options = _setStreamType<void>(
|
||||||
method: 'PUT',
|
Options(method: 'PUT', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/diary/${diary}/meals/${typeNo}/portions/${portionModel}/update',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/diary/${diary}/meals/${typeNo}/portions/${portionModel}/update',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
await _dio.fetch<void>(_options);
|
await _dio.fetch<void>(_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -281,22 +237,16 @@ class _DiaryService implements DiaryService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<void>(Options(
|
final _options = _setStreamType<void>(
|
||||||
method: 'POST',
|
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/diary/${diary}/meals/${typeNo}/${portionModel}/mark_eaten',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/diary/${diary}/meals/${typeNo}/${portionModel}/mark_eaten',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
await _dio.fetch<void>(_options);
|
await _dio.fetch<void>(_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -310,22 +260,16 @@ class _DiaryService implements DiaryService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<void>(Options(
|
final _options = _setStreamType<void>(
|
||||||
method: 'POST',
|
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/diary/${diary}/meals/${typeNo}/${portionModel}/unmark_eaten',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/diary/${diary}/meals/${typeNo}/${portionModel}/unmark_eaten',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
await _dio.fetch<void>(_options);
|
await _dio.fetch<void>(_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -339,22 +283,16 @@ class _DiaryService implements DiaryService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<void>(Options(
|
final _options = _setStreamType<void>(
|
||||||
method: 'POST',
|
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/diary/${diary}/meals/${typeNo}/portions/${portionModel}/restore',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/diary/${diary}/meals/${typeNo}/portions/${portionModel}/restore',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
await _dio.fetch<void>(_options);
|
await _dio.fetch<void>(_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -368,22 +306,16 @@ class _DiaryService implements DiaryService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<void>(Options(
|
final _options = _setStreamType<void>(
|
||||||
method: 'DELETE',
|
Options(method: 'DELETE', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/diary/${diary}/meals/${typeNo}/portions/${portionModel}/delete',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/diary/${diary}/meals/${typeNo}/portions/${portionModel}/delete',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
await _dio.fetch<void>(_options);
|
await _dio.fetch<void>(_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -396,22 +328,16 @@ class _DiaryService implements DiaryService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
final _data = finishDiaryDayModel;
|
final _data = finishDiaryDayModel;
|
||||||
final _options = _setStreamType<void>(Options(
|
final _options = _setStreamType<void>(
|
||||||
method: 'POST',
|
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/diary/${diary}/finishDay',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/diary/${diary}/finishDay',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
await _dio.fetch<void>(_options);
|
await _dio.fetch<void>(_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -425,22 +351,16 @@ class _DiaryService implements DiaryService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
final _data = {'satiety': satiety};
|
final _data = {'satiety': satiety};
|
||||||
final _options = _setStreamType<void>(Options(
|
final _options = _setStreamType<void>(
|
||||||
method: 'POST',
|
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/diary/${diary}/meals/${typeNo}/satiety/fill',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/diary/${diary}/meals/${typeNo}/satiety/fill',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
await _dio.fetch<void>(_options);
|
await _dio.fetch<void>(_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -454,49 +374,38 @@ class _DiaryService implements DiaryService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
final _data = {'time': time};
|
final _data = {'time': time};
|
||||||
final _options = _setStreamType<void>(Options(
|
final _options = _setStreamType<void>(
|
||||||
method: 'POST',
|
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/diary/${diary}/meals/${typeNo}/time/fill',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/diary/${diary}/meals/${typeNo}/time/fill',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
await _dio.fetch<void>(_options);
|
await _dio.fetch<void>(_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<GlossaryModerationModel> sendProductToModeration(
|
Future<GlossaryModerationModel> sendProductToModeration({
|
||||||
{required Map<String, dynamic> data}) async {
|
required Map<String, dynamic> data,
|
||||||
|
}) async {
|
||||||
final _extra = <String, dynamic>{};
|
final _extra = <String, dynamic>{};
|
||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
final _data = <String, dynamic>{};
|
final _data = <String, dynamic>{};
|
||||||
_data.addAll(data);
|
_data.addAll(data);
|
||||||
final _options = _setStreamType<GlossaryModerationModel>(Options(
|
final _options = _setStreamType<GlossaryModerationModel>(
|
||||||
method: 'POST',
|
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/diary/product_nutritional_values/sendToModeration',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/diary/product_nutritional_values/sendToModeration',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||||
late GlossaryModerationModel _value;
|
late GlossaryModerationModel _value;
|
||||||
try {
|
try {
|
||||||
@@ -521,10 +430,7 @@ class _DiaryService implements DiaryService {
|
|||||||
return requestOptions;
|
return requestOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
String _combineBaseUrls(
|
String _combineBaseUrls(String dioBaseUrl, String? baseUrl) {
|
||||||
String dioBaseUrl,
|
|
||||||
String? baseUrl,
|
|
||||||
) {
|
|
||||||
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
||||||
return dioBaseUrl;
|
return dioBaseUrl;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,8 +13,10 @@ import 'package:share_plus/share_plus.dart';
|
|||||||
|
|
||||||
class MoreOptions extends StatelessWidget {
|
class MoreOptions extends StatelessWidget {
|
||||||
const MoreOptions({super.key, this.disableActions, required this.path});
|
const MoreOptions({super.key, this.disableActions, required this.path});
|
||||||
|
|
||||||
final String path;
|
final String path;
|
||||||
final bool? disableActions;
|
final bool? disableActions;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final s = S.of(context);
|
final s = S.of(context);
|
||||||
@@ -52,11 +54,15 @@ class MoreOptions extends StatelessWidget {
|
|||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: disableActions == true
|
onTap: disableActions == true
|
||||||
? null
|
? null
|
||||||
: () => Share.shareUri(
|
: () {
|
||||||
|
final box = context.findRenderObject() as RenderBox?;
|
||||||
|
Share.shareUri(
|
||||||
Uri.parse(
|
Uri.parse(
|
||||||
'$baseUrl/ru/$path',
|
'$baseUrl/ru/$path',
|
||||||
),
|
),
|
||||||
),
|
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
|
||||||
|
);
|
||||||
|
},
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
|
|||||||
@@ -9,11 +9,7 @@ part of 'diet_service.dart';
|
|||||||
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
||||||
|
|
||||||
class _DietService implements DietService {
|
class _DietService implements DietService {
|
||||||
_DietService(
|
_DietService(this._dio, {this.baseUrl, this.errorLogger});
|
||||||
this._dio, {
|
|
||||||
this.baseUrl,
|
|
||||||
this.errorLogger,
|
|
||||||
});
|
|
||||||
|
|
||||||
final Dio _dio;
|
final Dio _dio;
|
||||||
|
|
||||||
@@ -27,22 +23,16 @@ class _DietService implements DietService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<DietLikesModel>(Options(
|
final _options = _setStreamType<DietLikesModel>(
|
||||||
method: 'POST',
|
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/diets/${id}/like',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/diets/${id}/like',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||||
late DietLikesModel _value;
|
late DietLikesModel _value;
|
||||||
try {
|
try {
|
||||||
@@ -60,22 +50,16 @@ class _DietService implements DietService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<Diet>(Options(
|
final _options = _setStreamType<Diet>(
|
||||||
method: 'POST',
|
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/diets/${id}/add_to_favorite',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/diets/${id}/add_to_favorite',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||||
late Diet _value;
|
late Diet _value;
|
||||||
try {
|
try {
|
||||||
@@ -93,22 +77,16 @@ class _DietService implements DietService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<Diet>(Options(
|
final _options = _setStreamType<Diet>(
|
||||||
method: 'POST',
|
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/diets/${id}/remove_from_favorite',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/diets/${id}/remove_from_favorite',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||||
late Diet _value;
|
late Diet _value;
|
||||||
try {
|
try {
|
||||||
@@ -126,22 +104,16 @@ class _DietService implements DietService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<Diet>(Options(
|
final _options = _setStreamType<Diet>(
|
||||||
method: 'GET',
|
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/diets/show/${id}',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/diets/show/${id}',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||||
late Diet _value;
|
late Diet _value;
|
||||||
try {
|
try {
|
||||||
@@ -166,10 +138,7 @@ class _DietService implements DietService {
|
|||||||
return requestOptions;
|
return requestOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
String _combineBaseUrls(
|
String _combineBaseUrls(String dioBaseUrl, String? baseUrl) {
|
||||||
String dioBaseUrl,
|
|
||||||
String? baseUrl,
|
|
||||||
) {
|
|
||||||
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
||||||
return dioBaseUrl;
|
return dioBaseUrl;
|
||||||
}
|
}
|
||||||
|
|||||||
30
lib/features/feed/models/feed_consultant_model.dart
Normal file
30
lib/features/feed/models/feed_consultant_model.dart
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
import 'package:eatvio_app/core/models/pagination_model.dart';
|
||||||
|
import 'package:eatvio_app/features/profile/models/badge_model.dart';
|
||||||
|
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||||
|
|
||||||
|
part 'feed_consultant_model.freezed.dart';
|
||||||
|
part 'feed_consultant_model.g.dart';
|
||||||
|
|
||||||
|
@freezed
|
||||||
|
class FeedConsultantPaginationModel with _$FeedConsultantPaginationModel {
|
||||||
|
const factory FeedConsultantPaginationModel({
|
||||||
|
required List<FeedConsultantModel> data,
|
||||||
|
required Links links,
|
||||||
|
required Meta meta,
|
||||||
|
}) = _FeedConsultantPaginationModel;
|
||||||
|
|
||||||
|
factory FeedConsultantPaginationModel.fromJson(Map<String, Object?> json) => _$FeedConsultantPaginationModelFromJson(json);
|
||||||
|
}
|
||||||
|
|
||||||
|
@freezed
|
||||||
|
class FeedConsultantModel with _$FeedConsultantModel {
|
||||||
|
const factory FeedConsultantModel({
|
||||||
|
required String slug,
|
||||||
|
required String name,
|
||||||
|
@JsonKey(name: 'rating_place') required int ratingPlace,
|
||||||
|
@JsonKey(name: 'profile_photo_url') required String photo,
|
||||||
|
required List<BadgeModel> badges,
|
||||||
|
}) = _FeedConsultantModel;
|
||||||
|
|
||||||
|
factory FeedConsultantModel.fromJson(Map<String, Object?> json) => _$FeedConsultantModelFromJson(json);
|
||||||
|
}
|
||||||
499
lib/features/feed/models/feed_consultant_model.freezed.dart
Normal file
499
lib/features/feed/models/feed_consultant_model.freezed.dart
Normal file
@@ -0,0 +1,499 @@
|
|||||||
|
// coverage:ignore-file
|
||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
// ignore_for_file: type=lint
|
||||||
|
// 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, unnecessary_question_mark
|
||||||
|
|
||||||
|
part of 'feed_consultant_model.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// FreezedGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
T _$identity<T>(T value) => value;
|
||||||
|
|
||||||
|
final _privateConstructorUsedError = UnsupportedError(
|
||||||
|
'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 information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||||
|
|
||||||
|
FeedConsultantPaginationModel _$FeedConsultantPaginationModelFromJson(
|
||||||
|
Map<String, dynamic> json) {
|
||||||
|
return _FeedConsultantPaginationModel.fromJson(json);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
mixin _$FeedConsultantPaginationModel {
|
||||||
|
List<FeedConsultantModel> get data => throw _privateConstructorUsedError;
|
||||||
|
Links get links => throw _privateConstructorUsedError;
|
||||||
|
Meta get meta => throw _privateConstructorUsedError;
|
||||||
|
|
||||||
|
/// Serializes this FeedConsultantPaginationModel to a JSON map.
|
||||||
|
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||||
|
|
||||||
|
/// Create a copy of FeedConsultantPaginationModel
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
$FeedConsultantPaginationModelCopyWith<FeedConsultantPaginationModel>
|
||||||
|
get copyWith => throw _privateConstructorUsedError;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
abstract class $FeedConsultantPaginationModelCopyWith<$Res> {
|
||||||
|
factory $FeedConsultantPaginationModelCopyWith(
|
||||||
|
FeedConsultantPaginationModel value,
|
||||||
|
$Res Function(FeedConsultantPaginationModel) then) =
|
||||||
|
_$FeedConsultantPaginationModelCopyWithImpl<$Res,
|
||||||
|
FeedConsultantPaginationModel>;
|
||||||
|
@useResult
|
||||||
|
$Res call({List<FeedConsultantModel> data, Links links, Meta meta});
|
||||||
|
|
||||||
|
$LinksCopyWith<$Res> get links;
|
||||||
|
$MetaCopyWith<$Res> get meta;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
class _$FeedConsultantPaginationModelCopyWithImpl<$Res,
|
||||||
|
$Val extends FeedConsultantPaginationModel>
|
||||||
|
implements $FeedConsultantPaginationModelCopyWith<$Res> {
|
||||||
|
_$FeedConsultantPaginationModelCopyWithImpl(this._value, this._then);
|
||||||
|
|
||||||
|
// ignore: unused_field
|
||||||
|
final $Val _value;
|
||||||
|
// ignore: unused_field
|
||||||
|
final $Res Function($Val) _then;
|
||||||
|
|
||||||
|
/// Create a copy of FeedConsultantPaginationModel
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
@override
|
||||||
|
$Res call({
|
||||||
|
Object? data = null,
|
||||||
|
Object? links = null,
|
||||||
|
Object? meta = null,
|
||||||
|
}) {
|
||||||
|
return _then(_value.copyWith(
|
||||||
|
data: null == data
|
||||||
|
? _value.data
|
||||||
|
: data // ignore: cast_nullable_to_non_nullable
|
||||||
|
as List<FeedConsultantModel>,
|
||||||
|
links: null == links
|
||||||
|
? _value.links
|
||||||
|
: links // ignore: cast_nullable_to_non_nullable
|
||||||
|
as Links,
|
||||||
|
meta: null == meta
|
||||||
|
? _value.meta
|
||||||
|
: meta // ignore: cast_nullable_to_non_nullable
|
||||||
|
as Meta,
|
||||||
|
) as $Val);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Create a copy of FeedConsultantPaginationModel
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@override
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
$LinksCopyWith<$Res> get links {
|
||||||
|
return $LinksCopyWith<$Res>(_value.links, (value) {
|
||||||
|
return _then(_value.copyWith(links: value) as $Val);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Create a copy of FeedConsultantPaginationModel
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@override
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
$MetaCopyWith<$Res> get meta {
|
||||||
|
return $MetaCopyWith<$Res>(_value.meta, (value) {
|
||||||
|
return _then(_value.copyWith(meta: value) as $Val);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
abstract class _$$FeedConsultantPaginationModelImplCopyWith<$Res>
|
||||||
|
implements $FeedConsultantPaginationModelCopyWith<$Res> {
|
||||||
|
factory _$$FeedConsultantPaginationModelImplCopyWith(
|
||||||
|
_$FeedConsultantPaginationModelImpl value,
|
||||||
|
$Res Function(_$FeedConsultantPaginationModelImpl) then) =
|
||||||
|
__$$FeedConsultantPaginationModelImplCopyWithImpl<$Res>;
|
||||||
|
@override
|
||||||
|
@useResult
|
||||||
|
$Res call({List<FeedConsultantModel> data, Links links, Meta meta});
|
||||||
|
|
||||||
|
@override
|
||||||
|
$LinksCopyWith<$Res> get links;
|
||||||
|
@override
|
||||||
|
$MetaCopyWith<$Res> get meta;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
class __$$FeedConsultantPaginationModelImplCopyWithImpl<$Res>
|
||||||
|
extends _$FeedConsultantPaginationModelCopyWithImpl<$Res,
|
||||||
|
_$FeedConsultantPaginationModelImpl>
|
||||||
|
implements _$$FeedConsultantPaginationModelImplCopyWith<$Res> {
|
||||||
|
__$$FeedConsultantPaginationModelImplCopyWithImpl(
|
||||||
|
_$FeedConsultantPaginationModelImpl _value,
|
||||||
|
$Res Function(_$FeedConsultantPaginationModelImpl) _then)
|
||||||
|
: super(_value, _then);
|
||||||
|
|
||||||
|
/// Create a copy of FeedConsultantPaginationModel
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
@override
|
||||||
|
$Res call({
|
||||||
|
Object? data = null,
|
||||||
|
Object? links = null,
|
||||||
|
Object? meta = null,
|
||||||
|
}) {
|
||||||
|
return _then(_$FeedConsultantPaginationModelImpl(
|
||||||
|
data: null == data
|
||||||
|
? _value._data
|
||||||
|
: data // ignore: cast_nullable_to_non_nullable
|
||||||
|
as List<FeedConsultantModel>,
|
||||||
|
links: null == links
|
||||||
|
? _value.links
|
||||||
|
: links // ignore: cast_nullable_to_non_nullable
|
||||||
|
as Links,
|
||||||
|
meta: null == meta
|
||||||
|
? _value.meta
|
||||||
|
: meta // ignore: cast_nullable_to_non_nullable
|
||||||
|
as Meta,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
@JsonSerializable()
|
||||||
|
class _$FeedConsultantPaginationModelImpl
|
||||||
|
implements _FeedConsultantPaginationModel {
|
||||||
|
const _$FeedConsultantPaginationModelImpl(
|
||||||
|
{required final List<FeedConsultantModel> data,
|
||||||
|
required this.links,
|
||||||
|
required this.meta})
|
||||||
|
: _data = data;
|
||||||
|
|
||||||
|
factory _$FeedConsultantPaginationModelImpl.fromJson(
|
||||||
|
Map<String, dynamic> json) =>
|
||||||
|
_$$FeedConsultantPaginationModelImplFromJson(json);
|
||||||
|
|
||||||
|
final List<FeedConsultantModel> _data;
|
||||||
|
@override
|
||||||
|
List<FeedConsultantModel> get data {
|
||||||
|
if (_data is EqualUnmodifiableListView) return _data;
|
||||||
|
// ignore: implicit_dynamic_type
|
||||||
|
return EqualUnmodifiableListView(_data);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
final Links links;
|
||||||
|
@override
|
||||||
|
final Meta meta;
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return 'FeedConsultantPaginationModel(data: $data, links: $links, meta: $meta)';
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) {
|
||||||
|
return identical(this, other) ||
|
||||||
|
(other.runtimeType == runtimeType &&
|
||||||
|
other is _$FeedConsultantPaginationModelImpl &&
|
||||||
|
const DeepCollectionEquality().equals(other._data, _data) &&
|
||||||
|
(identical(other.links, links) || other.links == links) &&
|
||||||
|
(identical(other.meta, meta) || other.meta == meta));
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
@override
|
||||||
|
int get hashCode => Object.hash(
|
||||||
|
runtimeType, const DeepCollectionEquality().hash(_data), links, meta);
|
||||||
|
|
||||||
|
/// Create a copy of FeedConsultantPaginationModel
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
@override
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
_$$FeedConsultantPaginationModelImplCopyWith<
|
||||||
|
_$FeedConsultantPaginationModelImpl>
|
||||||
|
get copyWith => __$$FeedConsultantPaginationModelImplCopyWithImpl<
|
||||||
|
_$FeedConsultantPaginationModelImpl>(this, _$identity);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
return _$$FeedConsultantPaginationModelImplToJson(
|
||||||
|
this,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class _FeedConsultantPaginationModel
|
||||||
|
implements FeedConsultantPaginationModel {
|
||||||
|
const factory _FeedConsultantPaginationModel(
|
||||||
|
{required final List<FeedConsultantModel> data,
|
||||||
|
required final Links links,
|
||||||
|
required final Meta meta}) = _$FeedConsultantPaginationModelImpl;
|
||||||
|
|
||||||
|
factory _FeedConsultantPaginationModel.fromJson(Map<String, dynamic> json) =
|
||||||
|
_$FeedConsultantPaginationModelImpl.fromJson;
|
||||||
|
|
||||||
|
@override
|
||||||
|
List<FeedConsultantModel> get data;
|
||||||
|
@override
|
||||||
|
Links get links;
|
||||||
|
@override
|
||||||
|
Meta get meta;
|
||||||
|
|
||||||
|
/// Create a copy of FeedConsultantPaginationModel
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@override
|
||||||
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
_$$FeedConsultantPaginationModelImplCopyWith<
|
||||||
|
_$FeedConsultantPaginationModelImpl>
|
||||||
|
get copyWith => throw _privateConstructorUsedError;
|
||||||
|
}
|
||||||
|
|
||||||
|
FeedConsultantModel _$FeedConsultantModelFromJson(Map<String, dynamic> json) {
|
||||||
|
return _FeedConsultantModel.fromJson(json);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
mixin _$FeedConsultantModel {
|
||||||
|
String get slug => throw _privateConstructorUsedError;
|
||||||
|
String get name => throw _privateConstructorUsedError;
|
||||||
|
@JsonKey(name: 'rating_place')
|
||||||
|
int get ratingPlace => throw _privateConstructorUsedError;
|
||||||
|
@JsonKey(name: 'profile_photo_url')
|
||||||
|
String get photo => throw _privateConstructorUsedError;
|
||||||
|
List<BadgeModel> get badges => throw _privateConstructorUsedError;
|
||||||
|
|
||||||
|
/// Serializes this FeedConsultantModel to a JSON map.
|
||||||
|
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||||
|
|
||||||
|
/// Create a copy of FeedConsultantModel
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
$FeedConsultantModelCopyWith<FeedConsultantModel> get copyWith =>
|
||||||
|
throw _privateConstructorUsedError;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
abstract class $FeedConsultantModelCopyWith<$Res> {
|
||||||
|
factory $FeedConsultantModelCopyWith(
|
||||||
|
FeedConsultantModel value, $Res Function(FeedConsultantModel) then) =
|
||||||
|
_$FeedConsultantModelCopyWithImpl<$Res, FeedConsultantModel>;
|
||||||
|
@useResult
|
||||||
|
$Res call(
|
||||||
|
{String slug,
|
||||||
|
String name,
|
||||||
|
@JsonKey(name: 'rating_place') int ratingPlace,
|
||||||
|
@JsonKey(name: 'profile_photo_url') String photo,
|
||||||
|
List<BadgeModel> badges});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
class _$FeedConsultantModelCopyWithImpl<$Res, $Val extends FeedConsultantModel>
|
||||||
|
implements $FeedConsultantModelCopyWith<$Res> {
|
||||||
|
_$FeedConsultantModelCopyWithImpl(this._value, this._then);
|
||||||
|
|
||||||
|
// ignore: unused_field
|
||||||
|
final $Val _value;
|
||||||
|
// ignore: unused_field
|
||||||
|
final $Res Function($Val) _then;
|
||||||
|
|
||||||
|
/// Create a copy of FeedConsultantModel
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
@override
|
||||||
|
$Res call({
|
||||||
|
Object? slug = null,
|
||||||
|
Object? name = null,
|
||||||
|
Object? ratingPlace = null,
|
||||||
|
Object? photo = null,
|
||||||
|
Object? badges = null,
|
||||||
|
}) {
|
||||||
|
return _then(_value.copyWith(
|
||||||
|
slug: null == slug
|
||||||
|
? _value.slug
|
||||||
|
: slug // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,
|
||||||
|
name: null == name
|
||||||
|
? _value.name
|
||||||
|
: name // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,
|
||||||
|
ratingPlace: null == ratingPlace
|
||||||
|
? _value.ratingPlace
|
||||||
|
: ratingPlace // ignore: cast_nullable_to_non_nullable
|
||||||
|
as int,
|
||||||
|
photo: null == photo
|
||||||
|
? _value.photo
|
||||||
|
: photo // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,
|
||||||
|
badges: null == badges
|
||||||
|
? _value.badges
|
||||||
|
: badges // ignore: cast_nullable_to_non_nullable
|
||||||
|
as List<BadgeModel>,
|
||||||
|
) as $Val);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
abstract class _$$FeedConsultantModelImplCopyWith<$Res>
|
||||||
|
implements $FeedConsultantModelCopyWith<$Res> {
|
||||||
|
factory _$$FeedConsultantModelImplCopyWith(_$FeedConsultantModelImpl value,
|
||||||
|
$Res Function(_$FeedConsultantModelImpl) then) =
|
||||||
|
__$$FeedConsultantModelImplCopyWithImpl<$Res>;
|
||||||
|
@override
|
||||||
|
@useResult
|
||||||
|
$Res call(
|
||||||
|
{String slug,
|
||||||
|
String name,
|
||||||
|
@JsonKey(name: 'rating_place') int ratingPlace,
|
||||||
|
@JsonKey(name: 'profile_photo_url') String photo,
|
||||||
|
List<BadgeModel> badges});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
class __$$FeedConsultantModelImplCopyWithImpl<$Res>
|
||||||
|
extends _$FeedConsultantModelCopyWithImpl<$Res, _$FeedConsultantModelImpl>
|
||||||
|
implements _$$FeedConsultantModelImplCopyWith<$Res> {
|
||||||
|
__$$FeedConsultantModelImplCopyWithImpl(_$FeedConsultantModelImpl _value,
|
||||||
|
$Res Function(_$FeedConsultantModelImpl) _then)
|
||||||
|
: super(_value, _then);
|
||||||
|
|
||||||
|
/// Create a copy of FeedConsultantModel
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
@override
|
||||||
|
$Res call({
|
||||||
|
Object? slug = null,
|
||||||
|
Object? name = null,
|
||||||
|
Object? ratingPlace = null,
|
||||||
|
Object? photo = null,
|
||||||
|
Object? badges = null,
|
||||||
|
}) {
|
||||||
|
return _then(_$FeedConsultantModelImpl(
|
||||||
|
slug: null == slug
|
||||||
|
? _value.slug
|
||||||
|
: slug // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,
|
||||||
|
name: null == name
|
||||||
|
? _value.name
|
||||||
|
: name // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,
|
||||||
|
ratingPlace: null == ratingPlace
|
||||||
|
? _value.ratingPlace
|
||||||
|
: ratingPlace // ignore: cast_nullable_to_non_nullable
|
||||||
|
as int,
|
||||||
|
photo: null == photo
|
||||||
|
? _value.photo
|
||||||
|
: photo // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,
|
||||||
|
badges: null == badges
|
||||||
|
? _value._badges
|
||||||
|
: badges // ignore: cast_nullable_to_non_nullable
|
||||||
|
as List<BadgeModel>,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
@JsonSerializable()
|
||||||
|
class _$FeedConsultantModelImpl implements _FeedConsultantModel {
|
||||||
|
const _$FeedConsultantModelImpl(
|
||||||
|
{required this.slug,
|
||||||
|
required this.name,
|
||||||
|
@JsonKey(name: 'rating_place') required this.ratingPlace,
|
||||||
|
@JsonKey(name: 'profile_photo_url') required this.photo,
|
||||||
|
required final List<BadgeModel> badges})
|
||||||
|
: _badges = badges;
|
||||||
|
|
||||||
|
factory _$FeedConsultantModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||||
|
_$$FeedConsultantModelImplFromJson(json);
|
||||||
|
|
||||||
|
@override
|
||||||
|
final String slug;
|
||||||
|
@override
|
||||||
|
final String name;
|
||||||
|
@override
|
||||||
|
@JsonKey(name: 'rating_place')
|
||||||
|
final int ratingPlace;
|
||||||
|
@override
|
||||||
|
@JsonKey(name: 'profile_photo_url')
|
||||||
|
final String photo;
|
||||||
|
final List<BadgeModel> _badges;
|
||||||
|
@override
|
||||||
|
List<BadgeModel> get badges {
|
||||||
|
if (_badges is EqualUnmodifiableListView) return _badges;
|
||||||
|
// ignore: implicit_dynamic_type
|
||||||
|
return EqualUnmodifiableListView(_badges);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return 'FeedConsultantModel(slug: $slug, name: $name, ratingPlace: $ratingPlace, photo: $photo, badges: $badges)';
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) {
|
||||||
|
return identical(this, other) ||
|
||||||
|
(other.runtimeType == runtimeType &&
|
||||||
|
other is _$FeedConsultantModelImpl &&
|
||||||
|
(identical(other.slug, slug) || other.slug == slug) &&
|
||||||
|
(identical(other.name, name) || other.name == name) &&
|
||||||
|
(identical(other.ratingPlace, ratingPlace) ||
|
||||||
|
other.ratingPlace == ratingPlace) &&
|
||||||
|
(identical(other.photo, photo) || other.photo == photo) &&
|
||||||
|
const DeepCollectionEquality().equals(other._badges, _badges));
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
@override
|
||||||
|
int get hashCode => Object.hash(runtimeType, slug, name, ratingPlace, photo,
|
||||||
|
const DeepCollectionEquality().hash(_badges));
|
||||||
|
|
||||||
|
/// Create a copy of FeedConsultantModel
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
@override
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
_$$FeedConsultantModelImplCopyWith<_$FeedConsultantModelImpl> get copyWith =>
|
||||||
|
__$$FeedConsultantModelImplCopyWithImpl<_$FeedConsultantModelImpl>(
|
||||||
|
this, _$identity);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
return _$$FeedConsultantModelImplToJson(
|
||||||
|
this,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class _FeedConsultantModel implements FeedConsultantModel {
|
||||||
|
const factory _FeedConsultantModel(
|
||||||
|
{required final String slug,
|
||||||
|
required final String name,
|
||||||
|
@JsonKey(name: 'rating_place') required final int ratingPlace,
|
||||||
|
@JsonKey(name: 'profile_photo_url') required final String photo,
|
||||||
|
required final List<BadgeModel> badges}) = _$FeedConsultantModelImpl;
|
||||||
|
|
||||||
|
factory _FeedConsultantModel.fromJson(Map<String, dynamic> json) =
|
||||||
|
_$FeedConsultantModelImpl.fromJson;
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get slug;
|
||||||
|
@override
|
||||||
|
String get name;
|
||||||
|
@override
|
||||||
|
@JsonKey(name: 'rating_place')
|
||||||
|
int get ratingPlace;
|
||||||
|
@override
|
||||||
|
@JsonKey(name: 'profile_photo_url')
|
||||||
|
String get photo;
|
||||||
|
@override
|
||||||
|
List<BadgeModel> get badges;
|
||||||
|
|
||||||
|
/// Create a copy of FeedConsultantModel
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@override
|
||||||
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
_$$FeedConsultantModelImplCopyWith<_$FeedConsultantModelImpl> get copyWith =>
|
||||||
|
throw _privateConstructorUsedError;
|
||||||
|
}
|
||||||
48
lib/features/feed/models/feed_consultant_model.g.dart
Normal file
48
lib/features/feed/models/feed_consultant_model.g.dart
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'feed_consultant_model.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// JsonSerializableGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
_$FeedConsultantPaginationModelImpl
|
||||||
|
_$$FeedConsultantPaginationModelImplFromJson(Map<String, dynamic> json) =>
|
||||||
|
_$FeedConsultantPaginationModelImpl(
|
||||||
|
data: (json['data'] as List<dynamic>)
|
||||||
|
.map((e) =>
|
||||||
|
FeedConsultantModel.fromJson(e as Map<String, dynamic>))
|
||||||
|
.toList(),
|
||||||
|
links: Links.fromJson(json['links'] as Map<String, dynamic>),
|
||||||
|
meta: Meta.fromJson(json['meta'] as Map<String, dynamic>),
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> _$$FeedConsultantPaginationModelImplToJson(
|
||||||
|
_$FeedConsultantPaginationModelImpl instance) =>
|
||||||
|
<String, dynamic>{
|
||||||
|
'data': instance.data,
|
||||||
|
'links': instance.links,
|
||||||
|
'meta': instance.meta,
|
||||||
|
};
|
||||||
|
|
||||||
|
_$FeedConsultantModelImpl _$$FeedConsultantModelImplFromJson(
|
||||||
|
Map<String, dynamic> json) =>
|
||||||
|
_$FeedConsultantModelImpl(
|
||||||
|
slug: json['slug'] as String,
|
||||||
|
name: json['name'] as String,
|
||||||
|
ratingPlace: (json['rating_place'] as num).toInt(),
|
||||||
|
photo: json['profile_photo_url'] as String,
|
||||||
|
badges: (json['badges'] as List<dynamic>)
|
||||||
|
.map((e) => BadgeModel.fromJson(e as Map<String, dynamic>))
|
||||||
|
.toList(),
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> _$$FeedConsultantModelImplToJson(
|
||||||
|
_$FeedConsultantModelImpl instance) =>
|
||||||
|
<String, dynamic>{
|
||||||
|
'slug': instance.slug,
|
||||||
|
'name': instance.name,
|
||||||
|
'rating_place': instance.ratingPlace,
|
||||||
|
'profile_photo_url': instance.photo,
|
||||||
|
'badges': instance.badges,
|
||||||
|
};
|
||||||
@@ -21,6 +21,8 @@ class Recipes with _$Recipes {
|
|||||||
required String type,
|
required String type,
|
||||||
required String slug,
|
required String slug,
|
||||||
@JsonKey(name: 'total_comments') required int commentsCount,
|
@JsonKey(name: 'total_comments') required int commentsCount,
|
||||||
|
@JsonKey(name: 'was_liked_by_me') required bool wasLikedByMe,
|
||||||
|
@JsonKey(name: 'energy_per_serving') required double calories,
|
||||||
@JsonKey(name: 'total_likes') required int likesCount,
|
@JsonKey(name: 'total_likes') required int likesCount,
|
||||||
@JsonKey(name: 'total_views') required int viewsCount,
|
@JsonKey(name: 'total_views') required int viewsCount,
|
||||||
required Author author,
|
required Author author,
|
||||||
|
|||||||
@@ -39,6 +39,10 @@ mixin _$Recipes {
|
|||||||
String get slug => throw _privateConstructorUsedError;
|
String get slug => throw _privateConstructorUsedError;
|
||||||
@JsonKey(name: 'total_comments')
|
@JsonKey(name: 'total_comments')
|
||||||
int get commentsCount => throw _privateConstructorUsedError;
|
int get commentsCount => throw _privateConstructorUsedError;
|
||||||
|
@JsonKey(name: 'was_liked_by_me')
|
||||||
|
bool get wasLikedByMe => throw _privateConstructorUsedError;
|
||||||
|
@JsonKey(name: 'energy_per_serving')
|
||||||
|
double get calories => throw _privateConstructorUsedError;
|
||||||
@JsonKey(name: 'total_likes')
|
@JsonKey(name: 'total_likes')
|
||||||
int get likesCount => throw _privateConstructorUsedError;
|
int get likesCount => throw _privateConstructorUsedError;
|
||||||
@JsonKey(name: 'total_views')
|
@JsonKey(name: 'total_views')
|
||||||
@@ -74,6 +78,8 @@ abstract class $RecipesCopyWith<$Res> {
|
|||||||
String type,
|
String type,
|
||||||
String slug,
|
String slug,
|
||||||
@JsonKey(name: 'total_comments') int commentsCount,
|
@JsonKey(name: 'total_comments') int commentsCount,
|
||||||
|
@JsonKey(name: 'was_liked_by_me') bool wasLikedByMe,
|
||||||
|
@JsonKey(name: 'energy_per_serving') double calories,
|
||||||
@JsonKey(name: 'total_likes') int likesCount,
|
@JsonKey(name: 'total_likes') int likesCount,
|
||||||
@JsonKey(name: 'total_views') int viewsCount,
|
@JsonKey(name: 'total_views') int viewsCount,
|
||||||
Author author});
|
Author author});
|
||||||
@@ -110,6 +116,8 @@ class _$RecipesCopyWithImpl<$Res, $Val extends Recipes>
|
|||||||
Object? type = null,
|
Object? type = null,
|
||||||
Object? slug = null,
|
Object? slug = null,
|
||||||
Object? commentsCount = null,
|
Object? commentsCount = null,
|
||||||
|
Object? wasLikedByMe = null,
|
||||||
|
Object? calories = null,
|
||||||
Object? likesCount = null,
|
Object? likesCount = null,
|
||||||
Object? viewsCount = null,
|
Object? viewsCount = null,
|
||||||
Object? author = null,
|
Object? author = null,
|
||||||
@@ -171,6 +179,14 @@ class _$RecipesCopyWithImpl<$Res, $Val extends Recipes>
|
|||||||
? _value.commentsCount
|
? _value.commentsCount
|
||||||
: commentsCount // ignore: cast_nullable_to_non_nullable
|
: commentsCount // ignore: cast_nullable_to_non_nullable
|
||||||
as int,
|
as int,
|
||||||
|
wasLikedByMe: null == wasLikedByMe
|
||||||
|
? _value.wasLikedByMe
|
||||||
|
: wasLikedByMe // ignore: cast_nullable_to_non_nullable
|
||||||
|
as bool,
|
||||||
|
calories: null == calories
|
||||||
|
? _value.calories
|
||||||
|
: calories // ignore: cast_nullable_to_non_nullable
|
||||||
|
as double,
|
||||||
likesCount: null == likesCount
|
likesCount: null == likesCount
|
||||||
? _value.likesCount
|
? _value.likesCount
|
||||||
: likesCount // ignore: cast_nullable_to_non_nullable
|
: likesCount // ignore: cast_nullable_to_non_nullable
|
||||||
@@ -219,6 +235,8 @@ abstract class _$$RecipesImplCopyWith<$Res> implements $RecipesCopyWith<$Res> {
|
|||||||
String type,
|
String type,
|
||||||
String slug,
|
String slug,
|
||||||
@JsonKey(name: 'total_comments') int commentsCount,
|
@JsonKey(name: 'total_comments') int commentsCount,
|
||||||
|
@JsonKey(name: 'was_liked_by_me') bool wasLikedByMe,
|
||||||
|
@JsonKey(name: 'energy_per_serving') double calories,
|
||||||
@JsonKey(name: 'total_likes') int likesCount,
|
@JsonKey(name: 'total_likes') int likesCount,
|
||||||
@JsonKey(name: 'total_views') int viewsCount,
|
@JsonKey(name: 'total_views') int viewsCount,
|
||||||
Author author});
|
Author author});
|
||||||
@@ -254,6 +272,8 @@ class __$$RecipesImplCopyWithImpl<$Res>
|
|||||||
Object? type = null,
|
Object? type = null,
|
||||||
Object? slug = null,
|
Object? slug = null,
|
||||||
Object? commentsCount = null,
|
Object? commentsCount = null,
|
||||||
|
Object? wasLikedByMe = null,
|
||||||
|
Object? calories = null,
|
||||||
Object? likesCount = null,
|
Object? likesCount = null,
|
||||||
Object? viewsCount = null,
|
Object? viewsCount = null,
|
||||||
Object? author = null,
|
Object? author = null,
|
||||||
@@ -315,6 +335,14 @@ class __$$RecipesImplCopyWithImpl<$Res>
|
|||||||
? _value.commentsCount
|
? _value.commentsCount
|
||||||
: commentsCount // ignore: cast_nullable_to_non_nullable
|
: commentsCount // ignore: cast_nullable_to_non_nullable
|
||||||
as int,
|
as int,
|
||||||
|
wasLikedByMe: null == wasLikedByMe
|
||||||
|
? _value.wasLikedByMe
|
||||||
|
: wasLikedByMe // ignore: cast_nullable_to_non_nullable
|
||||||
|
as bool,
|
||||||
|
calories: null == calories
|
||||||
|
? _value.calories
|
||||||
|
: calories // ignore: cast_nullable_to_non_nullable
|
||||||
|
as double,
|
||||||
likesCount: null == likesCount
|
likesCount: null == likesCount
|
||||||
? _value.likesCount
|
? _value.likesCount
|
||||||
: likesCount // ignore: cast_nullable_to_non_nullable
|
: likesCount // ignore: cast_nullable_to_non_nullable
|
||||||
@@ -349,6 +377,8 @@ class _$RecipesImpl implements _Recipes {
|
|||||||
required this.type,
|
required this.type,
|
||||||
required this.slug,
|
required this.slug,
|
||||||
@JsonKey(name: 'total_comments') required this.commentsCount,
|
@JsonKey(name: 'total_comments') required this.commentsCount,
|
||||||
|
@JsonKey(name: 'was_liked_by_me') required this.wasLikedByMe,
|
||||||
|
@JsonKey(name: 'energy_per_serving') required this.calories,
|
||||||
@JsonKey(name: 'total_likes') required this.likesCount,
|
@JsonKey(name: 'total_likes') required this.likesCount,
|
||||||
@JsonKey(name: 'total_views') required this.viewsCount,
|
@JsonKey(name: 'total_views') required this.viewsCount,
|
||||||
required this.author})
|
required this.author})
|
||||||
@@ -404,6 +434,12 @@ class _$RecipesImpl implements _Recipes {
|
|||||||
@JsonKey(name: 'total_comments')
|
@JsonKey(name: 'total_comments')
|
||||||
final int commentsCount;
|
final int commentsCount;
|
||||||
@override
|
@override
|
||||||
|
@JsonKey(name: 'was_liked_by_me')
|
||||||
|
final bool wasLikedByMe;
|
||||||
|
@override
|
||||||
|
@JsonKey(name: 'energy_per_serving')
|
||||||
|
final double calories;
|
||||||
|
@override
|
||||||
@JsonKey(name: 'total_likes')
|
@JsonKey(name: 'total_likes')
|
||||||
final int likesCount;
|
final int likesCount;
|
||||||
@override
|
@override
|
||||||
@@ -414,7 +450,7 @@ class _$RecipesImpl implements _Recipes {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'Recipes(id: $id, image: $image, state: $state, cookingTime: $cookingTime, ingredients: $ingredients, description: $description, steps: $steps, videoUrl: $videoUrl, createdAt: $createdAt, updatedAt: $updatedAt, title: $title, type: $type, slug: $slug, commentsCount: $commentsCount, likesCount: $likesCount, viewsCount: $viewsCount, author: $author)';
|
return 'Recipes(id: $id, image: $image, state: $state, cookingTime: $cookingTime, ingredients: $ingredients, description: $description, steps: $steps, videoUrl: $videoUrl, createdAt: $createdAt, updatedAt: $updatedAt, title: $title, type: $type, slug: $slug, commentsCount: $commentsCount, wasLikedByMe: $wasLikedByMe, calories: $calories, likesCount: $likesCount, viewsCount: $viewsCount, author: $author)';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -443,6 +479,10 @@ class _$RecipesImpl implements _Recipes {
|
|||||||
(identical(other.slug, slug) || other.slug == slug) &&
|
(identical(other.slug, slug) || other.slug == slug) &&
|
||||||
(identical(other.commentsCount, commentsCount) ||
|
(identical(other.commentsCount, commentsCount) ||
|
||||||
other.commentsCount == commentsCount) &&
|
other.commentsCount == commentsCount) &&
|
||||||
|
(identical(other.wasLikedByMe, wasLikedByMe) ||
|
||||||
|
other.wasLikedByMe == wasLikedByMe) &&
|
||||||
|
(identical(other.calories, calories) ||
|
||||||
|
other.calories == calories) &&
|
||||||
(identical(other.likesCount, likesCount) ||
|
(identical(other.likesCount, likesCount) ||
|
||||||
other.likesCount == likesCount) &&
|
other.likesCount == likesCount) &&
|
||||||
(identical(other.viewsCount, viewsCount) ||
|
(identical(other.viewsCount, viewsCount) ||
|
||||||
@@ -452,25 +492,28 @@ class _$RecipesImpl implements _Recipes {
|
|||||||
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
@override
|
@override
|
||||||
int get hashCode => Object.hash(
|
int get hashCode => Object.hashAll([
|
||||||
runtimeType,
|
runtimeType,
|
||||||
id,
|
id,
|
||||||
image,
|
image,
|
||||||
state,
|
state,
|
||||||
cookingTime,
|
cookingTime,
|
||||||
const DeepCollectionEquality().hash(_ingredients),
|
const DeepCollectionEquality().hash(_ingredients),
|
||||||
description,
|
description,
|
||||||
const DeepCollectionEquality().hash(_steps),
|
const DeepCollectionEquality().hash(_steps),
|
||||||
videoUrl,
|
videoUrl,
|
||||||
createdAt,
|
createdAt,
|
||||||
updatedAt,
|
updatedAt,
|
||||||
title,
|
title,
|
||||||
type,
|
type,
|
||||||
slug,
|
slug,
|
||||||
commentsCount,
|
commentsCount,
|
||||||
likesCount,
|
wasLikedByMe,
|
||||||
viewsCount,
|
calories,
|
||||||
author);
|
likesCount,
|
||||||
|
viewsCount,
|
||||||
|
author
|
||||||
|
]);
|
||||||
|
|
||||||
/// Create a copy of Recipes
|
/// Create a copy of Recipes
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@@ -504,6 +547,8 @@ abstract class _Recipes implements Recipes {
|
|||||||
required final String type,
|
required final String type,
|
||||||
required final String slug,
|
required final String slug,
|
||||||
@JsonKey(name: 'total_comments') required final int commentsCount,
|
@JsonKey(name: 'total_comments') required final int commentsCount,
|
||||||
|
@JsonKey(name: 'was_liked_by_me') required final bool wasLikedByMe,
|
||||||
|
@JsonKey(name: 'energy_per_serving') required final double calories,
|
||||||
@JsonKey(name: 'total_likes') required final int likesCount,
|
@JsonKey(name: 'total_likes') required final int likesCount,
|
||||||
@JsonKey(name: 'total_views') required final int viewsCount,
|
@JsonKey(name: 'total_views') required final int viewsCount,
|
||||||
required final Author author}) = _$RecipesImpl;
|
required final Author author}) = _$RecipesImpl;
|
||||||
@@ -544,6 +589,12 @@ abstract class _Recipes implements Recipes {
|
|||||||
@JsonKey(name: 'total_comments')
|
@JsonKey(name: 'total_comments')
|
||||||
int get commentsCount;
|
int get commentsCount;
|
||||||
@override
|
@override
|
||||||
|
@JsonKey(name: 'was_liked_by_me')
|
||||||
|
bool get wasLikedByMe;
|
||||||
|
@override
|
||||||
|
@JsonKey(name: 'energy_per_serving')
|
||||||
|
double get calories;
|
||||||
|
@override
|
||||||
@JsonKey(name: 'total_likes')
|
@JsonKey(name: 'total_likes')
|
||||||
int get likesCount;
|
int get likesCount;
|
||||||
@override
|
@override
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ _$RecipesImpl _$$RecipesImplFromJson(Map<String, dynamic> json) =>
|
|||||||
type: json['type'] as String,
|
type: json['type'] as String,
|
||||||
slug: json['slug'] as String,
|
slug: json['slug'] as String,
|
||||||
commentsCount: (json['total_comments'] as num).toInt(),
|
commentsCount: (json['total_comments'] as num).toInt(),
|
||||||
|
wasLikedByMe: json['was_liked_by_me'] as bool,
|
||||||
|
calories: (json['energy_per_serving'] as num).toDouble(),
|
||||||
likesCount: (json['total_likes'] as num).toInt(),
|
likesCount: (json['total_likes'] as num).toInt(),
|
||||||
viewsCount: (json['total_views'] as num).toInt(),
|
viewsCount: (json['total_views'] as num).toInt(),
|
||||||
author: Author.fromJson(json['author'] as Map<String, dynamic>),
|
author: Author.fromJson(json['author'] as Map<String, dynamic>),
|
||||||
@@ -47,6 +49,8 @@ Map<String, dynamic> _$$RecipesImplToJson(_$RecipesImpl instance) =>
|
|||||||
'type': instance.type,
|
'type': instance.type,
|
||||||
'slug': instance.slug,
|
'slug': instance.slug,
|
||||||
'total_comments': instance.commentsCount,
|
'total_comments': instance.commentsCount,
|
||||||
|
'was_liked_by_me': instance.wasLikedByMe,
|
||||||
|
'energy_per_serving': instance.calories,
|
||||||
'total_likes': instance.likesCount,
|
'total_likes': instance.likesCount,
|
||||||
'total_views': instance.viewsCount,
|
'total_views': instance.viewsCount,
|
||||||
'author': instance.author,
|
'author': instance.author,
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
import 'package:eatvio_app/features/feed/presentation/bloc/consultants_cubit/consultants_state.dart';
|
||||||
|
import 'package:eatvio_app/features/feed/repositories/feed_repository.dart';
|
||||||
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
|
|
||||||
|
class ConsultantsCubit extends Cubit<ConsultantsState> {
|
||||||
|
final FeedRepository feedRepository;
|
||||||
|
|
||||||
|
ConsultantsCubit({
|
||||||
|
required this.feedRepository,
|
||||||
|
}) : super(ConsultantsState());
|
||||||
|
|
||||||
|
getConsultants() async {
|
||||||
|
emit(ConsultantsState.loading());
|
||||||
|
try {
|
||||||
|
emit(
|
||||||
|
ConsultantsState.loaded(
|
||||||
|
consultantsList: await feedRepository.getConsultants(),
|
||||||
|
isLoading: false,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
} catch (e) {
|
||||||
|
emit(ConsultantsState.error(errorMessage: e.toString()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
import 'package:eatvio_app/features/feed/models/feed_consultant_model.dart';
|
||||||
|
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||||
|
|
||||||
|
part 'consultants_state.freezed.dart';
|
||||||
|
|
||||||
|
@freezed
|
||||||
|
abstract class ConsultantsState with _$ConsultantsState {
|
||||||
|
const factory ConsultantsState() = _ConsultantsState;
|
||||||
|
|
||||||
|
const factory ConsultantsState.loading() = ConsultantsStateLoading;
|
||||||
|
|
||||||
|
const factory ConsultantsState.loaded({
|
||||||
|
required List<FeedConsultantModel> consultantsList,
|
||||||
|
required bool isLoading,
|
||||||
|
}) = ConsultantsStateLoaded;
|
||||||
|
|
||||||
|
const factory ConsultantsState.error({
|
||||||
|
required String errorMessage,
|
||||||
|
}) = ConsultantsStateError;
|
||||||
|
}
|
||||||
@@ -0,0 +1,686 @@
|
|||||||
|
// coverage:ignore-file
|
||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
// ignore_for_file: type=lint
|
||||||
|
// 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, unnecessary_question_mark
|
||||||
|
|
||||||
|
part of 'consultants_state.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// FreezedGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
T _$identity<T>(T value) => value;
|
||||||
|
|
||||||
|
final _privateConstructorUsedError = UnsupportedError(
|
||||||
|
'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 information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
mixin _$ConsultantsState {
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult when<TResult extends Object?>(
|
||||||
|
TResult Function() $default, {
|
||||||
|
required TResult Function() loading,
|
||||||
|
required TResult Function(
|
||||||
|
List<FeedConsultantModel> consultantsList, bool isLoading)
|
||||||
|
loaded,
|
||||||
|
required TResult Function(String errorMessage) error,
|
||||||
|
}) =>
|
||||||
|
throw _privateConstructorUsedError;
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult? whenOrNull<TResult extends Object?>(
|
||||||
|
TResult? Function()? $default, {
|
||||||
|
TResult? Function()? loading,
|
||||||
|
TResult? Function(
|
||||||
|
List<FeedConsultantModel> consultantsList, bool isLoading)?
|
||||||
|
loaded,
|
||||||
|
TResult? Function(String errorMessage)? error,
|
||||||
|
}) =>
|
||||||
|
throw _privateConstructorUsedError;
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult maybeWhen<TResult extends Object?>(
|
||||||
|
TResult Function()? $default, {
|
||||||
|
TResult Function()? loading,
|
||||||
|
TResult Function(List<FeedConsultantModel> consultantsList, bool isLoading)?
|
||||||
|
loaded,
|
||||||
|
TResult Function(String errorMessage)? error,
|
||||||
|
required TResult orElse(),
|
||||||
|
}) =>
|
||||||
|
throw _privateConstructorUsedError;
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult map<TResult extends Object?>(
|
||||||
|
TResult Function(_ConsultantsState value) $default, {
|
||||||
|
required TResult Function(ConsultantsStateLoading value) loading,
|
||||||
|
required TResult Function(ConsultantsStateLoaded value) loaded,
|
||||||
|
required TResult Function(ConsultantsStateError value) error,
|
||||||
|
}) =>
|
||||||
|
throw _privateConstructorUsedError;
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult? mapOrNull<TResult extends Object?>(
|
||||||
|
TResult? Function(_ConsultantsState value)? $default, {
|
||||||
|
TResult? Function(ConsultantsStateLoading value)? loading,
|
||||||
|
TResult? Function(ConsultantsStateLoaded value)? loaded,
|
||||||
|
TResult? Function(ConsultantsStateError value)? error,
|
||||||
|
}) =>
|
||||||
|
throw _privateConstructorUsedError;
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult maybeMap<TResult extends Object?>(
|
||||||
|
TResult Function(_ConsultantsState value)? $default, {
|
||||||
|
TResult Function(ConsultantsStateLoading value)? loading,
|
||||||
|
TResult Function(ConsultantsStateLoaded value)? loaded,
|
||||||
|
TResult Function(ConsultantsStateError value)? error,
|
||||||
|
required TResult orElse(),
|
||||||
|
}) =>
|
||||||
|
throw _privateConstructorUsedError;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
abstract class $ConsultantsStateCopyWith<$Res> {
|
||||||
|
factory $ConsultantsStateCopyWith(
|
||||||
|
ConsultantsState value, $Res Function(ConsultantsState) then) =
|
||||||
|
_$ConsultantsStateCopyWithImpl<$Res, ConsultantsState>;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
class _$ConsultantsStateCopyWithImpl<$Res, $Val extends ConsultantsState>
|
||||||
|
implements $ConsultantsStateCopyWith<$Res> {
|
||||||
|
_$ConsultantsStateCopyWithImpl(this._value, this._then);
|
||||||
|
|
||||||
|
// ignore: unused_field
|
||||||
|
final $Val _value;
|
||||||
|
// ignore: unused_field
|
||||||
|
final $Res Function($Val) _then;
|
||||||
|
|
||||||
|
/// Create a copy of ConsultantsState
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
abstract class _$$ConsultantsStateImplCopyWith<$Res> {
|
||||||
|
factory _$$ConsultantsStateImplCopyWith(_$ConsultantsStateImpl value,
|
||||||
|
$Res Function(_$ConsultantsStateImpl) then) =
|
||||||
|
__$$ConsultantsStateImplCopyWithImpl<$Res>;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
class __$$ConsultantsStateImplCopyWithImpl<$Res>
|
||||||
|
extends _$ConsultantsStateCopyWithImpl<$Res, _$ConsultantsStateImpl>
|
||||||
|
implements _$$ConsultantsStateImplCopyWith<$Res> {
|
||||||
|
__$$ConsultantsStateImplCopyWithImpl(_$ConsultantsStateImpl _value,
|
||||||
|
$Res Function(_$ConsultantsStateImpl) _then)
|
||||||
|
: super(_value, _then);
|
||||||
|
|
||||||
|
/// Create a copy of ConsultantsState
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
|
||||||
|
class _$ConsultantsStateImpl implements _ConsultantsState {
|
||||||
|
const _$ConsultantsStateImpl();
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return 'ConsultantsState()';
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) {
|
||||||
|
return identical(this, other) ||
|
||||||
|
(other.runtimeType == runtimeType && other is _$ConsultantsStateImpl);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode => runtimeType.hashCode;
|
||||||
|
|
||||||
|
@override
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult when<TResult extends Object?>(
|
||||||
|
TResult Function() $default, {
|
||||||
|
required TResult Function() loading,
|
||||||
|
required TResult Function(
|
||||||
|
List<FeedConsultantModel> consultantsList, bool isLoading)
|
||||||
|
loaded,
|
||||||
|
required TResult Function(String errorMessage) error,
|
||||||
|
}) {
|
||||||
|
return $default();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult? whenOrNull<TResult extends Object?>(
|
||||||
|
TResult? Function()? $default, {
|
||||||
|
TResult? Function()? loading,
|
||||||
|
TResult? Function(
|
||||||
|
List<FeedConsultantModel> consultantsList, bool isLoading)?
|
||||||
|
loaded,
|
||||||
|
TResult? Function(String errorMessage)? error,
|
||||||
|
}) {
|
||||||
|
return $default?.call();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult maybeWhen<TResult extends Object?>(
|
||||||
|
TResult Function()? $default, {
|
||||||
|
TResult Function()? loading,
|
||||||
|
TResult Function(List<FeedConsultantModel> consultantsList, bool isLoading)?
|
||||||
|
loaded,
|
||||||
|
TResult Function(String errorMessage)? error,
|
||||||
|
required TResult orElse(),
|
||||||
|
}) {
|
||||||
|
if ($default != null) {
|
||||||
|
return $default();
|
||||||
|
}
|
||||||
|
return orElse();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult map<TResult extends Object?>(
|
||||||
|
TResult Function(_ConsultantsState value) $default, {
|
||||||
|
required TResult Function(ConsultantsStateLoading value) loading,
|
||||||
|
required TResult Function(ConsultantsStateLoaded value) loaded,
|
||||||
|
required TResult Function(ConsultantsStateError value) error,
|
||||||
|
}) {
|
||||||
|
return $default(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult? mapOrNull<TResult extends Object?>(
|
||||||
|
TResult? Function(_ConsultantsState value)? $default, {
|
||||||
|
TResult? Function(ConsultantsStateLoading value)? loading,
|
||||||
|
TResult? Function(ConsultantsStateLoaded value)? loaded,
|
||||||
|
TResult? Function(ConsultantsStateError value)? error,
|
||||||
|
}) {
|
||||||
|
return $default?.call(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult maybeMap<TResult extends Object?>(
|
||||||
|
TResult Function(_ConsultantsState value)? $default, {
|
||||||
|
TResult Function(ConsultantsStateLoading value)? loading,
|
||||||
|
TResult Function(ConsultantsStateLoaded value)? loaded,
|
||||||
|
TResult Function(ConsultantsStateError value)? error,
|
||||||
|
required TResult orElse(),
|
||||||
|
}) {
|
||||||
|
if ($default != null) {
|
||||||
|
return $default(this);
|
||||||
|
}
|
||||||
|
return orElse();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class _ConsultantsState implements ConsultantsState {
|
||||||
|
const factory _ConsultantsState() = _$ConsultantsStateImpl;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
abstract class _$$ConsultantsStateLoadingImplCopyWith<$Res> {
|
||||||
|
factory _$$ConsultantsStateLoadingImplCopyWith(
|
||||||
|
_$ConsultantsStateLoadingImpl value,
|
||||||
|
$Res Function(_$ConsultantsStateLoadingImpl) then) =
|
||||||
|
__$$ConsultantsStateLoadingImplCopyWithImpl<$Res>;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
class __$$ConsultantsStateLoadingImplCopyWithImpl<$Res>
|
||||||
|
extends _$ConsultantsStateCopyWithImpl<$Res, _$ConsultantsStateLoadingImpl>
|
||||||
|
implements _$$ConsultantsStateLoadingImplCopyWith<$Res> {
|
||||||
|
__$$ConsultantsStateLoadingImplCopyWithImpl(
|
||||||
|
_$ConsultantsStateLoadingImpl _value,
|
||||||
|
$Res Function(_$ConsultantsStateLoadingImpl) _then)
|
||||||
|
: super(_value, _then);
|
||||||
|
|
||||||
|
/// Create a copy of ConsultantsState
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
|
||||||
|
class _$ConsultantsStateLoadingImpl implements ConsultantsStateLoading {
|
||||||
|
const _$ConsultantsStateLoadingImpl();
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return 'ConsultantsState.loading()';
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) {
|
||||||
|
return identical(this, other) ||
|
||||||
|
(other.runtimeType == runtimeType &&
|
||||||
|
other is _$ConsultantsStateLoadingImpl);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode => runtimeType.hashCode;
|
||||||
|
|
||||||
|
@override
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult when<TResult extends Object?>(
|
||||||
|
TResult Function() $default, {
|
||||||
|
required TResult Function() loading,
|
||||||
|
required TResult Function(
|
||||||
|
List<FeedConsultantModel> consultantsList, bool isLoading)
|
||||||
|
loaded,
|
||||||
|
required TResult Function(String errorMessage) error,
|
||||||
|
}) {
|
||||||
|
return loading();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult? whenOrNull<TResult extends Object?>(
|
||||||
|
TResult? Function()? $default, {
|
||||||
|
TResult? Function()? loading,
|
||||||
|
TResult? Function(
|
||||||
|
List<FeedConsultantModel> consultantsList, bool isLoading)?
|
||||||
|
loaded,
|
||||||
|
TResult? Function(String errorMessage)? error,
|
||||||
|
}) {
|
||||||
|
return loading?.call();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult maybeWhen<TResult extends Object?>(
|
||||||
|
TResult Function()? $default, {
|
||||||
|
TResult Function()? loading,
|
||||||
|
TResult Function(List<FeedConsultantModel> consultantsList, bool isLoading)?
|
||||||
|
loaded,
|
||||||
|
TResult Function(String errorMessage)? error,
|
||||||
|
required TResult orElse(),
|
||||||
|
}) {
|
||||||
|
if (loading != null) {
|
||||||
|
return loading();
|
||||||
|
}
|
||||||
|
return orElse();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult map<TResult extends Object?>(
|
||||||
|
TResult Function(_ConsultantsState value) $default, {
|
||||||
|
required TResult Function(ConsultantsStateLoading value) loading,
|
||||||
|
required TResult Function(ConsultantsStateLoaded value) loaded,
|
||||||
|
required TResult Function(ConsultantsStateError value) error,
|
||||||
|
}) {
|
||||||
|
return loading(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult? mapOrNull<TResult extends Object?>(
|
||||||
|
TResult? Function(_ConsultantsState value)? $default, {
|
||||||
|
TResult? Function(ConsultantsStateLoading value)? loading,
|
||||||
|
TResult? Function(ConsultantsStateLoaded value)? loaded,
|
||||||
|
TResult? Function(ConsultantsStateError value)? error,
|
||||||
|
}) {
|
||||||
|
return loading?.call(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult maybeMap<TResult extends Object?>(
|
||||||
|
TResult Function(_ConsultantsState value)? $default, {
|
||||||
|
TResult Function(ConsultantsStateLoading value)? loading,
|
||||||
|
TResult Function(ConsultantsStateLoaded value)? loaded,
|
||||||
|
TResult Function(ConsultantsStateError value)? error,
|
||||||
|
required TResult orElse(),
|
||||||
|
}) {
|
||||||
|
if (loading != null) {
|
||||||
|
return loading(this);
|
||||||
|
}
|
||||||
|
return orElse();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class ConsultantsStateLoading implements ConsultantsState {
|
||||||
|
const factory ConsultantsStateLoading() = _$ConsultantsStateLoadingImpl;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
abstract class _$$ConsultantsStateLoadedImplCopyWith<$Res> {
|
||||||
|
factory _$$ConsultantsStateLoadedImplCopyWith(
|
||||||
|
_$ConsultantsStateLoadedImpl value,
|
||||||
|
$Res Function(_$ConsultantsStateLoadedImpl) then) =
|
||||||
|
__$$ConsultantsStateLoadedImplCopyWithImpl<$Res>;
|
||||||
|
@useResult
|
||||||
|
$Res call({List<FeedConsultantModel> consultantsList, bool isLoading});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
class __$$ConsultantsStateLoadedImplCopyWithImpl<$Res>
|
||||||
|
extends _$ConsultantsStateCopyWithImpl<$Res, _$ConsultantsStateLoadedImpl>
|
||||||
|
implements _$$ConsultantsStateLoadedImplCopyWith<$Res> {
|
||||||
|
__$$ConsultantsStateLoadedImplCopyWithImpl(
|
||||||
|
_$ConsultantsStateLoadedImpl _value,
|
||||||
|
$Res Function(_$ConsultantsStateLoadedImpl) _then)
|
||||||
|
: super(_value, _then);
|
||||||
|
|
||||||
|
/// Create a copy of ConsultantsState
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
@override
|
||||||
|
$Res call({
|
||||||
|
Object? consultantsList = null,
|
||||||
|
Object? isLoading = null,
|
||||||
|
}) {
|
||||||
|
return _then(_$ConsultantsStateLoadedImpl(
|
||||||
|
consultantsList: null == consultantsList
|
||||||
|
? _value._consultantsList
|
||||||
|
: consultantsList // ignore: cast_nullable_to_non_nullable
|
||||||
|
as List<FeedConsultantModel>,
|
||||||
|
isLoading: null == isLoading
|
||||||
|
? _value.isLoading
|
||||||
|
: isLoading // ignore: cast_nullable_to_non_nullable
|
||||||
|
as bool,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
|
||||||
|
class _$ConsultantsStateLoadedImpl implements ConsultantsStateLoaded {
|
||||||
|
const _$ConsultantsStateLoadedImpl(
|
||||||
|
{required final List<FeedConsultantModel> consultantsList,
|
||||||
|
required this.isLoading})
|
||||||
|
: _consultantsList = consultantsList;
|
||||||
|
|
||||||
|
final List<FeedConsultantModel> _consultantsList;
|
||||||
|
@override
|
||||||
|
List<FeedConsultantModel> get consultantsList {
|
||||||
|
if (_consultantsList is EqualUnmodifiableListView) return _consultantsList;
|
||||||
|
// ignore: implicit_dynamic_type
|
||||||
|
return EqualUnmodifiableListView(_consultantsList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
final bool isLoading;
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return 'ConsultantsState.loaded(consultantsList: $consultantsList, isLoading: $isLoading)';
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) {
|
||||||
|
return identical(this, other) ||
|
||||||
|
(other.runtimeType == runtimeType &&
|
||||||
|
other is _$ConsultantsStateLoadedImpl &&
|
||||||
|
const DeepCollectionEquality()
|
||||||
|
.equals(other._consultantsList, _consultantsList) &&
|
||||||
|
(identical(other.isLoading, isLoading) ||
|
||||||
|
other.isLoading == isLoading));
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode => Object.hash(runtimeType,
|
||||||
|
const DeepCollectionEquality().hash(_consultantsList), isLoading);
|
||||||
|
|
||||||
|
/// Create a copy of ConsultantsState
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
@override
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
_$$ConsultantsStateLoadedImplCopyWith<_$ConsultantsStateLoadedImpl>
|
||||||
|
get copyWith => __$$ConsultantsStateLoadedImplCopyWithImpl<
|
||||||
|
_$ConsultantsStateLoadedImpl>(this, _$identity);
|
||||||
|
|
||||||
|
@override
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult when<TResult extends Object?>(
|
||||||
|
TResult Function() $default, {
|
||||||
|
required TResult Function() loading,
|
||||||
|
required TResult Function(
|
||||||
|
List<FeedConsultantModel> consultantsList, bool isLoading)
|
||||||
|
loaded,
|
||||||
|
required TResult Function(String errorMessage) error,
|
||||||
|
}) {
|
||||||
|
return loaded(consultantsList, isLoading);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult? whenOrNull<TResult extends Object?>(
|
||||||
|
TResult? Function()? $default, {
|
||||||
|
TResult? Function()? loading,
|
||||||
|
TResult? Function(
|
||||||
|
List<FeedConsultantModel> consultantsList, bool isLoading)?
|
||||||
|
loaded,
|
||||||
|
TResult? Function(String errorMessage)? error,
|
||||||
|
}) {
|
||||||
|
return loaded?.call(consultantsList, isLoading);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult maybeWhen<TResult extends Object?>(
|
||||||
|
TResult Function()? $default, {
|
||||||
|
TResult Function()? loading,
|
||||||
|
TResult Function(List<FeedConsultantModel> consultantsList, bool isLoading)?
|
||||||
|
loaded,
|
||||||
|
TResult Function(String errorMessage)? error,
|
||||||
|
required TResult orElse(),
|
||||||
|
}) {
|
||||||
|
if (loaded != null) {
|
||||||
|
return loaded(consultantsList, isLoading);
|
||||||
|
}
|
||||||
|
return orElse();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult map<TResult extends Object?>(
|
||||||
|
TResult Function(_ConsultantsState value) $default, {
|
||||||
|
required TResult Function(ConsultantsStateLoading value) loading,
|
||||||
|
required TResult Function(ConsultantsStateLoaded value) loaded,
|
||||||
|
required TResult Function(ConsultantsStateError value) error,
|
||||||
|
}) {
|
||||||
|
return loaded(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult? mapOrNull<TResult extends Object?>(
|
||||||
|
TResult? Function(_ConsultantsState value)? $default, {
|
||||||
|
TResult? Function(ConsultantsStateLoading value)? loading,
|
||||||
|
TResult? Function(ConsultantsStateLoaded value)? loaded,
|
||||||
|
TResult? Function(ConsultantsStateError value)? error,
|
||||||
|
}) {
|
||||||
|
return loaded?.call(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult maybeMap<TResult extends Object?>(
|
||||||
|
TResult Function(_ConsultantsState value)? $default, {
|
||||||
|
TResult Function(ConsultantsStateLoading value)? loading,
|
||||||
|
TResult Function(ConsultantsStateLoaded value)? loaded,
|
||||||
|
TResult Function(ConsultantsStateError value)? error,
|
||||||
|
required TResult orElse(),
|
||||||
|
}) {
|
||||||
|
if (loaded != null) {
|
||||||
|
return loaded(this);
|
||||||
|
}
|
||||||
|
return orElse();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class ConsultantsStateLoaded implements ConsultantsState {
|
||||||
|
const factory ConsultantsStateLoaded(
|
||||||
|
{required final List<FeedConsultantModel> consultantsList,
|
||||||
|
required final bool isLoading}) = _$ConsultantsStateLoadedImpl;
|
||||||
|
|
||||||
|
List<FeedConsultantModel> get consultantsList;
|
||||||
|
bool get isLoading;
|
||||||
|
|
||||||
|
/// Create a copy of ConsultantsState
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
_$$ConsultantsStateLoadedImplCopyWith<_$ConsultantsStateLoadedImpl>
|
||||||
|
get copyWith => throw _privateConstructorUsedError;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
abstract class _$$ConsultantsStateErrorImplCopyWith<$Res> {
|
||||||
|
factory _$$ConsultantsStateErrorImplCopyWith(
|
||||||
|
_$ConsultantsStateErrorImpl value,
|
||||||
|
$Res Function(_$ConsultantsStateErrorImpl) then) =
|
||||||
|
__$$ConsultantsStateErrorImplCopyWithImpl<$Res>;
|
||||||
|
@useResult
|
||||||
|
$Res call({String errorMessage});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
class __$$ConsultantsStateErrorImplCopyWithImpl<$Res>
|
||||||
|
extends _$ConsultantsStateCopyWithImpl<$Res, _$ConsultantsStateErrorImpl>
|
||||||
|
implements _$$ConsultantsStateErrorImplCopyWith<$Res> {
|
||||||
|
__$$ConsultantsStateErrorImplCopyWithImpl(_$ConsultantsStateErrorImpl _value,
|
||||||
|
$Res Function(_$ConsultantsStateErrorImpl) _then)
|
||||||
|
: super(_value, _then);
|
||||||
|
|
||||||
|
/// Create a copy of ConsultantsState
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
@override
|
||||||
|
$Res call({
|
||||||
|
Object? errorMessage = null,
|
||||||
|
}) {
|
||||||
|
return _then(_$ConsultantsStateErrorImpl(
|
||||||
|
errorMessage: null == errorMessage
|
||||||
|
? _value.errorMessage
|
||||||
|
: errorMessage // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
|
||||||
|
class _$ConsultantsStateErrorImpl implements ConsultantsStateError {
|
||||||
|
const _$ConsultantsStateErrorImpl({required this.errorMessage});
|
||||||
|
|
||||||
|
@override
|
||||||
|
final String errorMessage;
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return 'ConsultantsState.error(errorMessage: $errorMessage)';
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) {
|
||||||
|
return identical(this, other) ||
|
||||||
|
(other.runtimeType == runtimeType &&
|
||||||
|
other is _$ConsultantsStateErrorImpl &&
|
||||||
|
(identical(other.errorMessage, errorMessage) ||
|
||||||
|
other.errorMessage == errorMessage));
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode => Object.hash(runtimeType, errorMessage);
|
||||||
|
|
||||||
|
/// Create a copy of ConsultantsState
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
@override
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
_$$ConsultantsStateErrorImplCopyWith<_$ConsultantsStateErrorImpl>
|
||||||
|
get copyWith => __$$ConsultantsStateErrorImplCopyWithImpl<
|
||||||
|
_$ConsultantsStateErrorImpl>(this, _$identity);
|
||||||
|
|
||||||
|
@override
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult when<TResult extends Object?>(
|
||||||
|
TResult Function() $default, {
|
||||||
|
required TResult Function() loading,
|
||||||
|
required TResult Function(
|
||||||
|
List<FeedConsultantModel> consultantsList, bool isLoading)
|
||||||
|
loaded,
|
||||||
|
required TResult Function(String errorMessage) error,
|
||||||
|
}) {
|
||||||
|
return error(errorMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult? whenOrNull<TResult extends Object?>(
|
||||||
|
TResult? Function()? $default, {
|
||||||
|
TResult? Function()? loading,
|
||||||
|
TResult? Function(
|
||||||
|
List<FeedConsultantModel> consultantsList, bool isLoading)?
|
||||||
|
loaded,
|
||||||
|
TResult? Function(String errorMessage)? error,
|
||||||
|
}) {
|
||||||
|
return error?.call(errorMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult maybeWhen<TResult extends Object?>(
|
||||||
|
TResult Function()? $default, {
|
||||||
|
TResult Function()? loading,
|
||||||
|
TResult Function(List<FeedConsultantModel> consultantsList, bool isLoading)?
|
||||||
|
loaded,
|
||||||
|
TResult Function(String errorMessage)? error,
|
||||||
|
required TResult orElse(),
|
||||||
|
}) {
|
||||||
|
if (error != null) {
|
||||||
|
return error(errorMessage);
|
||||||
|
}
|
||||||
|
return orElse();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult map<TResult extends Object?>(
|
||||||
|
TResult Function(_ConsultantsState value) $default, {
|
||||||
|
required TResult Function(ConsultantsStateLoading value) loading,
|
||||||
|
required TResult Function(ConsultantsStateLoaded value) loaded,
|
||||||
|
required TResult Function(ConsultantsStateError value) error,
|
||||||
|
}) {
|
||||||
|
return error(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult? mapOrNull<TResult extends Object?>(
|
||||||
|
TResult? Function(_ConsultantsState value)? $default, {
|
||||||
|
TResult? Function(ConsultantsStateLoading value)? loading,
|
||||||
|
TResult? Function(ConsultantsStateLoaded value)? loaded,
|
||||||
|
TResult? Function(ConsultantsStateError value)? error,
|
||||||
|
}) {
|
||||||
|
return error?.call(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
@optionalTypeArgs
|
||||||
|
TResult maybeMap<TResult extends Object?>(
|
||||||
|
TResult Function(_ConsultantsState value)? $default, {
|
||||||
|
TResult Function(ConsultantsStateLoading value)? loading,
|
||||||
|
TResult Function(ConsultantsStateLoaded value)? loaded,
|
||||||
|
TResult Function(ConsultantsStateError value)? error,
|
||||||
|
required TResult orElse(),
|
||||||
|
}) {
|
||||||
|
if (error != null) {
|
||||||
|
return error(this);
|
||||||
|
}
|
||||||
|
return orElse();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class ConsultantsStateError implements ConsultantsState {
|
||||||
|
const factory ConsultantsStateError({required final String errorMessage}) =
|
||||||
|
_$ConsultantsStateErrorImpl;
|
||||||
|
|
||||||
|
String get errorMessage;
|
||||||
|
|
||||||
|
/// Create a copy of ConsultantsState
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
_$$ConsultantsStateErrorImplCopyWith<_$ConsultantsStateErrorImpl>
|
||||||
|
get copyWith => throw _privateConstructorUsedError;
|
||||||
|
}
|
||||||
@@ -4,6 +4,8 @@ import 'package:eatvio_app/core/widgets/custom_search_bar.dart';
|
|||||||
import 'package:eatvio_app/features/create_diet/presentation/create_diet_screen.dart';
|
import 'package:eatvio_app/features/create_diet/presentation/create_diet_screen.dart';
|
||||||
import 'package:eatvio_app/core/widgets/loader.dart';
|
import 'package:eatvio_app/core/widgets/loader.dart';
|
||||||
import 'package:eatvio_app/features/create_plan/presentation/create_plan_screen.dart';
|
import 'package:eatvio_app/features/create_plan/presentation/create_plan_screen.dart';
|
||||||
|
import 'package:eatvio_app/features/feed/presentation/bloc/consultants_cubit/consultants_cubit.dart';
|
||||||
|
import 'package:eatvio_app/features/feed/presentation/bloc/consultants_cubit/consultants_state.dart';
|
||||||
import 'package:eatvio_app/features/feed/presentation/bloc/diets_cubit/diets_cubit.dart';
|
import 'package:eatvio_app/features/feed/presentation/bloc/diets_cubit/diets_cubit.dart';
|
||||||
import 'package:eatvio_app/features/feed/presentation/bloc/diets_cubit/diets_state.dart';
|
import 'package:eatvio_app/features/feed/presentation/bloc/diets_cubit/diets_state.dart';
|
||||||
import 'package:eatvio_app/features/feed/presentation/bloc/feed_cubit/feed_cubit.dart';
|
import 'package:eatvio_app/features/feed/presentation/bloc/feed_cubit/feed_cubit.dart';
|
||||||
@@ -14,6 +16,7 @@ import 'package:eatvio_app/features/feed/presentation/bloc/recipes_cubit/recipes
|
|||||||
import 'package:eatvio_app/features/feed/presentation/bloc/recipes_cubit/recipes_state.dart';
|
import 'package:eatvio_app/features/feed/presentation/bloc/recipes_cubit/recipes_state.dart';
|
||||||
import 'package:eatvio_app/features/feed/presentation/widgets/blog_post_widget.dart';
|
import 'package:eatvio_app/features/feed/presentation/widgets/blog_post_widget.dart';
|
||||||
import 'package:eatvio_app/features/feed/presentation/widgets/choice_chip_widget.dart';
|
import 'package:eatvio_app/features/feed/presentation/widgets/choice_chip_widget.dart';
|
||||||
|
import 'package:eatvio_app/features/feed/presentation/widgets/consultant_widget.dart';
|
||||||
import 'package:eatvio_app/features/feed/presentation/widgets/diet_filter_bottom_sheet.dart';
|
import 'package:eatvio_app/features/feed/presentation/widgets/diet_filter_bottom_sheet.dart';
|
||||||
import 'package:eatvio_app/features/feed/presentation/widgets/diets_widget.dart';
|
import 'package:eatvio_app/features/feed/presentation/widgets/diets_widget.dart';
|
||||||
import 'package:eatvio_app/features/feed/presentation/widgets/filter_badge.dart';
|
import 'package:eatvio_app/features/feed/presentation/widgets/filter_badge.dart';
|
||||||
@@ -43,6 +46,7 @@ class _FeedScreenState extends State<FeedScreen> {
|
|||||||
final RecipesCubit recipesCubit = sl<RecipesCubit>()..loadRecipesList();
|
final RecipesCubit recipesCubit = sl<RecipesCubit>()..loadRecipesList();
|
||||||
final DietsCubit dietsCubit = sl<DietsCubit>()..loadDiets();
|
final DietsCubit dietsCubit = sl<DietsCubit>()..loadDiets();
|
||||||
final PlansCubit plansCubit = sl<PlansCubit>()..loadPlans();
|
final PlansCubit plansCubit = sl<PlansCubit>()..loadPlans();
|
||||||
|
final ConsultantsCubit consultantsCubit = sl<ConsultantsCubit>()..getConsultants();
|
||||||
|
|
||||||
final searchController = TextEditingController();
|
final searchController = TextEditingController();
|
||||||
final List<String> chipsLabelList = ['Все', 'Рецепты', 'Диеты', 'Планы питания', 'Консультанты'];
|
final List<String> chipsLabelList = ['Все', 'Рецепты', 'Диеты', 'Планы питания', 'Консультанты'];
|
||||||
@@ -51,6 +55,7 @@ class _FeedScreenState extends State<FeedScreen> {
|
|||||||
final recipesScrollController = ScrollController();
|
final recipesScrollController = ScrollController();
|
||||||
final dietsScrollController = ScrollController();
|
final dietsScrollController = ScrollController();
|
||||||
final plansScrollController = ScrollController();
|
final plansScrollController = ScrollController();
|
||||||
|
final consultantsScrollController = ScrollController();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
@@ -59,6 +64,7 @@ class _FeedScreenState extends State<FeedScreen> {
|
|||||||
recipesScrollController.addListener(_onScrollRecipes);
|
recipesScrollController.addListener(_onScrollRecipes);
|
||||||
dietsScrollController.addListener(_onScrollDiets);
|
dietsScrollController.addListener(_onScrollDiets);
|
||||||
plansScrollController.addListener(_onScrollPlans);
|
plansScrollController.addListener(_onScrollPlans);
|
||||||
|
consultantsScrollController.addListener(_onScrollConsultants);
|
||||||
super.initState();
|
super.initState();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,6 +92,10 @@ class _FeedScreenState extends State<FeedScreen> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_onScrollConsultants() {
|
||||||
|
if (consultantsScrollController.offset >= consultantsScrollController.position.maxScrollExtent && !consultantsScrollController.position.outOfRange) {}
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
blogPostsScrollController.dispose();
|
blogPostsScrollController.dispose();
|
||||||
@@ -111,6 +121,9 @@ class _FeedScreenState extends State<FeedScreen> {
|
|||||||
BlocProvider<PlansCubit>(
|
BlocProvider<PlansCubit>(
|
||||||
create: (context) => sl<PlansCubit>()..loadPlans(),
|
create: (context) => sl<PlansCubit>()..loadPlans(),
|
||||||
),
|
),
|
||||||
|
BlocProvider<ConsultantsCubit>(
|
||||||
|
create: (context) => sl<ConsultantsCubit>()..getConsultants(),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
floatingActionButton: _selectedChipIndex == 1
|
floatingActionButton: _selectedChipIndex == 1
|
||||||
@@ -145,6 +158,7 @@ class _FeedScreenState extends State<FeedScreen> {
|
|||||||
1 => recipesScrollController,
|
1 => recipesScrollController,
|
||||||
2 => dietsScrollController,
|
2 => dietsScrollController,
|
||||||
3 => plansScrollController,
|
3 => plansScrollController,
|
||||||
|
4 => consultantsScrollController,
|
||||||
_ => blogPostsScrollController
|
_ => blogPostsScrollController
|
||||||
},
|
},
|
||||||
headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
|
headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
|
||||||
@@ -186,6 +200,9 @@ class _FeedScreenState extends State<FeedScreen> {
|
|||||||
case 3:
|
case 3:
|
||||||
plansCubit.loadPlans(query: query);
|
plansCubit.loadPlans(query: query);
|
||||||
break;
|
break;
|
||||||
|
case 4:
|
||||||
|
consultantsCubit.getConsultants();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@@ -207,6 +224,9 @@ class _FeedScreenState extends State<FeedScreen> {
|
|||||||
case 3:
|
case 3:
|
||||||
plansCubit.loadPlans();
|
plansCubit.loadPlans();
|
||||||
break;
|
break;
|
||||||
|
case 4:
|
||||||
|
consultantsCubit.getConsultants();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@@ -238,6 +258,7 @@ class _FeedScreenState extends State<FeedScreen> {
|
|||||||
1 => _buildAllRecipes(),
|
1 => _buildAllRecipes(),
|
||||||
2 => _buildDiets(),
|
2 => _buildDiets(),
|
||||||
3 => _buildPlans(),
|
3 => _buildPlans(),
|
||||||
|
4 => _buildConsultants(),
|
||||||
_ => Center(child: Text(chipsLabelList[_selectedChipIndex])),
|
_ => Center(child: Text(chipsLabelList[_selectedChipIndex])),
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -287,6 +308,56 @@ class _FeedScreenState extends State<FeedScreen> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_buildConsultants() {
|
||||||
|
return RefreshIndicator(
|
||||||
|
onRefresh: () => consultantsCubit.getConsultants(),
|
||||||
|
child: BlocBuilder<ConsultantsCubit, ConsultantsState>(
|
||||||
|
bloc: consultantsCubit,
|
||||||
|
builder: (BuildContext context, ConsultantsState state) {
|
||||||
|
if (state is ConsultantsStateLoaded) {
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 8),
|
||||||
|
child: Material(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||||
|
child: ListView.separated(
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 16),
|
||||||
|
shrinkWrap: true,
|
||||||
|
physics: BouncingScrollPhysics(),
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
return ConsultantWidget(consultant: state.consultantsList[index]);
|
||||||
|
},
|
||||||
|
separatorBuilder: (context, index) {
|
||||||
|
return SizedBox(height: 12);
|
||||||
|
},
|
||||||
|
itemCount: state.consultantsList.length,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
} else if (state is ConsultantsStateError) {
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: Colors.grey.shade200,
|
||||||
|
body: Padding(
|
||||||
|
padding: const EdgeInsets.all(16),
|
||||||
|
child: Center(
|
||||||
|
child: Text(state.errorMessage),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: Colors.grey.shade200,
|
||||||
|
body: const Loader(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
_buildAllRecipes() {
|
_buildAllRecipes() {
|
||||||
return RefreshIndicator(
|
return RefreshIndicator(
|
||||||
onRefresh: () => recipesCubit.loadRecipesList(),
|
onRefresh: () => recipesCubit.loadRecipesList(),
|
||||||
|
|||||||
@@ -207,11 +207,15 @@ class _BlogPostWidgetState extends State<BlogPostWidget> {
|
|||||||
'assets/icons/share.svg',
|
'assets/icons/share.svg',
|
||||||
colorFilter: ColorFilter.mode(appTheme.gray600, BlendMode.srcIn),
|
colorFilter: ColorFilter.mode(appTheme.gray600, BlendMode.srcIn),
|
||||||
),
|
),
|
||||||
onTap: () => Share.shareUri(
|
onTap: () {
|
||||||
Uri.parse(
|
final box = context.findRenderObject() as RenderBox?;
|
||||||
baseUrl + '/ru/blog_post/' + state.feedBlogPostList[widget.index].id.toString(),
|
Share.shareUri(
|
||||||
),
|
Uri.parse(
|
||||||
),
|
baseUrl + '/ru/blog_post/' + state.feedBlogPostList[widget.index].id.toString(),
|
||||||
|
),
|
||||||
|
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
Spacer(),
|
Spacer(),
|
||||||
Icon(
|
Icon(
|
||||||
|
|||||||
138
lib/features/feed/presentation/widgets/consultant_widget.dart
Normal file
138
lib/features/feed/presentation/widgets/consultant_widget.dart
Normal file
@@ -0,0 +1,138 @@
|
|||||||
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
|
import 'package:eatvio_app/core/const.dart';
|
||||||
|
import 'package:eatvio_app/core/theme/theme_helper.dart';
|
||||||
|
import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart';
|
||||||
|
import 'package:eatvio_app/features/feed/models/feed_consultant_model.dart';
|
||||||
|
import 'package:eatvio_app/features/profile/models/badge_model.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
|
import 'package:go_router/go_router.dart';
|
||||||
|
|
||||||
|
class ConsultantWidget extends StatelessWidget {
|
||||||
|
final FeedConsultantModel consultant;
|
||||||
|
|
||||||
|
const ConsultantWidget({
|
||||||
|
super.key,
|
||||||
|
required this.consultant,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return InkWell(
|
||||||
|
onTap: () {
|
||||||
|
GoRouter.of(context).pushNamed(
|
||||||
|
'profileScreen',
|
||||||
|
extra: Author(
|
||||||
|
authorSlug: consultant.slug,
|
||||||
|
authorName: consultant.name,
|
||||||
|
authorProfileIcon: consultant.photo,
|
||||||
|
authorIsMe: false,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
borderRadius: BorderRadius.circular(20),
|
||||||
|
child: Ink(
|
||||||
|
padding: EdgeInsets.all(12),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(20),
|
||||||
|
color: Color(0xFFF6F6F6),
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Ink(
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 4, horizontal: 8),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
'${consultant.ratingPlace}',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 20,
|
||||||
|
color: appTheme.blueA400,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
CircleAvatar(
|
||||||
|
foregroundImage: NetworkImage(consultant.photo),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
consultant.name,
|
||||||
|
style: TextStyle(
|
||||||
|
height: 1,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
fontSize: 15,
|
||||||
|
color: Color(0xFF323F4B),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 4),
|
||||||
|
Text(
|
||||||
|
'Рейтинг: RATING',
|
||||||
|
style: TextStyle(
|
||||||
|
color: appTheme.blueA400,
|
||||||
|
height: 1,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
fontSize: 12,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Ink(
|
||||||
|
padding: EdgeInsets.all(6),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(4),
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
child: SvgPicture.asset(
|
||||||
|
'assets/icons/go_to_arrow.svg',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(height: 8),
|
||||||
|
Text('description'),
|
||||||
|
if (consultant.badges.isNotEmpty) const SizedBox(height: 8),
|
||||||
|
_badges(consultant.badges, context),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
_badges(List<BadgeModel> badges, BuildContext context) {
|
||||||
|
return SingleChildScrollView(
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
for (int i = 0; i < badges.length; i++) ...[
|
||||||
|
badges[i].image.contains('svg')
|
||||||
|
? SvgPicture.network(
|
||||||
|
baseUrl + '/storage/' + badges[i].image,
|
||||||
|
width: 28,
|
||||||
|
height: 28,
|
||||||
|
)
|
||||||
|
: CachedNetworkImage(
|
||||||
|
imageUrl: baseUrl + '/storage/' + badges[i].image,
|
||||||
|
),
|
||||||
|
i < badges.length - 1 ? const SizedBox(width: 8) : const SizedBox.shrink(),
|
||||||
|
],
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -144,10 +144,12 @@ class _DietsWidgetState extends State<DietsWidget> {
|
|||||||
FeedIconButton(
|
FeedIconButton(
|
||||||
svgIcon: SvgPicture.asset('assets/icons/repost.svg'),
|
svgIcon: SvgPicture.asset('assets/icons/repost.svg'),
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
|
final box = context.findRenderObject() as RenderBox?;
|
||||||
final result = await Share.shareUri(
|
final result = await Share.shareUri(
|
||||||
Uri.parse(
|
Uri.parse(
|
||||||
baseUrl + '/ru/diet/' + widget.diet.id.toString(),
|
baseUrl + '/ru/diet/' + widget.diet.id.toString(),
|
||||||
),
|
),
|
||||||
|
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
|
||||||
);
|
);
|
||||||
switch (result.status) {
|
switch (result.status) {
|
||||||
case ShareResultStatus.success:
|
case ShareResultStatus.success:
|
||||||
|
|||||||
@@ -201,10 +201,12 @@ class _PlanWidgetState extends State<PlanWidget> {
|
|||||||
FeedIconButton(
|
FeedIconButton(
|
||||||
svgIcon: SvgPicture.asset('assets/icons/repost.svg'),
|
svgIcon: SvgPicture.asset('assets/icons/repost.svg'),
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
|
final box = context.findRenderObject() as RenderBox?;
|
||||||
final result = await Share.shareUri(
|
final result = await Share.shareUri(
|
||||||
Uri.parse(
|
Uri.parse(
|
||||||
baseUrl + '/ru/diet/' + widget.plan.id.toString(),
|
baseUrl + '/ru/diet/' + widget.plan.id.toString(),
|
||||||
),
|
),
|
||||||
|
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
|
||||||
);
|
);
|
||||||
switch (result.status) {
|
switch (result.status) {
|
||||||
case ShareResultStatus.success:
|
case ShareResultStatus.success:
|
||||||
|
|||||||
@@ -21,6 +21,14 @@ class RecipesWidget extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _RecipesWidgetState extends State<RecipesWidget> {
|
class _RecipesWidgetState extends State<RecipesWidget> {
|
||||||
|
late bool isLiked;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
isLiked = false;
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return InkWell(
|
return InkWell(
|
||||||
@@ -143,11 +151,15 @@ class _RecipesWidgetState extends State<RecipesWidget> {
|
|||||||
'assets/icons/share.svg',
|
'assets/icons/share.svg',
|
||||||
colorFilter: ColorFilter.mode(appTheme.gray600, BlendMode.srcIn),
|
colorFilter: ColorFilter.mode(appTheme.gray600, BlendMode.srcIn),
|
||||||
),
|
),
|
||||||
onTap: () => Share.shareUri(
|
onTap: () {
|
||||||
Uri.parse(
|
final box = context.findRenderObject() as RenderBox?;
|
||||||
baseUrl + '/ru/blog_post/' + widget.recipes.id.toString(),
|
Share.shareUri(
|
||||||
),
|
Uri.parse(
|
||||||
),
|
baseUrl + '/ru/blog_post/' + widget.recipes.id.toString(),
|
||||||
|
),
|
||||||
|
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
Spacer(),
|
Spacer(),
|
||||||
Icon(
|
Icon(
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'package:eatvio_app/features/feed/models/comment_model.dart';
|
import 'package:eatvio_app/features/feed/models/comment_model.dart';
|
||||||
import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart';
|
import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart';
|
||||||
import 'package:eatvio_app/features/feed/models/feed_blog_post_settings_model.dart';
|
import 'package:eatvio_app/features/feed/models/feed_blog_post_settings_model.dart';
|
||||||
|
import 'package:eatvio_app/features/feed/models/feed_consultant_model.dart';
|
||||||
import 'package:eatvio_app/features/feed/models/plan_pagination_model.dart';
|
import 'package:eatvio_app/features/feed/models/plan_pagination_model.dart';
|
||||||
import 'package:eatvio_app/features/feed/models/recipes_model.dart';
|
import 'package:eatvio_app/features/feed/models/recipes_model.dart';
|
||||||
import 'package:eatvio_app/features/feed/services/feed_service.dart';
|
import 'package:eatvio_app/features/feed/services/feed_service.dart';
|
||||||
@@ -208,4 +209,12 @@ class FeedRepository {
|
|||||||
rethrow;
|
rethrow;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<List<FeedConsultantModel>> getConsultants() async {
|
||||||
|
try {
|
||||||
|
return (await feedService.getConsultants()).data;
|
||||||
|
} catch (e) {
|
||||||
|
rethrow;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import 'package:dio/dio.dart';
|
|||||||
import 'package:eatvio_app/features/feed/models/comment_model.dart';
|
import 'package:eatvio_app/features/feed/models/comment_model.dart';
|
||||||
import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart';
|
import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart';
|
||||||
import 'package:eatvio_app/features/feed/models/feed_blog_post_settings_model.dart';
|
import 'package:eatvio_app/features/feed/models/feed_blog_post_settings_model.dart';
|
||||||
|
import 'package:eatvio_app/features/feed/models/feed_consultant_model.dart';
|
||||||
import 'package:eatvio_app/features/feed/models/plan_pagination_model.dart';
|
import 'package:eatvio_app/features/feed/models/plan_pagination_model.dart';
|
||||||
import 'package:eatvio_app/features/feed/models/recipes_pagination_model.dart';
|
import 'package:eatvio_app/features/feed/models/recipes_pagination_model.dart';
|
||||||
import 'package:retrofit/retrofit.dart';
|
import 'package:retrofit/retrofit.dart';
|
||||||
@@ -101,4 +102,7 @@ abstract class FeedService {
|
|||||||
Future<void> unlikedBlogPost({
|
Future<void> unlikedBlogPost({
|
||||||
@Path() required int id,
|
@Path() required int id,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@GET('/api/consultants/index')
|
||||||
|
Future<FeedConsultantPaginationModel> getConsultants();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,11 +9,7 @@ part of 'feed_service.dart';
|
|||||||
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
||||||
|
|
||||||
class _FeedService implements FeedService {
|
class _FeedService implements FeedService {
|
||||||
_FeedService(
|
_FeedService(this._dio, {this.baseUrl, this.errorLogger});
|
||||||
this._dio, {
|
|
||||||
this.baseUrl,
|
|
||||||
this.errorLogger,
|
|
||||||
});
|
|
||||||
|
|
||||||
final Dio _dio;
|
final Dio _dio;
|
||||||
|
|
||||||
@@ -34,22 +30,16 @@ class _FeedService implements FeedService {
|
|||||||
queryParameters.removeWhere((k, v) => v == null);
|
queryParameters.removeWhere((k, v) => v == null);
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<FeedBlogPostSettingsModel>(Options(
|
final _options = _setStreamType<FeedBlogPostSettingsModel>(
|
||||||
method: 'GET',
|
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/blogPosts/index',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/blogPosts/index',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||||
late FeedBlogPostSettingsModel _value;
|
late FeedBlogPostSettingsModel _value;
|
||||||
try {
|
try {
|
||||||
@@ -76,22 +66,16 @@ class _FeedService implements FeedService {
|
|||||||
queryParameters.removeWhere((k, v) => v == null);
|
queryParameters.removeWhere((k, v) => v == null);
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<RecipesPagination>(Options(
|
final _options = _setStreamType<RecipesPagination>(
|
||||||
method: 'GET',
|
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/recipes/index',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/recipes/index',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||||
late RecipesPagination _value;
|
late RecipesPagination _value;
|
||||||
try {
|
try {
|
||||||
@@ -122,22 +106,16 @@ class _FeedService implements FeedService {
|
|||||||
queryParameters.removeWhere((k, v) => v == null);
|
queryParameters.removeWhere((k, v) => v == null);
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<DietsPagination>(Options(
|
final _options = _setStreamType<DietsPagination>(
|
||||||
method: 'GET',
|
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/diets/index',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/diets/index',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||||
late DietsPagination _value;
|
late DietsPagination _value;
|
||||||
try {
|
try {
|
||||||
@@ -170,22 +148,16 @@ class _FeedService implements FeedService {
|
|||||||
queryParameters.removeWhere((k, v) => v == null);
|
queryParameters.removeWhere((k, v) => v == null);
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<PlanPaginationModel>(Options(
|
final _options = _setStreamType<PlanPaginationModel>(
|
||||||
method: 'GET',
|
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/plans/index',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/plans/index',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||||
late PlanPaginationModel _value;
|
late PlanPaginationModel _value;
|
||||||
try {
|
try {
|
||||||
@@ -203,22 +175,16 @@ class _FeedService implements FeedService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<CommentModel>(Options(
|
final _options = _setStreamType<CommentModel>(
|
||||||
method: 'GET',
|
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/blogPosts/${id}/comments/show',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/blogPosts/${id}/comments/show',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||||
late CommentModel _value;
|
late CommentModel _value;
|
||||||
try {
|
try {
|
||||||
@@ -241,32 +207,20 @@ class _FeedService implements FeedService {
|
|||||||
queryParameters.removeWhere((k, v) => v == null);
|
queryParameters.removeWhere((k, v) => v == null);
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
final _data = FormData();
|
final _data = FormData();
|
||||||
_data.fields.add(MapEntry(
|
_data.fields.add(MapEntry('body', body));
|
||||||
'body',
|
|
||||||
body,
|
|
||||||
));
|
|
||||||
if (parentCommentId != null) {
|
if (parentCommentId != null) {
|
||||||
_data.fields.add(MapEntry(
|
_data.fields.add(MapEntry('parentCommentId', parentCommentId.toString()));
|
||||||
'parentCommentId',
|
|
||||||
parentCommentId.toString(),
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
final _options = _setStreamType<void>(Options(
|
final _options = _setStreamType<void>(
|
||||||
method: 'POST',
|
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/blogPosts/${id}/comment/create',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/blogPosts/${id}/comment/create',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
await _dio.fetch<void>(_options);
|
await _dio.fetch<void>(_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -276,22 +230,16 @@ class _FeedService implements FeedService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<CommentModel>(Options(
|
final _options = _setStreamType<CommentModel>(
|
||||||
method: 'GET',
|
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/diets/${id}/comments/show',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/diets/${id}/comments/show',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||||
late CommentModel _value;
|
late CommentModel _value;
|
||||||
try {
|
try {
|
||||||
@@ -314,32 +262,20 @@ class _FeedService implements FeedService {
|
|||||||
queryParameters.removeWhere((k, v) => v == null);
|
queryParameters.removeWhere((k, v) => v == null);
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
final _data = FormData();
|
final _data = FormData();
|
||||||
_data.fields.add(MapEntry(
|
_data.fields.add(MapEntry('body', body));
|
||||||
'body',
|
|
||||||
body,
|
|
||||||
));
|
|
||||||
if (parentCommentId != null) {
|
if (parentCommentId != null) {
|
||||||
_data.fields.add(MapEntry(
|
_data.fields.add(MapEntry('parentCommentId', parentCommentId.toString()));
|
||||||
'parentCommentId',
|
|
||||||
parentCommentId.toString(),
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
final _options = _setStreamType<void>(Options(
|
final _options = _setStreamType<void>(
|
||||||
method: 'POST',
|
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/diets/${id}/comment/create',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/diets/${id}/comment/create',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
await _dio.fetch<void>(_options);
|
await _dio.fetch<void>(_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -349,22 +285,16 @@ class _FeedService implements FeedService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<CommentModel>(Options(
|
final _options = _setStreamType<CommentModel>(
|
||||||
method: 'GET',
|
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/plans/${slug}/comments/show',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/plans/${slug}/comments/show',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||||
late CommentModel _value;
|
late CommentModel _value;
|
||||||
try {
|
try {
|
||||||
@@ -387,32 +317,20 @@ class _FeedService implements FeedService {
|
|||||||
queryParameters.removeWhere((k, v) => v == null);
|
queryParameters.removeWhere((k, v) => v == null);
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
final _data = FormData();
|
final _data = FormData();
|
||||||
_data.fields.add(MapEntry(
|
_data.fields.add(MapEntry('body', body));
|
||||||
'body',
|
|
||||||
body,
|
|
||||||
));
|
|
||||||
if (parentCommentId != null) {
|
if (parentCommentId != null) {
|
||||||
_data.fields.add(MapEntry(
|
_data.fields.add(MapEntry('parentCommentId', parentCommentId.toString()));
|
||||||
'parentCommentId',
|
|
||||||
parentCommentId.toString(),
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
final _options = _setStreamType<void>(Options(
|
final _options = _setStreamType<void>(
|
||||||
method: 'POST',
|
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/plans/${slug}/comment/create',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/plans/${slug}/comment/create',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
await _dio.fetch<void>(_options);
|
await _dio.fetch<void>(_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -422,22 +340,16 @@ class _FeedService implements FeedService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<CommentModel>(Options(
|
final _options = _setStreamType<CommentModel>(
|
||||||
method: 'GET',
|
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/recipes/${id}/comments/show',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/recipes/${id}/comments/show',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||||
late CommentModel _value;
|
late CommentModel _value;
|
||||||
try {
|
try {
|
||||||
@@ -460,32 +372,20 @@ class _FeedService implements FeedService {
|
|||||||
queryParameters.removeWhere((k, v) => v == null);
|
queryParameters.removeWhere((k, v) => v == null);
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
final _data = FormData();
|
final _data = FormData();
|
||||||
_data.fields.add(MapEntry(
|
_data.fields.add(MapEntry('body', body));
|
||||||
'body',
|
|
||||||
body,
|
|
||||||
));
|
|
||||||
if (parentCommentId != null) {
|
if (parentCommentId != null) {
|
||||||
_data.fields.add(MapEntry(
|
_data.fields.add(MapEntry('parentCommentId', parentCommentId.toString()));
|
||||||
'parentCommentId',
|
|
||||||
parentCommentId.toString(),
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
final _options = _setStreamType<void>(Options(
|
final _options = _setStreamType<void>(
|
||||||
method: 'POST',
|
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/recipes/${id}/comment/create',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/recipes/${id}/comment/create',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
await _dio.fetch<void>(_options);
|
await _dio.fetch<void>(_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -495,22 +395,16 @@ class _FeedService implements FeedService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<void>(Options(
|
final _options = _setStreamType<void>(
|
||||||
method: 'POST',
|
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/blogPosts/${id}/like',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/blogPosts/${id}/like',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
await _dio.fetch<void>(_options);
|
await _dio.fetch<void>(_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -520,25 +414,46 @@ class _FeedService implements FeedService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<void>(Options(
|
final _options = _setStreamType<void>(
|
||||||
method: 'POST',
|
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/blogPosts/${id}/unliked',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/blogPosts/${id}/unliked',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
await _dio.fetch<void>(_options);
|
await _dio.fetch<void>(_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<FeedConsultantPaginationModel> getConsultants() async {
|
||||||
|
final _extra = <String, dynamic>{};
|
||||||
|
final queryParameters = <String, dynamic>{};
|
||||||
|
final _headers = <String, dynamic>{};
|
||||||
|
const Map<String, dynamic>? _data = null;
|
||||||
|
final _options = _setStreamType<FeedConsultantPaginationModel>(
|
||||||
|
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||||
|
.compose(
|
||||||
|
_dio.options,
|
||||||
|
'/api/consultants/index',
|
||||||
|
queryParameters: queryParameters,
|
||||||
|
data: _data,
|
||||||
|
)
|
||||||
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
|
);
|
||||||
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||||
|
late FeedConsultantPaginationModel _value;
|
||||||
|
try {
|
||||||
|
_value = FeedConsultantPaginationModel.fromJson(_result.data!);
|
||||||
|
} on Object catch (e, s) {
|
||||||
|
errorLogger?.logError(e, s, _options);
|
||||||
|
rethrow;
|
||||||
|
}
|
||||||
|
return _value;
|
||||||
|
}
|
||||||
|
|
||||||
RequestOptions _setStreamType<T>(RequestOptions requestOptions) {
|
RequestOptions _setStreamType<T>(RequestOptions requestOptions) {
|
||||||
if (T != dynamic &&
|
if (T != dynamic &&
|
||||||
!(requestOptions.responseType == ResponseType.bytes ||
|
!(requestOptions.responseType == ResponseType.bytes ||
|
||||||
@@ -552,10 +467,7 @@ class _FeedService implements FeedService {
|
|||||||
return requestOptions;
|
return requestOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
String _combineBaseUrls(
|
String _combineBaseUrls(String dioBaseUrl, String? baseUrl) {
|
||||||
String dioBaseUrl,
|
|
||||||
String? baseUrl,
|
|
||||||
) {
|
|
||||||
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
||||||
return dioBaseUrl;
|
return dioBaseUrl;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,11 +9,7 @@ part of 'glossary_service.dart';
|
|||||||
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
||||||
|
|
||||||
class _GlossaryService implements GlossaryService {
|
class _GlossaryService implements GlossaryService {
|
||||||
_GlossaryService(
|
_GlossaryService(this._dio, {this.baseUrl, this.errorLogger});
|
||||||
this._dio, {
|
|
||||||
this.baseUrl,
|
|
||||||
this.errorLogger,
|
|
||||||
});
|
|
||||||
|
|
||||||
final Dio _dio;
|
final Dio _dio;
|
||||||
|
|
||||||
@@ -22,28 +18,23 @@ class _GlossaryService implements GlossaryService {
|
|||||||
final ParseErrorLogger? errorLogger;
|
final ParseErrorLogger? errorLogger;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<GlossaryPaginationModel> getGlossaryByQuery(
|
Future<GlossaryPaginationModel> getGlossaryByQuery({
|
||||||
{required String query}) async {
|
required String query,
|
||||||
|
}) async {
|
||||||
final _extra = <String, dynamic>{};
|
final _extra = <String, dynamic>{};
|
||||||
final queryParameters = <String, dynamic>{r'search': query};
|
final queryParameters = <String, dynamic>{r'search': query};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<GlossaryPaginationModel>(Options(
|
final _options = _setStreamType<GlossaryPaginationModel>(
|
||||||
method: 'GET',
|
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/glossaries/search',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/glossaries/search',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||||
late GlossaryPaginationModel _value;
|
late GlossaryPaginationModel _value;
|
||||||
try {
|
try {
|
||||||
@@ -68,10 +59,7 @@ class _GlossaryService implements GlossaryService {
|
|||||||
return requestOptions;
|
return requestOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
String _combineBaseUrls(
|
String _combineBaseUrls(String dioBaseUrl, String? baseUrl) {
|
||||||
String dioBaseUrl,
|
|
||||||
String? baseUrl,
|
|
||||||
) {
|
|
||||||
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
||||||
return dioBaseUrl;
|
return dioBaseUrl;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -128,10 +128,12 @@ class _MyDietWidgetState extends State<MyDietWidget> {
|
|||||||
SizedBox(width: 6),
|
SizedBox(width: 6),
|
||||||
CustomOutlinedButton(
|
CustomOutlinedButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
|
final box = context.findRenderObject() as RenderBox?;
|
||||||
await Share.shareUri(
|
await Share.shareUri(
|
||||||
Uri.parse(
|
Uri.parse(
|
||||||
baseUrl + '/ru/diet/' + widget.diet.id.toString(),
|
baseUrl + '/ru/diet/' + widget.diet.id.toString(),
|
||||||
),
|
),
|
||||||
|
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
height: 52,
|
height: 52,
|
||||||
|
|||||||
@@ -9,11 +9,7 @@ part of 'my_diets_service.dart';
|
|||||||
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
||||||
|
|
||||||
class _MyDietsService implements MyDietsService {
|
class _MyDietsService implements MyDietsService {
|
||||||
_MyDietsService(
|
_MyDietsService(this._dio, {this.baseUrl, this.errorLogger});
|
||||||
this._dio, {
|
|
||||||
this.baseUrl,
|
|
||||||
this.errorLogger,
|
|
||||||
});
|
|
||||||
|
|
||||||
final Dio _dio;
|
final Dio _dio;
|
||||||
|
|
||||||
@@ -40,22 +36,16 @@ class _MyDietsService implements MyDietsService {
|
|||||||
queryParameters.removeWhere((k, v) => v == null);
|
queryParameters.removeWhere((k, v) => v == null);
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<DietsPagination>(Options(
|
final _options = _setStreamType<DietsPagination>(
|
||||||
method: 'GET',
|
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/diets/index',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/diets/index',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||||
late DietsPagination _value;
|
late DietsPagination _value;
|
||||||
try {
|
try {
|
||||||
@@ -73,22 +63,16 @@ class _MyDietsService implements MyDietsService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<void>(Options(
|
final _options = _setStreamType<void>(
|
||||||
method: 'POST',
|
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/diets/delete/${dietId}',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/diets/delete/${dietId}',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
await _dio.fetch<void>(_options);
|
await _dio.fetch<void>(_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,10 +89,7 @@ class _MyDietsService implements MyDietsService {
|
|||||||
return requestOptions;
|
return requestOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
String _combineBaseUrls(
|
String _combineBaseUrls(String dioBaseUrl, String? baseUrl) {
|
||||||
String dioBaseUrl,
|
|
||||||
String? baseUrl,
|
|
||||||
) {
|
|
||||||
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
||||||
return dioBaseUrl;
|
return dioBaseUrl;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -135,10 +135,12 @@ class _MyPlanWidgetState extends State<MyPlanWidget> {
|
|||||||
SizedBox(width: 6),
|
SizedBox(width: 6),
|
||||||
CustomOutlinedButton(
|
CustomOutlinedButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
|
final box = context.findRenderObject() as RenderBox?;
|
||||||
await Share.shareUri(
|
await Share.shareUri(
|
||||||
Uri.parse(
|
Uri.parse(
|
||||||
baseUrl + '/ru/plan/' + widget.plan.id.toString(),
|
baseUrl + '/ru/plan/' + widget.plan.id.toString(),
|
||||||
),
|
),
|
||||||
|
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
height: 52,
|
height: 52,
|
||||||
|
|||||||
@@ -9,11 +9,7 @@ part of 'my_plans_service.dart';
|
|||||||
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
||||||
|
|
||||||
class _MyPlansService implements MyPlansService {
|
class _MyPlansService implements MyPlansService {
|
||||||
_MyPlansService(
|
_MyPlansService(this._dio, {this.baseUrl, this.errorLogger});
|
||||||
this._dio, {
|
|
||||||
this.baseUrl,
|
|
||||||
this.errorLogger,
|
|
||||||
});
|
|
||||||
|
|
||||||
final Dio _dio;
|
final Dio _dio;
|
||||||
|
|
||||||
@@ -42,22 +38,16 @@ class _MyPlansService implements MyPlansService {
|
|||||||
queryParameters.removeWhere((k, v) => v == null);
|
queryParameters.removeWhere((k, v) => v == null);
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<PlanPaginationModel>(Options(
|
final _options = _setStreamType<PlanPaginationModel>(
|
||||||
method: 'GET',
|
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/plans/index',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/plans/index',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||||
late PlanPaginationModel _value;
|
late PlanPaginationModel _value;
|
||||||
try {
|
try {
|
||||||
@@ -75,22 +65,16 @@ class _MyPlansService implements MyPlansService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<void>(Options(
|
final _options = _setStreamType<void>(
|
||||||
method: 'POST',
|
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/plans/delete/${slug}',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/plans/delete/${slug}',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
await _dio.fetch<void>(_options);
|
await _dio.fetch<void>(_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,10 +91,7 @@ class _MyPlansService implements MyPlansService {
|
|||||||
return requestOptions;
|
return requestOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
String _combineBaseUrls(
|
String _combineBaseUrls(String dioBaseUrl, String? baseUrl) {
|
||||||
String dioBaseUrl,
|
|
||||||
String? baseUrl,
|
|
||||||
) {
|
|
||||||
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
||||||
return dioBaseUrl;
|
return dioBaseUrl;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,11 +9,7 @@ part of 'plan_service.dart';
|
|||||||
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
||||||
|
|
||||||
class _PlanService implements PlanService {
|
class _PlanService implements PlanService {
|
||||||
_PlanService(
|
_PlanService(this._dio, {this.baseUrl, this.errorLogger});
|
||||||
this._dio, {
|
|
||||||
this.baseUrl,
|
|
||||||
this.errorLogger,
|
|
||||||
});
|
|
||||||
|
|
||||||
final Dio _dio;
|
final Dio _dio;
|
||||||
|
|
||||||
@@ -27,22 +23,16 @@ class _PlanService implements PlanService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<PlanModel>(Options(
|
final _options = _setStreamType<PlanModel>(
|
||||||
method: 'GET',
|
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/plans/show/${slug}',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/plans/show/${slug}',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||||
late PlanModel _value;
|
late PlanModel _value;
|
||||||
try {
|
try {
|
||||||
@@ -60,22 +50,16 @@ class _PlanService implements PlanService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<void>(Options(
|
final _options = _setStreamType<void>(
|
||||||
method: 'POST',
|
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/plans/${slug}/like',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/plans/${slug}/like',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
await _dio.fetch<void>(_options);
|
await _dio.fetch<void>(_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,22 +69,16 @@ class _PlanService implements PlanService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<void>(Options(
|
final _options = _setStreamType<void>(
|
||||||
method: 'POST',
|
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/plans/${slug}/add_to_favorite',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/plans/${slug}/add_to_favorite',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
await _dio.fetch<void>(_options);
|
await _dio.fetch<void>(_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -110,22 +88,16 @@ class _PlanService implements PlanService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<void>(Options(
|
final _options = _setStreamType<void>(
|
||||||
method: 'POST',
|
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/plans/${slug}/remove_from_favorite',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/plans/${slug}/remove_from_favorite',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
await _dio.fetch<void>(_options);
|
await _dio.fetch<void>(_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -142,10 +114,7 @@ class _PlanService implements PlanService {
|
|||||||
return requestOptions;
|
return requestOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
String _combineBaseUrls(
|
String _combineBaseUrls(String dioBaseUrl, String? baseUrl) {
|
||||||
String dioBaseUrl,
|
|
||||||
String? baseUrl,
|
|
||||||
) {
|
|
||||||
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
||||||
return dioBaseUrl;
|
return dioBaseUrl;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,11 +9,7 @@ part of 'plans_service.dart';
|
|||||||
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
||||||
|
|
||||||
class _PlansService implements PlansService {
|
class _PlansService implements PlansService {
|
||||||
_PlansService(
|
_PlansService(this._dio, {this.baseUrl, this.errorLogger});
|
||||||
this._dio, {
|
|
||||||
this.baseUrl,
|
|
||||||
this.errorLogger,
|
|
||||||
});
|
|
||||||
|
|
||||||
final Dio _dio;
|
final Dio _dio;
|
||||||
|
|
||||||
@@ -27,22 +23,16 @@ class _PlansService implements PlansService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<PlanPaginationModel>(Options(
|
final _options = _setStreamType<PlanPaginationModel>(
|
||||||
method: 'GET',
|
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/plans/get_by_author/${author}',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/plans/get_by_author/${author}',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||||
late PlanPaginationModel _value;
|
late PlanPaginationModel _value;
|
||||||
try {
|
try {
|
||||||
@@ -67,10 +57,7 @@ class _PlansService implements PlansService {
|
|||||||
return requestOptions;
|
return requestOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
String _combineBaseUrls(
|
String _combineBaseUrls(String dioBaseUrl, String? baseUrl) {
|
||||||
String dioBaseUrl,
|
|
||||||
String? baseUrl,
|
|
||||||
) {
|
|
||||||
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
||||||
return dioBaseUrl;
|
return dioBaseUrl;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1006,10 +1006,12 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
|||||||
const Spacer(),
|
const Spacer(),
|
||||||
PopupMenuButton(
|
PopupMenuButton(
|
||||||
onSelected: (value) {
|
onSelected: (value) {
|
||||||
|
final box = context.findRenderObject() as RenderBox?;
|
||||||
Share.shareUri(
|
Share.shareUri(
|
||||||
Uri.parse(
|
Uri.parse(
|
||||||
baseUrl + '/ru/profile/' + state.profile.slug,
|
baseUrl + '/ru/profile/' + state.profile.slug,
|
||||||
),
|
),
|
||||||
|
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
itemBuilder: (context) => [
|
itemBuilder: (context) => [
|
||||||
|
|||||||
@@ -208,11 +208,15 @@ class _ProfileBlogPostWidgetState extends State<ProfileBlogPostWidget> {
|
|||||||
'assets/icons/share.svg',
|
'assets/icons/share.svg',
|
||||||
colorFilter: ColorFilter.mode(appTheme.gray600, BlendMode.srcIn),
|
colorFilter: ColorFilter.mode(appTheme.gray600, BlendMode.srcIn),
|
||||||
),
|
),
|
||||||
onTap: () => Share.shareUri(
|
onTap: () {
|
||||||
Uri.parse(
|
final box = context.findRenderObject() as RenderBox?;
|
||||||
baseUrl + '/ru/blog_post/' + state.blogPosts[widget.index].id.toString(),
|
Share.shareUri(
|
||||||
),
|
Uri.parse(
|
||||||
),
|
baseUrl + '/ru/blog_post/' + state.blogPosts[widget.index].id.toString(),
|
||||||
|
),
|
||||||
|
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
Spacer(),
|
Spacer(),
|
||||||
Icon(
|
Icon(
|
||||||
|
|||||||
@@ -9,11 +9,7 @@ part of 'profile_service.dart';
|
|||||||
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
||||||
|
|
||||||
class _ProfileService implements ProfileService {
|
class _ProfileService implements ProfileService {
|
||||||
_ProfileService(
|
_ProfileService(this._dio, {this.baseUrl, this.errorLogger});
|
||||||
this._dio, {
|
|
||||||
this.baseUrl,
|
|
||||||
this.errorLogger,
|
|
||||||
});
|
|
||||||
|
|
||||||
final Dio _dio;
|
final Dio _dio;
|
||||||
|
|
||||||
@@ -27,22 +23,16 @@ class _ProfileService implements ProfileService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<ProfileModel>(Options(
|
final _options = _setStreamType<ProfileModel>(
|
||||||
method: 'GET',
|
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/profile/show/${slug}',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/profile/show/${slug}',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||||
late ProfileModel _value;
|
late ProfileModel _value;
|
||||||
try {
|
try {
|
||||||
@@ -60,22 +50,16 @@ class _ProfileService implements ProfileService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<ProfileModel>(Options(
|
final _options = _setStreamType<ProfileModel>(
|
||||||
method: 'GET',
|
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/profile/index',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/profile/index',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||||
late ProfileModel _value;
|
late ProfileModel _value;
|
||||||
try {
|
try {
|
||||||
@@ -93,22 +77,16 @@ class _ProfileService implements ProfileService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<ProfileDetailsModel>(Options(
|
final _options = _setStreamType<ProfileDetailsModel>(
|
||||||
method: 'GET',
|
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/profile/detailz',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/profile/detailz',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||||
late ProfileDetailsModel _value;
|
late ProfileDetailsModel _value;
|
||||||
try {
|
try {
|
||||||
@@ -121,28 +99,23 @@ class _ProfileService implements ProfileService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<ProfileDetailsModel> getProfileDetailsBySlug(
|
Future<ProfileDetailsModel> getProfileDetailsBySlug({
|
||||||
{required String slug}) async {
|
required String slug,
|
||||||
|
}) async {
|
||||||
final _extra = <String, dynamic>{};
|
final _extra = <String, dynamic>{};
|
||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<ProfileDetailsModel>(Options(
|
final _options = _setStreamType<ProfileDetailsModel>(
|
||||||
method: 'GET',
|
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/profile/detailz/${slug}',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/profile/detailz/${slug}',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||||
late ProfileDetailsModel _value;
|
late ProfileDetailsModel _value;
|
||||||
try {
|
try {
|
||||||
@@ -164,34 +137,25 @@ class _ProfileService implements ProfileService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
final _data = FormData();
|
final _data = FormData();
|
||||||
_data.fields.add(MapEntry(
|
_data.fields.add(
|
||||||
'chest_circumference',
|
MapEntry('chest_circumference', chestCircumference.toString()),
|
||||||
chestCircumference.toString(),
|
);
|
||||||
));
|
_data.fields.add(
|
||||||
_data.fields.add(MapEntry(
|
MapEntry('waist_circumference', waistCircumference.toString()),
|
||||||
'waist_circumference',
|
);
|
||||||
waistCircumference.toString(),
|
_data.fields.add(
|
||||||
));
|
MapEntry('hip_circumference', hipCircumference.toString()),
|
||||||
_data.fields.add(MapEntry(
|
);
|
||||||
'hip_circumference',
|
final _options = _setStreamType<void>(
|
||||||
hipCircumference.toString(),
|
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||||
));
|
.compose(
|
||||||
final _options = _setStreamType<void>(Options(
|
_dio.options,
|
||||||
method: 'POST',
|
'/api/profile/addCircumference',
|
||||||
headers: _headers,
|
queryParameters: queryParameters,
|
||||||
extra: _extra,
|
data: _data,
|
||||||
)
|
)
|
||||||
.compose(
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
_dio.options,
|
);
|
||||||
'/api/profile/addCircumference',
|
|
||||||
queryParameters: queryParameters,
|
|
||||||
data: _data,
|
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
await _dio.fetch<void>(_options);
|
await _dio.fetch<void>(_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -201,58 +165,46 @@ class _ProfileService implements ProfileService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
final _data = FormData();
|
final _data = FormData();
|
||||||
_data.fields.add(MapEntry(
|
_data.fields.add(MapEntry('weight', weight.toString()));
|
||||||
'weight',
|
final _options = _setStreamType<void>(
|
||||||
weight.toString(),
|
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||||
));
|
.compose(
|
||||||
final _options = _setStreamType<void>(Options(
|
_dio.options,
|
||||||
method: 'POST',
|
'/api/profile/addWeight',
|
||||||
headers: _headers,
|
queryParameters: queryParameters,
|
||||||
extra: _extra,
|
data: _data,
|
||||||
)
|
)
|
||||||
.compose(
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
_dio.options,
|
);
|
||||||
'/api/profile/addWeight',
|
|
||||||
queryParameters: queryParameters,
|
|
||||||
data: _data,
|
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
await _dio.fetch<void>(_options);
|
await _dio.fetch<void>(_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<List<FeedBlogPostModel>> getBlogPostByAuthorSlug(
|
Future<List<FeedBlogPostModel>> getBlogPostByAuthorSlug({
|
||||||
{required String slug}) async {
|
required String slug,
|
||||||
|
}) async {
|
||||||
final _extra = <String, dynamic>{};
|
final _extra = <String, dynamic>{};
|
||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<List<FeedBlogPostModel>>(Options(
|
final _options = _setStreamType<List<FeedBlogPostModel>>(
|
||||||
method: 'GET',
|
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/blogPosts/search_by_author/${slug}',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/blogPosts/search_by_author/${slug}',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<List<dynamic>>(_options);
|
final _result = await _dio.fetch<List<dynamic>>(_options);
|
||||||
late List<FeedBlogPostModel> _value;
|
late List<FeedBlogPostModel> _value;
|
||||||
try {
|
try {
|
||||||
_value = _result.data!
|
_value = _result.data!
|
||||||
.map((dynamic i) =>
|
.map(
|
||||||
FeedBlogPostModel.fromJson(i as Map<String, dynamic>))
|
(dynamic i) =>
|
||||||
|
FeedBlogPostModel.fromJson(i as Map<String, dynamic>),
|
||||||
|
)
|
||||||
.toList();
|
.toList();
|
||||||
} on Object catch (e, s) {
|
} on Object catch (e, s) {
|
||||||
errorLogger?.logError(e, s, _options);
|
errorLogger?.logError(e, s, _options);
|
||||||
@@ -267,27 +219,23 @@ class _ProfileService implements ProfileService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<List<WeightModel>>(Options(
|
final _options = _setStreamType<List<WeightModel>>(
|
||||||
method: 'GET',
|
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/profile/measure/weight/${period}',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/profile/measure/weight/${period}',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<List<dynamic>>(_options);
|
final _result = await _dio.fetch<List<dynamic>>(_options);
|
||||||
late List<WeightModel> _value;
|
late List<WeightModel> _value;
|
||||||
try {
|
try {
|
||||||
_value = _result.data!
|
_value = _result.data!
|
||||||
.map((dynamic i) => WeightModel.fromJson(i as Map<String, dynamic>))
|
.map(
|
||||||
|
(dynamic i) => WeightModel.fromJson(i as Map<String, dynamic>),
|
||||||
|
)
|
||||||
.toList();
|
.toList();
|
||||||
} on Object catch (e, s) {
|
} on Object catch (e, s) {
|
||||||
errorLogger?.logError(e, s, _options);
|
errorLogger?.logError(e, s, _options);
|
||||||
@@ -305,27 +253,23 @@ class _ProfileService implements ProfileService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<List<WeightModel>>(Options(
|
final _options = _setStreamType<List<WeightModel>>(
|
||||||
method: 'GET',
|
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/profile/measure/weight/${period}/${slug}',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/profile/measure/weight/${period}/${slug}',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<List<dynamic>>(_options);
|
final _result = await _dio.fetch<List<dynamic>>(_options);
|
||||||
late List<WeightModel> _value;
|
late List<WeightModel> _value;
|
||||||
try {
|
try {
|
||||||
_value = _result.data!
|
_value = _result.data!
|
||||||
.map((dynamic i) => WeightModel.fromJson(i as Map<String, dynamic>))
|
.map(
|
||||||
|
(dynamic i) => WeightModel.fromJson(i as Map<String, dynamic>),
|
||||||
|
)
|
||||||
.toList();
|
.toList();
|
||||||
} on Object catch (e, s) {
|
} on Object catch (e, s) {
|
||||||
errorLogger?.logError(e, s, _options);
|
errorLogger?.logError(e, s, _options);
|
||||||
@@ -335,34 +279,31 @@ class _ProfileService implements ProfileService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<List<CircumferenceModel>> getCircumferences(
|
Future<List<CircumferenceModel>> getCircumferences({
|
||||||
{required String period}) async {
|
required String period,
|
||||||
|
}) async {
|
||||||
final _extra = <String, dynamic>{};
|
final _extra = <String, dynamic>{};
|
||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<List<CircumferenceModel>>(Options(
|
final _options = _setStreamType<List<CircumferenceModel>>(
|
||||||
method: 'GET',
|
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/profile/measure/circumferences/${period}',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/profile/measure/circumferences/${period}',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<List<dynamic>>(_options);
|
final _result = await _dio.fetch<List<dynamic>>(_options);
|
||||||
late List<CircumferenceModel> _value;
|
late List<CircumferenceModel> _value;
|
||||||
try {
|
try {
|
||||||
_value = _result.data!
|
_value = _result.data!
|
||||||
.map((dynamic i) =>
|
.map(
|
||||||
CircumferenceModel.fromJson(i as Map<String, dynamic>))
|
(dynamic i) =>
|
||||||
|
CircumferenceModel.fromJson(i as Map<String, dynamic>),
|
||||||
|
)
|
||||||
.toList();
|
.toList();
|
||||||
} on Object catch (e, s) {
|
} on Object catch (e, s) {
|
||||||
errorLogger?.logError(e, s, _options);
|
errorLogger?.logError(e, s, _options);
|
||||||
@@ -380,28 +321,24 @@ class _ProfileService implements ProfileService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<List<CircumferenceModel>>(Options(
|
final _options = _setStreamType<List<CircumferenceModel>>(
|
||||||
method: 'GET',
|
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/profile/measure/circumferences/${period}/{user}',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/profile/measure/circumferences/${period}/{user}',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<List<dynamic>>(_options);
|
final _result = await _dio.fetch<List<dynamic>>(_options);
|
||||||
late List<CircumferenceModel> _value;
|
late List<CircumferenceModel> _value;
|
||||||
try {
|
try {
|
||||||
_value = _result.data!
|
_value = _result.data!
|
||||||
.map((dynamic i) =>
|
.map(
|
||||||
CircumferenceModel.fromJson(i as Map<String, dynamic>))
|
(dynamic i) =>
|
||||||
|
CircumferenceModel.fromJson(i as Map<String, dynamic>),
|
||||||
|
)
|
||||||
.toList();
|
.toList();
|
||||||
} on Object catch (e, s) {
|
} on Object catch (e, s) {
|
||||||
errorLogger?.logError(e, s, _options);
|
errorLogger?.logError(e, s, _options);
|
||||||
@@ -417,27 +354,21 @@ class _ProfileService implements ProfileService {
|
|||||||
}) async {
|
}) async {
|
||||||
final _extra = <String, dynamic>{};
|
final _extra = <String, dynamic>{};
|
||||||
final queryParameters = <String, dynamic>{
|
final queryParameters = <String, dynamic>{
|
||||||
r'filters[name][$startsWith]': query
|
r'filters[name][$startsWith]': query,
|
||||||
};
|
};
|
||||||
queryParameters.removeWhere((k, v) => v == null);
|
queryParameters.removeWhere((k, v) => v == null);
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<SubPaginationModel>(Options(
|
final _options = _setStreamType<SubPaginationModel>(
|
||||||
method: 'GET',
|
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/profile/${slug}/subscribers',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/profile/${slug}/subscribers',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||||
late SubPaginationModel _value;
|
late SubPaginationModel _value;
|
||||||
try {
|
try {
|
||||||
@@ -456,27 +387,21 @@ class _ProfileService implements ProfileService {
|
|||||||
}) async {
|
}) async {
|
||||||
final _extra = <String, dynamic>{};
|
final _extra = <String, dynamic>{};
|
||||||
final queryParameters = <String, dynamic>{
|
final queryParameters = <String, dynamic>{
|
||||||
r'filters[name][$startsWith]': query
|
r'filters[name][$startsWith]': query,
|
||||||
};
|
};
|
||||||
queryParameters.removeWhere((k, v) => v == null);
|
queryParameters.removeWhere((k, v) => v == null);
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<SubPaginationModel>(Options(
|
final _options = _setStreamType<SubPaginationModel>(
|
||||||
method: 'GET',
|
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/profile/${slug}/subscriptions',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/profile/${slug}/subscriptions',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||||
late SubPaginationModel _value;
|
late SubPaginationModel _value;
|
||||||
try {
|
try {
|
||||||
@@ -494,22 +419,16 @@ class _ProfileService implements ProfileService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<void>(Options(
|
final _options = _setStreamType<void>(
|
||||||
method: 'POST',
|
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/profile/subscribe/${slug}',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/profile/subscribe/${slug}',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
await _dio.fetch<void>(_options);
|
await _dio.fetch<void>(_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -519,22 +438,16 @@ class _ProfileService implements ProfileService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<void>(Options(
|
final _options = _setStreamType<void>(
|
||||||
method: 'POST',
|
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/profile/unsubscribe/${slug}',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/profile/unsubscribe/${slug}',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
await _dio.fetch<void>(_options);
|
await _dio.fetch<void>(_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -544,30 +457,30 @@ class _ProfileService implements ProfileService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
final _data = FormData();
|
final _data = FormData();
|
||||||
_data.files.add(MapEntry(
|
_data.files.add(
|
||||||
'photo',
|
MapEntry(
|
||||||
MultipartFile.fromFileSync(
|
'photo',
|
||||||
photo.path,
|
MultipartFile.fromFileSync(
|
||||||
filename: photo.path.split(Platform.pathSeparator).last,
|
photo.path,
|
||||||
|
filename: photo.path.split(Platform.pathSeparator).last,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
));
|
);
|
||||||
final _options = _setStreamType<void>(Options(
|
final _options = _setStreamType<void>(
|
||||||
method: 'POST',
|
Options(
|
||||||
headers: _headers,
|
method: 'POST',
|
||||||
extra: _extra,
|
headers: _headers,
|
||||||
contentType: 'multipart/form-data',
|
extra: _extra,
|
||||||
)
|
contentType: 'multipart/form-data',
|
||||||
.compose(
|
)
|
||||||
_dio.options,
|
.compose(
|
||||||
'/api/profile/photo/upload',
|
_dio.options,
|
||||||
queryParameters: queryParameters,
|
'/api/profile/photo/upload',
|
||||||
data: _data,
|
queryParameters: queryParameters,
|
||||||
)
|
data: _data,
|
||||||
.copyWith(
|
)
|
||||||
baseUrl: _combineBaseUrls(
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
_dio.options.baseUrl,
|
);
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
await _dio.fetch<void>(_options);
|
await _dio.fetch<void>(_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -577,22 +490,16 @@ class _ProfileService implements ProfileService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<void>(Options(
|
final _options = _setStreamType<void>(
|
||||||
method: 'DELETE',
|
Options(method: 'DELETE', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/profile/photo/delete',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/profile/photo/delete',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
await _dio.fetch<void>(_options);
|
await _dio.fetch<void>(_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -609,10 +516,7 @@ class _ProfileService implements ProfileService {
|
|||||||
return requestOptions;
|
return requestOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
String _combineBaseUrls(
|
String _combineBaseUrls(String dioBaseUrl, String? baseUrl) {
|
||||||
String dioBaseUrl,
|
|
||||||
String? baseUrl,
|
|
||||||
) {
|
|
||||||
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
||||||
return dioBaseUrl;
|
return dioBaseUrl;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,11 +9,7 @@ part of 'recipe_service.dart';
|
|||||||
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
||||||
|
|
||||||
class _RecipeService implements RecipeService {
|
class _RecipeService implements RecipeService {
|
||||||
_RecipeService(
|
_RecipeService(this._dio, {this.baseUrl, this.errorLogger});
|
||||||
this._dio, {
|
|
||||||
this.baseUrl,
|
|
||||||
this.errorLogger,
|
|
||||||
});
|
|
||||||
|
|
||||||
final Dio _dio;
|
final Dio _dio;
|
||||||
|
|
||||||
@@ -27,22 +23,16 @@ class _RecipeService implements RecipeService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<RecipeModel>(Options(
|
final _options = _setStreamType<RecipeModel>(
|
||||||
method: 'GET',
|
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/recipes/show/${id}',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/recipes/show/${id}',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||||
late RecipeModel _value;
|
late RecipeModel _value;
|
||||||
try {
|
try {
|
||||||
@@ -60,30 +50,27 @@ class _RecipeService implements RecipeService {
|
|||||||
final queryParameters = <String, dynamic>{r'name': name};
|
final queryParameters = <String, dynamic>{r'name': name};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<Map<String, List<Product>>>(Options(
|
final _options = _setStreamType<Map<String, List<Product>>>(
|
||||||
method: 'GET',
|
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/diary/product_nutritional_values/filter',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/diary/product_nutritional_values/filter',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||||
late Map<String, List<Product>> _value;
|
late Map<String, List<Product>> _value;
|
||||||
try {
|
try {
|
||||||
_value = _result.data!.map((k, dynamic v) => MapEntry(
|
_value = _result.data!.map(
|
||||||
|
(k, dynamic v) => MapEntry(
|
||||||
k,
|
k,
|
||||||
(v as List)
|
(v as List)
|
||||||
.map((i) => Product.fromJson(i as Map<String, dynamic>))
|
.map((i) => Product.fromJson(i as Map<String, dynamic>))
|
||||||
.toList()));
|
.toList(),
|
||||||
|
),
|
||||||
|
);
|
||||||
} on Object catch (e, s) {
|
} on Object catch (e, s) {
|
||||||
errorLogger?.logError(e, s, _options);
|
errorLogger?.logError(e, s, _options);
|
||||||
rethrow;
|
rethrow;
|
||||||
@@ -109,34 +96,19 @@ class _RecipeService implements RecipeService {
|
|||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
final _data = FormData();
|
final _data = FormData();
|
||||||
if (type != null) {
|
if (type != null) {
|
||||||
_data.fields.add(MapEntry(
|
_data.fields.add(MapEntry('type', type));
|
||||||
'type',
|
|
||||||
type,
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
if (state != null) {
|
if (state != null) {
|
||||||
_data.fields.add(MapEntry(
|
_data.fields.add(MapEntry('state', state));
|
||||||
'state',
|
|
||||||
state,
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
if (title != null) {
|
if (title != null) {
|
||||||
_data.fields.add(MapEntry(
|
_data.fields.add(MapEntry('title', title));
|
||||||
'title',
|
|
||||||
title,
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
if (description != null) {
|
if (description != null) {
|
||||||
_data.fields.add(MapEntry(
|
_data.fields.add(MapEntry('description', description));
|
||||||
'description',
|
|
||||||
description,
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
if (video_url != null) {
|
if (video_url != null) {
|
||||||
_data.fields.add(MapEntry(
|
_data.fields.add(MapEntry('video_url', video_url));
|
||||||
'video_url',
|
|
||||||
video_url,
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
ingredients.forEach((i) {
|
ingredients.forEach((i) {
|
||||||
_data.fields.add(MapEntry('ingredients', jsonEncode(i)));
|
_data.fields.add(MapEntry('ingredients', jsonEncode(i)));
|
||||||
@@ -145,34 +117,27 @@ class _RecipeService implements RecipeService {
|
|||||||
_data.fields.add(MapEntry('steps', jsonEncode(i)));
|
_data.fields.add(MapEntry('steps', jsonEncode(i)));
|
||||||
});
|
});
|
||||||
if (cooking_time != null) {
|
if (cooking_time != null) {
|
||||||
_data.fields.add(MapEntry(
|
_data.fields.add(MapEntry('cooking_time', cooking_time.toString()));
|
||||||
'cooking_time',
|
|
||||||
cooking_time.toString(),
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
_data.files.add(MapEntry(
|
_data.files.add(
|
||||||
'image',
|
MapEntry(
|
||||||
MultipartFile.fromFileSync(
|
'image',
|
||||||
image.path,
|
MultipartFile.fromFileSync(
|
||||||
filename: image.path.split(Platform.pathSeparator).last,
|
image.path,
|
||||||
|
filename: image.path.split(Platform.pathSeparator).last,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
));
|
);
|
||||||
final _options = _setStreamType<RecipeModel>(Options(
|
final _options = _setStreamType<RecipeModel>(
|
||||||
method: 'POST',
|
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/recipes/create',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/recipes/create',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||||
late RecipeModel _value;
|
late RecipeModel _value;
|
||||||
try {
|
try {
|
||||||
@@ -185,30 +150,21 @@ class _RecipeService implements RecipeService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<RecipeModel> editRecipe(
|
Future<RecipeModel> editRecipe(Map<String, Object?> recipe, String id) async {
|
||||||
Map<String, Object?> recipe,
|
|
||||||
String id,
|
|
||||||
) async {
|
|
||||||
final _extra = <String, dynamic>{};
|
final _extra = <String, dynamic>{};
|
||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
final _data = FormData.fromMap(recipe);
|
final _data = FormData.fromMap(recipe);
|
||||||
final _options = _setStreamType<RecipeModel>(Options(
|
final _options = _setStreamType<RecipeModel>(
|
||||||
method: 'POST',
|
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/recipes/update/{id}',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/recipes/update/{id}',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||||
late RecipeModel _value;
|
late RecipeModel _value;
|
||||||
try {
|
try {
|
||||||
@@ -226,22 +182,16 @@ class _RecipeService implements RecipeService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<RecipeTagModel>(Options(
|
final _options = _setStreamType<RecipeTagModel>(
|
||||||
method: 'GET',
|
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/recipes/tags',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/recipes/tags',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||||
late RecipeTagModel _value;
|
late RecipeTagModel _value;
|
||||||
try {
|
try {
|
||||||
@@ -266,10 +216,7 @@ class _RecipeService implements RecipeService {
|
|||||||
return requestOptions;
|
return requestOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
String _combineBaseUrls(
|
String _combineBaseUrls(String dioBaseUrl, String? baseUrl) {
|
||||||
String dioBaseUrl,
|
|
||||||
String? baseUrl,
|
|
||||||
) {
|
|
||||||
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
||||||
return dioBaseUrl;
|
return dioBaseUrl;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,11 +9,7 @@ part of 'registration_service.dart';
|
|||||||
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
||||||
|
|
||||||
class _RegistrationService implements RegistrationService {
|
class _RegistrationService implements RegistrationService {
|
||||||
_RegistrationService(
|
_RegistrationService(this._dio, {this.baseUrl, this.errorLogger});
|
||||||
this._dio, {
|
|
||||||
this.baseUrl,
|
|
||||||
this.errorLogger,
|
|
||||||
});
|
|
||||||
|
|
||||||
final Dio _dio;
|
final Dio _dio;
|
||||||
|
|
||||||
@@ -22,29 +18,24 @@ class _RegistrationService implements RegistrationService {
|
|||||||
final ParseErrorLogger? errorLogger;
|
final ParseErrorLogger? errorLogger;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<Map<String, String>> register(
|
Future<Map<String, String>> register({
|
||||||
{required Map<String, dynamic> sheet}) async {
|
required Map<String, dynamic> sheet,
|
||||||
|
}) async {
|
||||||
final _extra = <String, dynamic>{};
|
final _extra = <String, dynamic>{};
|
||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
final _data = <String, dynamic>{};
|
final _data = <String, dynamic>{};
|
||||||
_data.addAll(sheet);
|
_data.addAll(sheet);
|
||||||
final _options = _setStreamType<Map<String, String>>(Options(
|
final _options = _setStreamType<Map<String, String>>(
|
||||||
method: 'POST',
|
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/register',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/register',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||||
late Map<String, String> _value;
|
late Map<String, String> _value;
|
||||||
try {
|
try {
|
||||||
@@ -62,22 +53,16 @@ class _RegistrationService implements RegistrationService {
|
|||||||
final queryParameters = <String, dynamic>{r'user_address': query};
|
final queryParameters = <String, dynamic>{r'user_address': query};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<LocationModel>(Options(
|
final _options = _setStreamType<LocationModel>(
|
||||||
method: 'GET',
|
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/location_by_address',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/location_by_address',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||||
late LocationModel _value;
|
late LocationModel _value;
|
||||||
try {
|
try {
|
||||||
@@ -101,22 +86,16 @@ class _RegistrationService implements RegistrationService {
|
|||||||
};
|
};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<LocationModel>(Options(
|
final _options = _setStreamType<LocationModel>(
|
||||||
method: 'GET',
|
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/location_by_coordinate',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/location_by_coordinate',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||||
late LocationModel _value;
|
late LocationModel _value;
|
||||||
try {
|
try {
|
||||||
@@ -141,10 +120,7 @@ class _RegistrationService implements RegistrationService {
|
|||||||
return requestOptions;
|
return requestOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
String _combineBaseUrls(
|
String _combineBaseUrls(String dioBaseUrl, String? baseUrl) {
|
||||||
String dioBaseUrl,
|
|
||||||
String? baseUrl,
|
|
||||||
) {
|
|
||||||
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
||||||
return dioBaseUrl;
|
return dioBaseUrl;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,11 +9,7 @@ part of 'settings_service.dart';
|
|||||||
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
||||||
|
|
||||||
class _SettingsService implements SettingsService {
|
class _SettingsService implements SettingsService {
|
||||||
_SettingsService(
|
_SettingsService(this._dio, {this.baseUrl, this.errorLogger});
|
||||||
this._dio, {
|
|
||||||
this.baseUrl,
|
|
||||||
this.errorLogger,
|
|
||||||
});
|
|
||||||
|
|
||||||
final Dio _dio;
|
final Dio _dio;
|
||||||
|
|
||||||
@@ -27,22 +23,16 @@ class _SettingsService implements SettingsService {
|
|||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
const Map<String, dynamic>? _data = null;
|
const Map<String, dynamic>? _data = null;
|
||||||
final _options = _setStreamType<ProfileSettingsModel>(Options(
|
final _options = _setStreamType<ProfileSettingsModel>(
|
||||||
method: 'GET',
|
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/profile/settings',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/profile/settings',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||||
late ProfileSettingsModel _value;
|
late ProfileSettingsModel _value;
|
||||||
try {
|
try {
|
||||||
@@ -55,29 +45,24 @@ class _SettingsService implements SettingsService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<ProfileSettingsModel> updateProfileSettings(
|
Future<ProfileSettingsModel> updateProfileSettings({
|
||||||
{required Map<String, dynamic> data}) async {
|
required Map<String, dynamic> data,
|
||||||
|
}) async {
|
||||||
final _extra = <String, dynamic>{};
|
final _extra = <String, dynamic>{};
|
||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
final _data = <String, dynamic>{};
|
final _data = <String, dynamic>{};
|
||||||
_data.addAll(data);
|
_data.addAll(data);
|
||||||
final _options = _setStreamType<ProfileSettingsModel>(Options(
|
final _options = _setStreamType<ProfileSettingsModel>(
|
||||||
method: 'POST',
|
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/profile/settings/update',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/profile/settings/update',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||||
late ProfileSettingsModel _value;
|
late ProfileSettingsModel _value;
|
||||||
try {
|
try {
|
||||||
@@ -90,29 +75,24 @@ class _SettingsService implements SettingsService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<ProfileDetailsModel> updateProfileDetails(
|
Future<ProfileDetailsModel> updateProfileDetails({
|
||||||
{required Map<String, dynamic> data}) async {
|
required Map<String, dynamic> data,
|
||||||
|
}) async {
|
||||||
final _extra = <String, dynamic>{};
|
final _extra = <String, dynamic>{};
|
||||||
final queryParameters = <String, dynamic>{};
|
final queryParameters = <String, dynamic>{};
|
||||||
final _headers = <String, dynamic>{};
|
final _headers = <String, dynamic>{};
|
||||||
final _data = <String, dynamic>{};
|
final _data = <String, dynamic>{};
|
||||||
_data.addAll(data);
|
_data.addAll(data);
|
||||||
final _options = _setStreamType<ProfileDetailsModel>(Options(
|
final _options = _setStreamType<ProfileDetailsModel>(
|
||||||
method: 'POST',
|
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||||
headers: _headers,
|
.compose(
|
||||||
extra: _extra,
|
_dio.options,
|
||||||
)
|
'/api/profile/update',
|
||||||
.compose(
|
queryParameters: queryParameters,
|
||||||
_dio.options,
|
data: _data,
|
||||||
'/api/profile/update',
|
)
|
||||||
queryParameters: queryParameters,
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||||
data: _data,
|
);
|
||||||
)
|
|
||||||
.copyWith(
|
|
||||||
baseUrl: _combineBaseUrls(
|
|
||||||
_dio.options.baseUrl,
|
|
||||||
baseUrl,
|
|
||||||
)));
|
|
||||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||||
late ProfileDetailsModel _value;
|
late ProfileDetailsModel _value;
|
||||||
try {
|
try {
|
||||||
@@ -137,10 +117,7 @@ class _SettingsService implements SettingsService {
|
|||||||
return requestOptions;
|
return requestOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
String _combineBaseUrls(
|
String _combineBaseUrls(String dioBaseUrl, String? baseUrl) {
|
||||||
String dioBaseUrl,
|
|
||||||
String? baseUrl,
|
|
||||||
) {
|
|
||||||
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
||||||
return dioBaseUrl;
|
return dioBaseUrl;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ Future<void> main() async {
|
|||||||
FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding);
|
FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding);
|
||||||
await di.init();
|
await di.init();
|
||||||
runApp(MyApp());
|
runApp(MyApp());
|
||||||
|
FlutterNativeSplash.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
class MyApp extends StatelessWidget {
|
class MyApp extends StatelessWidget {
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ dependencies:
|
|||||||
syncfusion_flutter_gauges: ^28.1.38
|
syncfusion_flutter_gauges: ^28.1.38
|
||||||
table_calendar: ^3.1.3
|
table_calendar: ^3.1.3
|
||||||
flutter_keyboard_visibility: ^6.0.0
|
flutter_keyboard_visibility: ^6.0.0
|
||||||
share_plus: ^10.1.3
|
share_plus: ^10.1.4
|
||||||
flutter_html: ^3.0.0-beta.2
|
flutter_html: ^3.0.0-beta.2
|
||||||
file_picker: ^8.1.7
|
file_picker: ^8.1.7
|
||||||
audioplayers: ^6.1.0
|
audioplayers: ^6.1.0
|
||||||
|
|||||||
@@ -32,35 +32,20 @@ import 'package:mockito/mockito.dart' as _i1;
|
|||||||
// ignore_for_file: subtype_of_sealed_class
|
// ignore_for_file: subtype_of_sealed_class
|
||||||
|
|
||||||
class _FakeProfileModel_0 extends _i1.SmartFake implements _i2.ProfileModel {
|
class _FakeProfileModel_0 extends _i1.SmartFake implements _i2.ProfileModel {
|
||||||
_FakeProfileModel_0(
|
_FakeProfileModel_0(Object parent, Invocation parentInvocation)
|
||||||
Object parent,
|
: super(parent, parentInvocation);
|
||||||
Invocation parentInvocation,
|
|
||||||
) : super(
|
|
||||||
parent,
|
|
||||||
parentInvocation,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class _FakeProfileDetailsModel_1 extends _i1.SmartFake
|
class _FakeProfileDetailsModel_1 extends _i1.SmartFake
|
||||||
implements _i2.ProfileDetailsModel {
|
implements _i2.ProfileDetailsModel {
|
||||||
_FakeProfileDetailsModel_1(
|
_FakeProfileDetailsModel_1(Object parent, Invocation parentInvocation)
|
||||||
Object parent,
|
: super(parent, parentInvocation);
|
||||||
Invocation parentInvocation,
|
|
||||||
) : super(
|
|
||||||
parent,
|
|
||||||
parentInvocation,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class _FakeSubPaginationModel_2 extends _i1.SmartFake
|
class _FakeSubPaginationModel_2 extends _i1.SmartFake
|
||||||
implements _i3.SubPaginationModel {
|
implements _i3.SubPaginationModel {
|
||||||
_FakeSubPaginationModel_2(
|
_FakeSubPaginationModel_2(Object parent, Invocation parentInvocation)
|
||||||
Object parent,
|
: super(parent, parentInvocation);
|
||||||
Invocation parentInvocation,
|
|
||||||
) : super(
|
|
||||||
parent,
|
|
||||||
parentInvocation,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A class which mocks [ProfileService].
|
/// A class which mocks [ProfileService].
|
||||||
@@ -70,106 +55,78 @@ class MockProfileService extends _i1.Mock implements _i4.ProfileService {
|
|||||||
@override
|
@override
|
||||||
_i5.Future<_i2.ProfileModel> getProfileBySlug({required String? slug}) =>
|
_i5.Future<_i2.ProfileModel> getProfileBySlug({required String? slug}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(#getProfileBySlug, [], {#slug: slug}),
|
||||||
#getProfileBySlug,
|
returnValue: _i5.Future<_i2.ProfileModel>.value(
|
||||||
[],
|
_FakeProfileModel_0(
|
||||||
{#slug: slug},
|
this,
|
||||||
),
|
Invocation.method(#getProfileBySlug, [], {#slug: slug}),
|
||||||
returnValue: _i5.Future<_i2.ProfileModel>.value(_FakeProfileModel_0(
|
),
|
||||||
this,
|
),
|
||||||
Invocation.method(
|
returnValueForMissingStub: _i5.Future<_i2.ProfileModel>.value(
|
||||||
#getProfileBySlug,
|
_FakeProfileModel_0(
|
||||||
[],
|
this,
|
||||||
{#slug: slug},
|
Invocation.method(#getProfileBySlug, [], {#slug: slug}),
|
||||||
),
|
),
|
||||||
)),
|
),
|
||||||
returnValueForMissingStub:
|
)
|
||||||
_i5.Future<_i2.ProfileModel>.value(_FakeProfileModel_0(
|
as _i5.Future<_i2.ProfileModel>);
|
||||||
this,
|
|
||||||
Invocation.method(
|
|
||||||
#getProfileBySlug,
|
|
||||||
[],
|
|
||||||
{#slug: slug},
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
) as _i5.Future<_i2.ProfileModel>);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_i5.Future<_i2.ProfileModel> getMyProfile() => (super.noSuchMethod(
|
_i5.Future<_i2.ProfileModel> getMyProfile() =>
|
||||||
Invocation.method(
|
(super.noSuchMethod(
|
||||||
#getMyProfile,
|
Invocation.method(#getMyProfile, []),
|
||||||
[],
|
returnValue: _i5.Future<_i2.ProfileModel>.value(
|
||||||
),
|
_FakeProfileModel_0(this, Invocation.method(#getMyProfile, [])),
|
||||||
returnValue: _i5.Future<_i2.ProfileModel>.value(_FakeProfileModel_0(
|
),
|
||||||
this,
|
returnValueForMissingStub: _i5.Future<_i2.ProfileModel>.value(
|
||||||
Invocation.method(
|
_FakeProfileModel_0(this, Invocation.method(#getMyProfile, [])),
|
||||||
#getMyProfile,
|
),
|
||||||
[],
|
)
|
||||||
),
|
as _i5.Future<_i2.ProfileModel>);
|
||||||
)),
|
|
||||||
returnValueForMissingStub:
|
|
||||||
_i5.Future<_i2.ProfileModel>.value(_FakeProfileModel_0(
|
|
||||||
this,
|
|
||||||
Invocation.method(
|
|
||||||
#getMyProfile,
|
|
||||||
[],
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
) as _i5.Future<_i2.ProfileModel>);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_i5.Future<_i2.ProfileDetailsModel> getMyProfileDetails() =>
|
_i5.Future<_i2.ProfileDetailsModel> getMyProfileDetails() =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(#getMyProfileDetails, []),
|
||||||
#getMyProfileDetails,
|
returnValue: _i5.Future<_i2.ProfileDetailsModel>.value(
|
||||||
[],
|
_FakeProfileDetailsModel_1(
|
||||||
),
|
this,
|
||||||
returnValue: _i5.Future<_i2.ProfileDetailsModel>.value(
|
Invocation.method(#getMyProfileDetails, []),
|
||||||
_FakeProfileDetailsModel_1(
|
),
|
||||||
this,
|
),
|
||||||
Invocation.method(
|
returnValueForMissingStub:
|
||||||
#getMyProfileDetails,
|
_i5.Future<_i2.ProfileDetailsModel>.value(
|
||||||
[],
|
_FakeProfileDetailsModel_1(
|
||||||
),
|
this,
|
||||||
)),
|
Invocation.method(#getMyProfileDetails, []),
|
||||||
returnValueForMissingStub: _i5.Future<_i2.ProfileDetailsModel>.value(
|
),
|
||||||
_FakeProfileDetailsModel_1(
|
),
|
||||||
this,
|
)
|
||||||
Invocation.method(
|
as _i5.Future<_i2.ProfileDetailsModel>);
|
||||||
#getMyProfileDetails,
|
|
||||||
[],
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
) as _i5.Future<_i2.ProfileDetailsModel>);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_i5.Future<_i2.ProfileDetailsModel> getProfileDetailsBySlug(
|
_i5.Future<_i2.ProfileDetailsModel> getProfileDetailsBySlug({
|
||||||
{required String? slug}) =>
|
required String? slug,
|
||||||
|
}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(#getProfileDetailsBySlug, [], {#slug: slug}),
|
||||||
#getProfileDetailsBySlug,
|
returnValue: _i5.Future<_i2.ProfileDetailsModel>.value(
|
||||||
[],
|
_FakeProfileDetailsModel_1(
|
||||||
{#slug: slug},
|
this,
|
||||||
),
|
Invocation.method(#getProfileDetailsBySlug, [], {#slug: slug}),
|
||||||
returnValue: _i5.Future<_i2.ProfileDetailsModel>.value(
|
),
|
||||||
_FakeProfileDetailsModel_1(
|
),
|
||||||
this,
|
returnValueForMissingStub:
|
||||||
Invocation.method(
|
_i5.Future<_i2.ProfileDetailsModel>.value(
|
||||||
#getProfileDetailsBySlug,
|
_FakeProfileDetailsModel_1(
|
||||||
[],
|
this,
|
||||||
{#slug: slug},
|
Invocation.method(#getProfileDetailsBySlug, [], {
|
||||||
),
|
#slug: slug,
|
||||||
)),
|
}),
|
||||||
returnValueForMissingStub: _i5.Future<_i2.ProfileDetailsModel>.value(
|
),
|
||||||
_FakeProfileDetailsModel_1(
|
),
|
||||||
this,
|
)
|
||||||
Invocation.method(
|
as _i5.Future<_i2.ProfileDetailsModel>);
|
||||||
#getProfileDetailsBySlug,
|
|
||||||
[],
|
|
||||||
{#slug: slug},
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
) as _i5.Future<_i2.ProfileDetailsModel>);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_i5.Future<void> addCircumference({
|
_i5.Future<void> addCircumference({
|
||||||
@@ -178,59 +135,53 @@ class MockProfileService extends _i1.Mock implements _i4.ProfileService {
|
|||||||
required int? hipCircumference,
|
required int? hipCircumference,
|
||||||
}) =>
|
}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(#addCircumference, [], {
|
||||||
#addCircumference,
|
#chestCircumference: chestCircumference,
|
||||||
[],
|
#waistCircumference: waistCircumference,
|
||||||
{
|
#hipCircumference: hipCircumference,
|
||||||
#chestCircumference: chestCircumference,
|
}),
|
||||||
#waistCircumference: waistCircumference,
|
returnValue: _i5.Future<void>.value(),
|
||||||
#hipCircumference: hipCircumference,
|
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||||
},
|
)
|
||||||
),
|
as _i5.Future<void>);
|
||||||
returnValue: _i5.Future<void>.value(),
|
|
||||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
|
||||||
) as _i5.Future<void>);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_i5.Future<void> addWeight({required double? weight}) => (super.noSuchMethod(
|
_i5.Future<void> addWeight({required double? weight}) =>
|
||||||
Invocation.method(
|
|
||||||
#addWeight,
|
|
||||||
[],
|
|
||||||
{#weight: weight},
|
|
||||||
),
|
|
||||||
returnValue: _i5.Future<void>.value(),
|
|
||||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
|
||||||
) as _i5.Future<void>);
|
|
||||||
|
|
||||||
@override
|
|
||||||
_i5.Future<List<_i6.FeedBlogPostModel>> getBlogPostByAuthorSlug(
|
|
||||||
{required String? slug}) =>
|
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(#addWeight, [], {#weight: weight}),
|
||||||
#getBlogPostByAuthorSlug,
|
returnValue: _i5.Future<void>.value(),
|
||||||
[],
|
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||||
{#slug: slug},
|
)
|
||||||
),
|
as _i5.Future<void>);
|
||||||
returnValue: _i5.Future<List<_i6.FeedBlogPostModel>>.value(
|
|
||||||
<_i6.FeedBlogPostModel>[]),
|
@override
|
||||||
returnValueForMissingStub:
|
_i5.Future<List<_i6.FeedBlogPostModel>> getBlogPostByAuthorSlug({
|
||||||
_i5.Future<List<_i6.FeedBlogPostModel>>.value(
|
required String? slug,
|
||||||
<_i6.FeedBlogPostModel>[]),
|
}) =>
|
||||||
) as _i5.Future<List<_i6.FeedBlogPostModel>>);
|
(super.noSuchMethod(
|
||||||
|
Invocation.method(#getBlogPostByAuthorSlug, [], {#slug: slug}),
|
||||||
|
returnValue: _i5.Future<List<_i6.FeedBlogPostModel>>.value(
|
||||||
|
<_i6.FeedBlogPostModel>[],
|
||||||
|
),
|
||||||
|
returnValueForMissingStub:
|
||||||
|
_i5.Future<List<_i6.FeedBlogPostModel>>.value(
|
||||||
|
<_i6.FeedBlogPostModel>[],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
as _i5.Future<List<_i6.FeedBlogPostModel>>);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_i5.Future<List<_i7.WeightModel>> getWeight({required String? period}) =>
|
_i5.Future<List<_i7.WeightModel>> getWeight({required String? period}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(#getWeight, [], {#period: period}),
|
||||||
#getWeight,
|
returnValue: _i5.Future<List<_i7.WeightModel>>.value(
|
||||||
[],
|
<_i7.WeightModel>[],
|
||||||
{#period: period},
|
),
|
||||||
),
|
returnValueForMissingStub: _i5.Future<List<_i7.WeightModel>>.value(
|
||||||
returnValue:
|
<_i7.WeightModel>[],
|
||||||
_i5.Future<List<_i7.WeightModel>>.value(<_i7.WeightModel>[]),
|
),
|
||||||
returnValueForMissingStub:
|
)
|
||||||
_i5.Future<List<_i7.WeightModel>>.value(<_i7.WeightModel>[]),
|
as _i5.Future<List<_i7.WeightModel>>);
|
||||||
) as _i5.Future<List<_i7.WeightModel>>);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_i5.Future<List<_i7.WeightModel>> getWeightBySlug({
|
_i5.Future<List<_i7.WeightModel>> getWeightBySlug({
|
||||||
@@ -238,35 +189,34 @@ class MockProfileService extends _i1.Mock implements _i4.ProfileService {
|
|||||||
required String? slug,
|
required String? slug,
|
||||||
}) =>
|
}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(#getWeightBySlug, [], {
|
||||||
#getWeightBySlug,
|
#period: period,
|
||||||
[],
|
#slug: slug,
|
||||||
{
|
}),
|
||||||
#period: period,
|
returnValue: _i5.Future<List<_i7.WeightModel>>.value(
|
||||||
#slug: slug,
|
<_i7.WeightModel>[],
|
||||||
},
|
),
|
||||||
),
|
returnValueForMissingStub: _i5.Future<List<_i7.WeightModel>>.value(
|
||||||
returnValue:
|
<_i7.WeightModel>[],
|
||||||
_i5.Future<List<_i7.WeightModel>>.value(<_i7.WeightModel>[]),
|
),
|
||||||
returnValueForMissingStub:
|
)
|
||||||
_i5.Future<List<_i7.WeightModel>>.value(<_i7.WeightModel>[]),
|
as _i5.Future<List<_i7.WeightModel>>);
|
||||||
) as _i5.Future<List<_i7.WeightModel>>);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_i5.Future<List<_i8.CircumferenceModel>> getCircumferences(
|
_i5.Future<List<_i8.CircumferenceModel>> getCircumferences({
|
||||||
{required String? period}) =>
|
required String? period,
|
||||||
|
}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(#getCircumferences, [], {#period: period}),
|
||||||
#getCircumferences,
|
returnValue: _i5.Future<List<_i8.CircumferenceModel>>.value(
|
||||||
[],
|
<_i8.CircumferenceModel>[],
|
||||||
{#period: period},
|
),
|
||||||
),
|
returnValueForMissingStub:
|
||||||
returnValue: _i5.Future<List<_i8.CircumferenceModel>>.value(
|
_i5.Future<List<_i8.CircumferenceModel>>.value(
|
||||||
<_i8.CircumferenceModel>[]),
|
<_i8.CircumferenceModel>[],
|
||||||
returnValueForMissingStub:
|
),
|
||||||
_i5.Future<List<_i8.CircumferenceModel>>.value(
|
)
|
||||||
<_i8.CircumferenceModel>[]),
|
as _i5.Future<List<_i8.CircumferenceModel>>);
|
||||||
) as _i5.Future<List<_i8.CircumferenceModel>>);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_i5.Future<List<_i8.CircumferenceModel>> getCircumferencesBySlug({
|
_i5.Future<List<_i8.CircumferenceModel>> getCircumferencesBySlug({
|
||||||
@@ -274,20 +224,19 @@ class MockProfileService extends _i1.Mock implements _i4.ProfileService {
|
|||||||
required String? slug,
|
required String? slug,
|
||||||
}) =>
|
}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(#getCircumferencesBySlug, [], {
|
||||||
#getCircumferencesBySlug,
|
#period: period,
|
||||||
[],
|
#slug: slug,
|
||||||
{
|
}),
|
||||||
#period: period,
|
returnValue: _i5.Future<List<_i8.CircumferenceModel>>.value(
|
||||||
#slug: slug,
|
<_i8.CircumferenceModel>[],
|
||||||
},
|
),
|
||||||
),
|
returnValueForMissingStub:
|
||||||
returnValue: _i5.Future<List<_i8.CircumferenceModel>>.value(
|
_i5.Future<List<_i8.CircumferenceModel>>.value(
|
||||||
<_i8.CircumferenceModel>[]),
|
<_i8.CircumferenceModel>[],
|
||||||
returnValueForMissingStub:
|
),
|
||||||
_i5.Future<List<_i8.CircumferenceModel>>.value(
|
)
|
||||||
<_i8.CircumferenceModel>[]),
|
as _i5.Future<List<_i8.CircumferenceModel>>);
|
||||||
) as _i5.Future<List<_i8.CircumferenceModel>>);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_i5.Future<_i3.SubPaginationModel> getSubscribers({
|
_i5.Future<_i3.SubPaginationModel> getSubscribers({
|
||||||
@@ -295,39 +244,30 @@ class MockProfileService extends _i1.Mock implements _i4.ProfileService {
|
|||||||
String? query,
|
String? query,
|
||||||
}) =>
|
}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(#getSubscribers, [], {
|
||||||
#getSubscribers,
|
|
||||||
[],
|
|
||||||
{
|
|
||||||
#slug: slug,
|
|
||||||
#query: query,
|
|
||||||
},
|
|
||||||
),
|
|
||||||
returnValue:
|
|
||||||
_i5.Future<_i3.SubPaginationModel>.value(_FakeSubPaginationModel_2(
|
|
||||||
this,
|
|
||||||
Invocation.method(
|
|
||||||
#getSubscribers,
|
|
||||||
[],
|
|
||||||
{
|
|
||||||
#slug: slug,
|
#slug: slug,
|
||||||
#query: query,
|
#query: query,
|
||||||
},
|
}),
|
||||||
),
|
returnValue: _i5.Future<_i3.SubPaginationModel>.value(
|
||||||
)),
|
_FakeSubPaginationModel_2(
|
||||||
returnValueForMissingStub:
|
this,
|
||||||
_i5.Future<_i3.SubPaginationModel>.value(_FakeSubPaginationModel_2(
|
Invocation.method(#getSubscribers, [], {
|
||||||
this,
|
#slug: slug,
|
||||||
Invocation.method(
|
#query: query,
|
||||||
#getSubscribers,
|
}),
|
||||||
[],
|
),
|
||||||
{
|
),
|
||||||
#slug: slug,
|
returnValueForMissingStub: _i5.Future<_i3.SubPaginationModel>.value(
|
||||||
#query: query,
|
_FakeSubPaginationModel_2(
|
||||||
},
|
this,
|
||||||
),
|
Invocation.method(#getSubscribers, [], {
|
||||||
)),
|
#slug: slug,
|
||||||
) as _i5.Future<_i3.SubPaginationModel>);
|
#query: query,
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
as _i5.Future<_i3.SubPaginationModel>);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_i5.Future<_i3.SubPaginationModel> getSubscriptions({
|
_i5.Future<_i3.SubPaginationModel> getSubscriptions({
|
||||||
@@ -335,81 +275,64 @@ class MockProfileService extends _i1.Mock implements _i4.ProfileService {
|
|||||||
String? query,
|
String? query,
|
||||||
}) =>
|
}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(#getSubscriptions, [], {
|
||||||
#getSubscriptions,
|
|
||||||
[],
|
|
||||||
{
|
|
||||||
#slug: slug,
|
|
||||||
#query: query,
|
|
||||||
},
|
|
||||||
),
|
|
||||||
returnValue:
|
|
||||||
_i5.Future<_i3.SubPaginationModel>.value(_FakeSubPaginationModel_2(
|
|
||||||
this,
|
|
||||||
Invocation.method(
|
|
||||||
#getSubscriptions,
|
|
||||||
[],
|
|
||||||
{
|
|
||||||
#slug: slug,
|
#slug: slug,
|
||||||
#query: query,
|
#query: query,
|
||||||
},
|
}),
|
||||||
),
|
returnValue: _i5.Future<_i3.SubPaginationModel>.value(
|
||||||
)),
|
_FakeSubPaginationModel_2(
|
||||||
returnValueForMissingStub:
|
this,
|
||||||
_i5.Future<_i3.SubPaginationModel>.value(_FakeSubPaginationModel_2(
|
Invocation.method(#getSubscriptions, [], {
|
||||||
this,
|
#slug: slug,
|
||||||
Invocation.method(
|
#query: query,
|
||||||
#getSubscriptions,
|
}),
|
||||||
[],
|
),
|
||||||
{
|
),
|
||||||
#slug: slug,
|
returnValueForMissingStub: _i5.Future<_i3.SubPaginationModel>.value(
|
||||||
#query: query,
|
_FakeSubPaginationModel_2(
|
||||||
},
|
this,
|
||||||
),
|
Invocation.method(#getSubscriptions, [], {
|
||||||
)),
|
#slug: slug,
|
||||||
) as _i5.Future<_i3.SubPaginationModel>);
|
#query: query,
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
as _i5.Future<_i3.SubPaginationModel>);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_i5.Future<void> subscribe({required String? slug}) => (super.noSuchMethod(
|
_i5.Future<void> subscribe({required String? slug}) =>
|
||||||
Invocation.method(
|
(super.noSuchMethod(
|
||||||
#subscribe,
|
Invocation.method(#subscribe, [], {#slug: slug}),
|
||||||
[],
|
returnValue: _i5.Future<void>.value(),
|
||||||
{#slug: slug},
|
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||||
),
|
)
|
||||||
returnValue: _i5.Future<void>.value(),
|
as _i5.Future<void>);
|
||||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
|
||||||
) as _i5.Future<void>);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_i5.Future<void> unsubscribe({required String? slug}) => (super.noSuchMethod(
|
_i5.Future<void> unsubscribe({required String? slug}) =>
|
||||||
Invocation.method(
|
(super.noSuchMethod(
|
||||||
#unsubscribe,
|
Invocation.method(#unsubscribe, [], {#slug: slug}),
|
||||||
[],
|
returnValue: _i5.Future<void>.value(),
|
||||||
{#slug: slug},
|
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||||
),
|
)
|
||||||
returnValue: _i5.Future<void>.value(),
|
as _i5.Future<void>);
|
||||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
|
||||||
) as _i5.Future<void>);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_i5.Future<void> uploadPhoto({required _i9.File? photo}) =>
|
_i5.Future<void> uploadPhoto({required _i9.File? photo}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(#uploadPhoto, [], {#photo: photo}),
|
||||||
#uploadPhoto,
|
returnValue: _i5.Future<void>.value(),
|
||||||
[],
|
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||||
{#photo: photo},
|
)
|
||||||
),
|
as _i5.Future<void>);
|
||||||
returnValue: _i5.Future<void>.value(),
|
|
||||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
|
||||||
) as _i5.Future<void>);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_i5.Future<void> deletePhoto() => (super.noSuchMethod(
|
_i5.Future<void> deletePhoto() =>
|
||||||
Invocation.method(
|
(super.noSuchMethod(
|
||||||
#deletePhoto,
|
Invocation.method(#deletePhoto, []),
|
||||||
[],
|
returnValue: _i5.Future<void>.value(),
|
||||||
),
|
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||||
returnValue: _i5.Future<void>.value(),
|
)
|
||||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
as _i5.Future<void>);
|
||||||
) as _i5.Future<void>);
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user