forked from eatvio/eatvio_app
diet creation page
This commit is contained in:
@@ -140,7 +140,7 @@ class _FeedScreenState extends State<FeedScreen> {
|
||||
children: [
|
||||
_searchBar(),
|
||||
SizedBox(width: 12),
|
||||
_addBlogPostButton(),
|
||||
_addItemButton(),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -469,9 +469,17 @@ class _FeedScreenState extends State<FeedScreen> {
|
||||
);
|
||||
}
|
||||
|
||||
_addBlogPostButton() {
|
||||
_addItemButton() {
|
||||
return InkWell(
|
||||
onTap: () => GoRouter.of(context).pushNamed('blogPostCreateScreen'),
|
||||
onTap: () {
|
||||
switch (_selectedChipIndex) {
|
||||
case 1:
|
||||
GoRouter.of(context).pushNamed('recipeCreateScreen');
|
||||
break;
|
||||
default:
|
||||
GoRouter.of(context).pushNamed('blogPostCreateScreen');
|
||||
}
|
||||
},
|
||||
borderRadius: BorderRadius.circular(64),
|
||||
child: Ink(
|
||||
decoration: BoxDecoration(
|
||||
@@ -568,5 +576,4 @@ class _FeedScreenState extends State<FeedScreen> {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import 'package:eatvio_app/generated/l10n.dart';
|
||||
import 'package:eatvio_app/theme/custom_text_style.dart';
|
||||
import 'package:eatvio_app/theme/theme_helper.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
|
||||
class SortingDropDownFilter extends StatefulWidget {
|
||||
const SortingDropDownFilter({super.key});
|
||||
@@ -29,6 +31,11 @@ class _SortingDropDownFilterState extends State<SortingDropDownFilter> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return DropdownButtonFormField(
|
||||
icon: SvgPicture.asset(
|
||||
'assets/icons/arrow_down2.svg',
|
||||
width: 12,
|
||||
height: 8,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
dropdownColor: appTheme.lightGray0,
|
||||
decoration: InputDecoration(
|
||||
@@ -43,12 +50,21 @@ class _SortingDropDownFilterState extends State<SortingDropDownFilter> {
|
||||
items: sortingTypes
|
||||
.mapIndexed(
|
||||
(index, value) => DropdownMenuItem(
|
||||
child: Text(sortingTypes[index]),
|
||||
child: Text(
|
||||
sortingTypes[index],
|
||||
style: TextStyles.textMMedium.copyWith(color: appTheme.black),
|
||||
),
|
||||
value: sortingTypes[index],
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
onChanged: (value) {},
|
||||
onChanged: (value) {
|
||||
if (value != null) {
|
||||
setState(() {
|
||||
selectedIndex = sortingTypes.indexOf(value);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user