forked from eatvio/eatvio_app
feat(feed): #338
This commit is contained in:
@@ -2,13 +2,13 @@ import 'package:cached_network_image/cached_network_image.dart';
|
|||||||
import 'package:dismissible_page/dismissible_page.dart';
|
import 'package:dismissible_page/dismissible_page.dart';
|
||||||
import 'package:eatvio_app/core/const.dart';
|
import 'package:eatvio_app/core/const.dart';
|
||||||
import 'package:eatvio_app/core/enums/complained_content.dart';
|
import 'package:eatvio_app/core/enums/complained_content.dart';
|
||||||
|
import 'package:eatvio_app/core/theme/theme_helper.dart';
|
||||||
import 'package:eatvio_app/core/utils/date_time_utils.dart';
|
import 'package:eatvio_app/core/utils/date_time_utils.dart';
|
||||||
import 'package:eatvio_app/core/widgets/feed_icon_button.dart';
|
import 'package:eatvio_app/core/widgets/feed_icon_button.dart';
|
||||||
import 'package:eatvio_app/features/chat/presentation/pages/photo_view_screen.dart';
|
import 'package:eatvio_app/features/chat/presentation/pages/photo_view_screen.dart';
|
||||||
import 'package:eatvio_app/features/diets/presentation/widgets/more_options.dart';
|
import 'package:eatvio_app/features/diets/presentation/widgets/more_options.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/presentation/bloc/feed_cubit/feed_cubit.dart';
|
import 'package:eatvio_app/features/feed/presentation/bloc/feed_cubit/feed_cubit.dart';
|
||||||
import 'package:eatvio_app/core/theme/theme_helper.dart';
|
|
||||||
import 'package:eatvio_app/features/feed/presentation/bloc/feed_cubit/feed_state.dart';
|
import 'package:eatvio_app/features/feed/presentation/bloc/feed_cubit/feed_state.dart';
|
||||||
import 'package:eatvio_app/features/feed/presentation/widgets/subscribe_button_widget.dart';
|
import 'package:eatvio_app/features/feed/presentation/widgets/subscribe_button_widget.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@@ -179,14 +179,15 @@ class _BlogPostWidgetState extends State<BlogPostWidget> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (state.feedBlogPostList[widget.index].description.length > 200)
|
if (state.feedBlogPostList[widget.index].description.length > 200)
|
||||||
Padding(
|
const Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
padding: EdgeInsets.symmetric(horizontal: 12),
|
||||||
child: Text(
|
child: Text(
|
||||||
'Читать полностью...',
|
'Показать ещё',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
height: 1,
|
height: 1,
|
||||||
color: appTheme.blueA400,
|
color: Color(0xFF8B8B8B),
|
||||||
decoration: TextDecoration.underline,
|
fontSize: 14,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -188,14 +188,15 @@ class _RecipesWidgetState extends State<RecipesWidget> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (widget.recipe.description.length > 200)
|
if (widget.recipe.description.length > 200)
|
||||||
Padding(
|
const Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
padding: EdgeInsets.symmetric(horizontal: 12),
|
||||||
child: Text(
|
child: Text(
|
||||||
'Читать полностью...',
|
'Показать ещё',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
height: 1,
|
height: 1,
|
||||||
color: appTheme.blueA400,
|
color: Color(0xFF8B8B8B),
|
||||||
decoration: TextDecoration.underline,
|
fontSize: 14,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -194,87 +194,89 @@ class _CircumferenceChartWidgetState extends State<CircumferenceChartWidget> {
|
|||||||
useRootNavigator: true,
|
useRootNavigator: true,
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return Column(
|
return SafeArea(
|
||||||
children: [
|
child: Column(
|
||||||
Expanded(
|
children: [
|
||||||
child: Row(
|
Expanded(
|
||||||
children: [
|
child: Row(
|
||||||
Expanded(
|
children: [
|
||||||
child: CupertinoPicker(
|
Expanded(
|
||||||
magnification: 1.22,
|
child: CupertinoPicker(
|
||||||
squeeze: 1.2,
|
magnification: 1.22,
|
||||||
useMagnifier: true,
|
squeeze: 1.2,
|
||||||
scrollController: chestController,
|
useMagnifier: true,
|
||||||
itemExtent: 24,
|
scrollController: chestController,
|
||||||
onSelectedItemChanged: (int value) {
|
itemExtent: 24,
|
||||||
chest = value;
|
onSelectedItemChanged: (int value) {
|
||||||
},
|
chest = value;
|
||||||
children: [
|
},
|
||||||
for (int i = 20; i < 200; i++) Text('$i'),
|
children: [
|
||||||
],
|
for (int i = 20; i < 200; i++) Text('$i'),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
Expanded(
|
||||||
Expanded(
|
child: CupertinoPicker(
|
||||||
child: CupertinoPicker(
|
magnification: 1.22,
|
||||||
magnification: 1.22,
|
squeeze: 1.2,
|
||||||
squeeze: 1.2,
|
useMagnifier: true,
|
||||||
useMagnifier: true,
|
scrollController: waistController,
|
||||||
scrollController: waistController,
|
itemExtent: 24,
|
||||||
itemExtent: 24,
|
onSelectedItemChanged: (int value) {
|
||||||
onSelectedItemChanged: (int value) {
|
waist = value;
|
||||||
waist = value;
|
},
|
||||||
},
|
children: [
|
||||||
children: [
|
for (int i = 20; i < 200; i++) Text('$i'),
|
||||||
for (int i = 20; i < 200; i++) Text('$i'),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
Expanded(
|
||||||
Expanded(
|
child: CupertinoPicker(
|
||||||
child: CupertinoPicker(
|
magnification: 1.22,
|
||||||
magnification: 1.22,
|
squeeze: 1.2,
|
||||||
squeeze: 1.2,
|
useMagnifier: true,
|
||||||
useMagnifier: true,
|
scrollController: hipController,
|
||||||
scrollController: hipController,
|
itemExtent: 24,
|
||||||
itemExtent: 24,
|
onSelectedItemChanged: (int value) {
|
||||||
onSelectedItemChanged: (int value) {
|
hip = value;
|
||||||
hip = value;
|
},
|
||||||
},
|
children: [
|
||||||
children: [
|
for (int i = 20; i < 200; i++) Text('$i'),
|
||||||
for (int i = 20; i < 200; i++) Text('$i'),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
InkWell(
|
|
||||||
onTap: () {
|
|
||||||
widget.profileCubit?.addCircumference(
|
|
||||||
chestCircumference: chest + 20,
|
|
||||||
waistCircumference: waist + 20,
|
|
||||||
hipCircumference: hip + 20,
|
|
||||||
);
|
|
||||||
Navigator.of(context).pop();
|
|
||||||
},
|
|
||||||
borderRadius: BorderRadius.circular(16),
|
|
||||||
child: Ink(
|
|
||||||
width: MediaQuery.of(context).size.width - 32,
|
|
||||||
padding: const EdgeInsets.all(16),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: appTheme.blueA400,
|
|
||||||
borderRadius: BorderRadius.circular(16),
|
|
||||||
),
|
),
|
||||||
child: const Center(
|
),
|
||||||
child: Text(
|
InkWell(
|
||||||
'Сохранить',
|
onTap: () {
|
||||||
style: TextStyle(
|
widget.profileCubit?.addCircumference(
|
||||||
color: Colors.white,
|
chestCircumference: chest + 20,
|
||||||
|
waistCircumference: waist + 20,
|
||||||
|
hipCircumference: hip + 20,
|
||||||
|
);
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
borderRadius: BorderRadius.circular(16),
|
||||||
|
child: Ink(
|
||||||
|
width: MediaQuery.of(context).size.width - 32,
|
||||||
|
padding: const EdgeInsets.all(16),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: appTheme.blueA400,
|
||||||
|
borderRadius: BorderRadius.circular(16),
|
||||||
|
),
|
||||||
|
child: const Center(
|
||||||
|
child: Text(
|
||||||
|
'Сохранить',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -128,14 +128,15 @@ class _ProfileBlogPostWidgetState extends State<ProfileBlogPostWidget> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (state.blogPosts[widget.index].description.length > 200)
|
if (state.blogPosts[widget.index].description.length > 200)
|
||||||
Padding(
|
const Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
padding: EdgeInsets.symmetric(horizontal: 12),
|
||||||
child: Text(
|
child: Text(
|
||||||
'Читать полностью...',
|
'Показать ещё',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
height: 1,
|
height: 1,
|
||||||
color: appTheme.blueA400,
|
color: Color(0xFF8B8B8B),
|
||||||
decoration: TextDecoration.underline,
|
fontSize: 14,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -135,68 +135,70 @@ class _WeightChartWidgetState extends State<WeightChartWidget> {
|
|||||||
useRootNavigator: true,
|
useRootNavigator: true,
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return Column(
|
return SafeArea(
|
||||||
children: [
|
child: Column(
|
||||||
Expanded(
|
children: [
|
||||||
child: Row(
|
Expanded(
|
||||||
children: [
|
child: Row(
|
||||||
Expanded(
|
children: [
|
||||||
child: CupertinoPicker(
|
Expanded(
|
||||||
magnification: 1.22,
|
child: CupertinoPicker(
|
||||||
squeeze: 1.2,
|
magnification: 1.22,
|
||||||
useMagnifier: true,
|
squeeze: 1.2,
|
||||||
scrollController: weightKiloController,
|
useMagnifier: true,
|
||||||
itemExtent: 24,
|
scrollController: weightKiloController,
|
||||||
onSelectedItemChanged: (int value) {
|
itemExtent: 24,
|
||||||
weightKilo = value + 20;
|
onSelectedItemChanged: (int value) {
|
||||||
},
|
weightKilo = value + 20;
|
||||||
children: [
|
},
|
||||||
for (int i = 20; i < 300; i++) Text('$i'),
|
children: [
|
||||||
],
|
for (int i = 20; i < 300; i++) Text('$i'),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
Expanded(
|
||||||
Expanded(
|
child: CupertinoPicker(
|
||||||
child: CupertinoPicker(
|
magnification: 1.22,
|
||||||
magnification: 1.22,
|
squeeze: 1.2,
|
||||||
squeeze: 1.2,
|
useMagnifier: true,
|
||||||
useMagnifier: true,
|
scrollController: weightGramsController,
|
||||||
scrollController: weightGramsController,
|
itemExtent: 24,
|
||||||
itemExtent: 24,
|
onSelectedItemChanged: (int value) {
|
||||||
onSelectedItemChanged: (int value) {
|
weightGrams = value;
|
||||||
weightGrams = value;
|
},
|
||||||
},
|
children: [
|
||||||
children: [
|
for (int i = 0; i < 10; i++) Text('$i'),
|
||||||
for (int i = 0; i < 10; i++) Text('$i'),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
InkWell(
|
|
||||||
onTap: () {
|
|
||||||
widget.profileCubit?.addWeight(weight: double.parse('$weightKilo.$weightGrams'));
|
|
||||||
Navigator.of(context).pop();
|
|
||||||
},
|
|
||||||
borderRadius: BorderRadius.circular(16),
|
|
||||||
child: Ink(
|
|
||||||
width: MediaQuery.of(context).size.width - 32,
|
|
||||||
padding: const EdgeInsets.all(16),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: appTheme.blueA400,
|
|
||||||
borderRadius: BorderRadius.circular(16),
|
|
||||||
),
|
),
|
||||||
child: const Center(
|
),
|
||||||
child: Text(
|
InkWell(
|
||||||
'Сохранить',
|
onTap: () {
|
||||||
style: TextStyle(
|
widget.profileCubit?.addWeight(weight: double.parse('$weightKilo.$weightGrams'));
|
||||||
color: Colors.white,
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
borderRadius: BorderRadius.circular(16),
|
||||||
|
child: Ink(
|
||||||
|
width: MediaQuery.of(context).size.width - 32,
|
||||||
|
padding: const EdgeInsets.all(16),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: appTheme.blueA400,
|
||||||
|
borderRadius: BorderRadius.circular(16),
|
||||||
|
),
|
||||||
|
child: const Center(
|
||||||
|
child: Text(
|
||||||
|
'Сохранить',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -46,24 +46,26 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
|||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: const Text('Настройки'),
|
title: const Text('Настройки'),
|
||||||
),
|
),
|
||||||
body: SingleChildScrollView(
|
body: SafeArea(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
child: SingleChildScrollView(
|
||||||
physics: const BouncingScrollPhysics(),
|
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||||
child: Column(
|
physics: const BouncingScrollPhysics(),
|
||||||
children: [
|
child: Column(
|
||||||
_additionalInfo(state),
|
children: [
|
||||||
const SizedBox(height: 12),
|
_additionalInfo(state),
|
||||||
_notifications(state),
|
const SizedBox(height: 12),
|
||||||
const SizedBox(height: 12),
|
_notifications(state),
|
||||||
_aboutEatvio(state),
|
const SizedBox(height: 12),
|
||||||
const SizedBox(height: 12),
|
_aboutEatvio(state),
|
||||||
if (!state.profile.roles.contains('consultant'))
|
const SizedBox(height: 12),
|
||||||
Padding(
|
if (!state.profile.roles.contains('consultant'))
|
||||||
padding: const EdgeInsets.only(bottom: 8),
|
Padding(
|
||||||
child: _becomeConsultantButton(state),
|
padding: const EdgeInsets.only(bottom: 8),
|
||||||
),
|
child: _becomeConsultantButton(state),
|
||||||
_deleteAccountButton(state),
|
),
|
||||||
],
|
_deleteAccountButton(state),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user