forked from eatvio/eatvio_app
feat(feed): fixed comments state updating in feed, feat(consultantRegistration): fixed registration flow for users with unverified phone, feat(tests): fixed tests coverage
This commit is contained in:
@@ -33,7 +33,7 @@ import '../widgets/recipes.dart';
|
||||
|
||||
class FeedScreen extends StatelessWidget {
|
||||
const FeedScreen({super.key, this.initialTabIndex = 0});
|
||||
final int initialTabIndex;
|
||||
final int? initialTabIndex;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MultiBlocProvider(
|
||||
@@ -51,7 +51,7 @@ class FeedScreen extends StatelessWidget {
|
||||
|
||||
class FeedScreenContent extends StatefulWidget {
|
||||
const FeedScreenContent({super.key, required this.initialTabIndex});
|
||||
final int initialTabIndex;
|
||||
final int? initialTabIndex;
|
||||
@override
|
||||
State<FeedScreenContent> createState() => _FeedScreenContentState();
|
||||
}
|
||||
@@ -72,7 +72,7 @@ class _FeedScreenContentState extends State<FeedScreenContent> {
|
||||
final consultantsScrollController = ScrollController();
|
||||
@override
|
||||
void initState() {
|
||||
_selectedChipIndex = widget.initialTabIndex;
|
||||
_selectedChipIndex = widget.initialTabIndex ?? 0;
|
||||
chipsLabelList = hidePlans ? ['Все', 'Консультанты', 'Рецепты', 'Диеты'] : ['Все', 'Планы питания', 'Консультанты', 'Рецепты', 'Диеты'];
|
||||
consultantsScrollController.addListener(_onScrollConsultants);
|
||||
_checkRegistrationDate(context);
|
||||
@@ -92,8 +92,11 @@ class _FeedScreenContentState extends State<FeedScreenContent> {
|
||||
@override
|
||||
void didUpdateWidget(FeedScreenContent oldWidget) {
|
||||
super.didUpdateWidget(oldWidget);
|
||||
final initialTabIndex = widget.initialTabIndex;
|
||||
setState(() {
|
||||
_selectedChipIndex = widget.initialTabIndex;
|
||||
if (initialTabIndex != null) {
|
||||
_selectedChipIndex = initialTabIndex;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user