fix: analyzer

This commit is contained in:
mso7nueh
2025-05-23 12:03:04 +03:00
parent 8dcfa6ee6a
commit b59190e4e8
14 changed files with 58 additions and 63 deletions

View File

@@ -1,4 +1,5 @@
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/theme/custom_text_style.dart';
import 'package:eatvio_app/core/theme/theme_helper.dart';
@@ -149,11 +150,11 @@ class _MyDietWidgetState extends State<MyDietWidget> {
CustomOutlinedButton(
onPressed: () async {
final box = context.findRenderObject() as RenderBox?;
await Share.shareUri(
Uri.parse(
'$baseUrl/ru/diet/${widget.diet.id}',
await SharePlus.instance.share(
ShareParams(
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,
@@ -196,7 +197,7 @@ class _MyDietWidgetState extends State<MyDietWidget> {
}
} else {
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) {