forked from eatvio/eatvio_app
fix: analyzer
This commit is contained in:
@@ -44,7 +44,6 @@ import 'package:eatvio_app/features/recipe/presentation/about_recipe_screen.dart
|
|||||||
import 'package:eatvio_app/features/create_recipe/presentation/pages/recipe_create_screen.dart';
|
import 'package:eatvio_app/features/create_recipe/presentation/pages/recipe_create_screen.dart';
|
||||||
import 'package:eatvio_app/features/registration/presentation/pages/registration_screen.dart';
|
import 'package:eatvio_app/features/registration/presentation/pages/registration_screen.dart';
|
||||||
import 'package:eatvio_app/features/registration/presentation/pages/verify_screen.dart';
|
import 'package:eatvio_app/features/registration/presentation/pages/verify_screen.dart';
|
||||||
import 'package:eatvio_app/features/registration/presentation/pages/webview_registration_screen.dart';
|
|
||||||
import 'package:eatvio_app/features/settings/entities/settings_entity.dart';
|
import 'package:eatvio_app/features/settings/entities/settings_entity.dart';
|
||||||
import 'package:eatvio_app/features/settings/presentation/pages/change_email_screen.dart';
|
import 'package:eatvio_app/features/settings/presentation/pages/change_email_screen.dart';
|
||||||
import 'package:eatvio_app/features/settings/presentation/pages/change_password_screen.dart';
|
import 'package:eatvio_app/features/settings/presentation/pages/change_password_screen.dart';
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
String baseUrl = 'https://apoloz-nauch-vei9nieng5er.eatv.io';
|
String baseUrl = 'https://eatvio.ru';
|
||||||
// String baseUrl = 'https://eatvio.ru';
|
|
||||||
// String baseUrl = 'https://dev2.eatvio.com';
|
// String baseUrl = 'https://dev2.eatvio.com';
|
||||||
|
|
||||||
const List<int> durationValues = [7, 14, 21];
|
const List<int> durationValues = [7, 14, 21];
|
||||||
|
|||||||
@@ -91,11 +91,13 @@ class CustomPopup extends StatelessWidget {
|
|||||||
});
|
});
|
||||||
addItem('assets/icons/share2.svg', 'Поделиться', () {
|
addItem('assets/icons/share2.svg', 'Поделиться', () {
|
||||||
final box = context.findRenderObject() as RenderBox?;
|
final box = context.findRenderObject() as RenderBox?;
|
||||||
Share.shareUri(
|
SharePlus.instance.share(
|
||||||
Uri.parse(
|
ShareParams(
|
||||||
'$baseUrl/ru/$path',
|
uri: Uri.parse(
|
||||||
|
'$baseUrl/ru/$path',
|
||||||
|
),
|
||||||
|
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
|
||||||
),
|
),
|
||||||
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
addItem('assets/icons/edit_paint.svg', 'Редактировать', () async {
|
addItem('assets/icons/edit_paint.svg', 'Редактировать', () async {
|
||||||
@@ -104,7 +106,8 @@ class CustomPopup extends StatelessWidget {
|
|||||||
} else if (complainedContentType == ComplainedContent.recipe) {
|
} else if (complainedContentType == ComplainedContent.recipe) {
|
||||||
GoRouter.of(context).pushNamed(RecipeCreateScreen.name, extra: recipe);
|
GoRouter.of(context).pushNamed(RecipeCreateScreen.name, extra: recipe);
|
||||||
} else if (complainedContentType == ComplainedContent.diet) {
|
} else if (complainedContentType == ComplainedContent.diet) {
|
||||||
await showErrorDialog(context, title: 'Предупреждение', description: 'Диета будет перенесена в архив. Вы создаете новую диету на основе существующей.');
|
await showErrorDialog(context,
|
||||||
|
title: 'Предупреждение', description: 'Диета будет перенесена в архив. Вы создаете новую диету на основе существующей.');
|
||||||
await sl<MyDietsCubit>().unpublishDiet(id!);
|
await sl<MyDietsCubit>().unpublishDiet(id!);
|
||||||
GoRouter.of(context).pushNamed(CreateDietScreen.name, extra: diet);
|
GoRouter.of(context).pushNamed(CreateDietScreen.name, extra: diet);
|
||||||
} else {
|
} else {
|
||||||
@@ -169,11 +172,13 @@ class CustomPopup extends StatelessWidget {
|
|||||||
});
|
});
|
||||||
addItem('assets/icons/share2.svg', 'Поделиться', () {
|
addItem('assets/icons/share2.svg', 'Поделиться', () {
|
||||||
final box = context.findRenderObject() as RenderBox?;
|
final box = context.findRenderObject() as RenderBox?;
|
||||||
Share.shareUri(
|
SharePlus.instance.share(
|
||||||
Uri.parse(
|
ShareParams(
|
||||||
'$baseUrl/ru/$path',
|
uri: Uri.parse(
|
||||||
|
'$baseUrl/ru/$path',
|
||||||
|
),
|
||||||
|
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
|
||||||
),
|
),
|
||||||
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
addItem('assets/icons/complain.svg', 'Пожаловаться', () {
|
addItem('assets/icons/complain.svg', 'Пожаловаться', () {
|
||||||
|
|||||||
@@ -242,9 +242,11 @@ class _BlogPostScreenState extends State<BlogPostScreen> {
|
|||||||
icon: Icons.reply_rounded,
|
icon: Icons.reply_rounded,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
final box = context.findRenderObject() as RenderBox?;
|
final box = context.findRenderObject() as RenderBox?;
|
||||||
Share.shareUri(
|
SharePlus.instance.share(
|
||||||
Uri.parse('$baseUrl/ru/blog_post/${widget.blogPost.id}'),
|
ShareParams(
|
||||||
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
|
uri: Uri.parse('$baseUrl/ru/blog_post/${widget.blogPost.id}'),
|
||||||
|
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -60,11 +60,11 @@ class MoreOptions extends StatelessWidget {
|
|||||||
? null
|
? null
|
||||||
: () {
|
: () {
|
||||||
final box = context.findRenderObject() as RenderBox?;
|
final box = context.findRenderObject() as RenderBox?;
|
||||||
Share.shareUri(
|
SharePlus.instance.share(
|
||||||
Uri.parse(
|
ShareParams(
|
||||||
'$baseUrl/ru/$path',
|
uri: Uri.parse('$baseUrl/ru/$path',),
|
||||||
|
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
|
||||||
),
|
),
|
||||||
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
child: Row(
|
child: Row(
|
||||||
|
|||||||
@@ -243,11 +243,11 @@ class _BlogPostWidgetState extends State<BlogPostWidget> {
|
|||||||
),
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
final box = context.findRenderObject() as RenderBox?;
|
final box = context.findRenderObject() as RenderBox?;
|
||||||
Share.shareUri(
|
SharePlus.instance.share(
|
||||||
Uri.parse(
|
ShareParams(
|
||||||
'$baseUrl/ru/blog_post/${state.feedBlogPostList[widget.index].id}',
|
uri: Uri.parse('$baseUrl/ru/blog_post/${state.feedBlogPostList[widget.index].id}',),
|
||||||
|
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
|
||||||
),
|
),
|
||||||
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -186,11 +186,11 @@ class _DietsWidgetState extends State<DietsWidget> {
|
|||||||
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 box = context.findRenderObject() as RenderBox?;
|
||||||
final result = await Share.shareUri(
|
final result = await SharePlus.instance.share(
|
||||||
Uri.parse(
|
ShareParams(
|
||||||
'$baseUrl/ru/diet/${widget.diet.id}',
|
uri: Uri.parse('$baseUrl/ru/diet/${widget.diet.id}'),
|
||||||
|
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
|
||||||
),
|
),
|
||||||
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
|
|
||||||
);
|
);
|
||||||
switch (result.status) {
|
switch (result.status) {
|
||||||
case ShareResultStatus.success:
|
case ShareResultStatus.success:
|
||||||
|
|||||||
@@ -257,11 +257,11 @@ class _PlanWidgetState extends State<PlanWidget> {
|
|||||||
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 box = context.findRenderObject() as RenderBox?;
|
||||||
final result = await Share.shareUri(
|
final result = await SharePlus.instance.share(
|
||||||
Uri.parse(
|
ShareParams(
|
||||||
'$baseUrl/ru/diet/${widget.plan.id}',
|
uri: Uri.parse('$baseUrl/ru/diet/${widget.plan.id}'),
|
||||||
|
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
|
||||||
),
|
),
|
||||||
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
|
|
||||||
);
|
);
|
||||||
switch (result.status) {
|
switch (result.status) {
|
||||||
case ShareResultStatus.success:
|
case ShareResultStatus.success:
|
||||||
|
|||||||
@@ -226,11 +226,11 @@ class _RecipesWidgetState extends State<RecipesWidget> {
|
|||||||
),
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
final box = context.findRenderObject() as RenderBox?;
|
final box = context.findRenderObject() as RenderBox?;
|
||||||
Share.shareUri(
|
SharePlus.instance.share(
|
||||||
Uri.parse(
|
ShareParams(
|
||||||
'$baseUrl/ru/blog_post/${widget.recipe.id}',
|
uri: Uri.parse('$baseUrl/ru/blog_post/${widget.recipe.id}'),
|
||||||
|
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
|
||||||
),
|
),
|
||||||
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'package:cached_network_image/cached_network_image.dart';
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
|
import 'package:eatvio_app/core/app_router.dart';
|
||||||
import 'package:eatvio_app/core/const.dart';
|
import 'package:eatvio_app/core/const.dart';
|
||||||
import 'package:eatvio_app/core/theme/custom_text_style.dart';
|
import 'package:eatvio_app/core/theme/custom_text_style.dart';
|
||||||
import 'package:eatvio_app/core/theme/theme_helper.dart';
|
import 'package:eatvio_app/core/theme/theme_helper.dart';
|
||||||
@@ -149,11 +150,11 @@ class _MyDietWidgetState extends State<MyDietWidget> {
|
|||||||
CustomOutlinedButton(
|
CustomOutlinedButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
final box = context.findRenderObject() as RenderBox?;
|
final box = context.findRenderObject() as RenderBox?;
|
||||||
await Share.shareUri(
|
await SharePlus.instance.share(
|
||||||
Uri.parse(
|
ShareParams(
|
||||||
'$baseUrl/ru/diet/${widget.diet.id}',
|
uri: Uri.parse('$baseUrl/ru/diet/${widget.diet.id}'),
|
||||||
|
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
|
||||||
),
|
),
|
||||||
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
height: 52,
|
height: 52,
|
||||||
@@ -196,7 +197,7 @@ class _MyDietWidgetState extends State<MyDietWidget> {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
await showErrorDialog(context, title: 'Предупреждение', description: 'Вы можете создать новую диету на основе существующей.');
|
await showErrorDialog(context, title: 'Предупреждение', description: 'Вы можете создать новую диету на основе существующей.');
|
||||||
GoRouter.of(context).pushNamed(CreateDietScreen.name, extra: widget.diet);
|
AppRouter.navigatorKey.currentContext?.pushNamed(CreateDietScreen.name, extra: widget.diet);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
text: switch (state.selectedStateIndex) {
|
text: switch (state.selectedStateIndex) {
|
||||||
|
|||||||
@@ -138,11 +138,11 @@ class _MyPlanWidgetState extends State<MyPlanWidget> {
|
|||||||
CustomOutlinedButton(
|
CustomOutlinedButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
final box = context.findRenderObject() as RenderBox?;
|
final box = context.findRenderObject() as RenderBox?;
|
||||||
await Share.shareUri(
|
await SharePlus.instance.share(
|
||||||
Uri.parse(
|
ShareParams(
|
||||||
'$baseUrl/ru/plan/${widget.plan.id}',
|
uri: Uri.parse('$baseUrl/ru/plan/${widget.plan.id}'),
|
||||||
|
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
|
||||||
),
|
),
|
||||||
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
height: 52,
|
height: 52,
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ import 'package:eatvio_app/features/profile/presentation/widgets/profile_blog_po
|
|||||||
import 'package:eatvio_app/features/profile/presentation/widgets/weight_chart_widget.dart';
|
import 'package:eatvio_app/features/profile/presentation/widgets/weight_chart_widget.dart';
|
||||||
import 'package:eatvio_app/core/locator_service.dart';
|
import 'package:eatvio_app/core/locator_service.dart';
|
||||||
import 'package:eatvio_app/core/theme/theme_helper.dart';
|
import 'package:eatvio_app/core/theme/theme_helper.dart';
|
||||||
import 'package:eatvio_app/features/profile/repositories/profile_repository.dart';
|
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
@@ -223,15 +222,6 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
ElevatedButton(onPressed: () async {
|
|
||||||
await sl<ProfileRepository>().sendEmailCode();
|
|
||||||
}, child: Text('send email verify code')),
|
|
||||||
TextFormField(
|
|
||||||
controller: controller,
|
|
||||||
),
|
|
||||||
ElevatedButton(onPressed: () async {
|
|
||||||
await sl<ProfileRepository>().tryVerifyEmailByCode(controller.text);
|
|
||||||
}, child: Text('try verify email by code')),
|
|
||||||
_header(state),
|
_header(state),
|
||||||
if (state.profile.roles.contains('consultant'))
|
if (state.profile.roles.contains('consultant'))
|
||||||
Column(
|
Column(
|
||||||
@@ -1136,11 +1126,11 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
|||||||
onSelected: (value) {
|
onSelected: (value) {
|
||||||
if (value == 'share') {
|
if (value == 'share') {
|
||||||
final box = context.findRenderObject() as RenderBox?;
|
final box = context.findRenderObject() as RenderBox?;
|
||||||
Share.shareUri(
|
SharePlus.instance.share(
|
||||||
Uri.parse(
|
ShareParams(
|
||||||
'$baseUrl/ru/profile/${state.profile.slug}',
|
uri: Uri.parse('$baseUrl/ru/profile/${state.profile.slug}'),
|
||||||
|
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
|
||||||
),
|
),
|
||||||
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
|
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
showModalBottomSheet(
|
showModalBottomSheet(
|
||||||
|
|||||||
@@ -214,11 +214,11 @@ class _ProfileBlogPostWidgetState extends State<ProfileBlogPostWidget> {
|
|||||||
),
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
final box = context.findRenderObject() as RenderBox?;
|
final box = context.findRenderObject() as RenderBox?;
|
||||||
Share.shareUri(
|
SharePlus.instance.share(
|
||||||
Uri.parse(
|
ShareParams(
|
||||||
'$baseUrl/ru/blog_post/${state.blogPosts[widget.index].id}',
|
uri: Uri.parse('$baseUrl/ru/blog_post/${state.blogPosts[widget.index].id}'),
|
||||||
|
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
|
||||||
),
|
),
|
||||||
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ class _VerifyScreenState extends State<VerifyScreen> {
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
print('$baseUrl/login_with_pass_key?id=${widget.passKey}');
|
|
||||||
_controller = WebViewController()
|
_controller = WebViewController()
|
||||||
..setJavaScriptMode(JavaScriptMode.unrestricted)
|
..setJavaScriptMode(JavaScriptMode.unrestricted)
|
||||||
..loadRequest(Uri.parse('$baseUrl/login_with_pass_key?id=${widget.passKey}'));
|
..loadRequest(Uri.parse('$baseUrl/login_with_pass_key?id=${widget.passKey}'));
|
||||||
|
|||||||
Reference in New Issue
Block a user