forked from eatvio/eatvio_app
feat(recipe): Multiple FloatingActionButtons fixed
This commit is contained in:
@@ -232,22 +232,26 @@ class RecipeCreateScreen extends StatelessWidget {
|
||||
Container(
|
||||
height: 48,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
child: FloatingActionButton.extended(
|
||||
highlightElevation: 0,
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
elevation: 0,
|
||||
focusElevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
backgroundColor: appTheme.blueA400,
|
||||
label: Text(
|
||||
'+',
|
||||
style: theme.textTheme.titleSmall,
|
||||
),
|
||||
onPressed: () => context.read<RecipeCreateCubit>().addIngredient(new Ingredient(
|
||||
name: state.productNameController.text,
|
||||
portion: state.ingredientController.text,
|
||||
unit: state.ingredientAsItems ? 'pcs' : 'gr'))),
|
||||
),
|
||||
onPressed: () => context.read<RecipeCreateCubit>().addIngredient(
|
||||
Ingredient(
|
||||
name: state.productNameController.text,
|
||||
portion: state.ingredientController.text,
|
||||
unit: state.ingredientAsItems ? 'pcs' : 'gr',
|
||||
),
|
||||
),
|
||||
child: Text(
|
||||
'+',
|
||||
style: theme.textTheme.titleSmall,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 24),
|
||||
Text('Описание рецепта'),
|
||||
@@ -263,16 +267,16 @@ class RecipeCreateScreen extends StatelessWidget {
|
||||
Container(
|
||||
height: 48,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
child: FloatingActionButton.extended(
|
||||
highlightElevation: 0,
|
||||
elevation: 0,
|
||||
focusElevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
elevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
backgroundColor: appTheme.blueA400,
|
||||
),
|
||||
backgroundColor: appTheme.blueA400,
|
||||
onPressed: () => context.read<RecipeCreateCubit>().addStep(),
|
||||
label: Text(
|
||||
child: Text(
|
||||
'+',
|
||||
style: theme.textTheme.titleSmall,
|
||||
),
|
||||
@@ -282,16 +286,16 @@ class RecipeCreateScreen extends StatelessWidget {
|
||||
Container(
|
||||
height: 48,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
child: FloatingActionButton.extended(
|
||||
highlightElevation: 0,
|
||||
elevation: 0,
|
||||
focusElevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
elevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
backgroundColor: Colors.grey,
|
||||
),
|
||||
backgroundColor: Colors.grey,
|
||||
onPressed: () => context.read<RecipeCreateCubit>().removeStep(),
|
||||
label: Text(
|
||||
child: Text(
|
||||
'-',
|
||||
style: theme.textTheme.titleSmall,
|
||||
),
|
||||
@@ -309,19 +313,19 @@ class RecipeCreateScreen extends StatelessWidget {
|
||||
Container(
|
||||
height: 48,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
child: FloatingActionButton.extended(
|
||||
highlightElevation: 0,
|
||||
elevation: 0,
|
||||
focusElevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
elevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
backgroundColor: appTheme.blueA400,
|
||||
),
|
||||
backgroundColor: appTheme.blueA400,
|
||||
onPressed: () => context.read<RecipeCreateCubit>().publishRecipe(createRecipeFromState(state)),
|
||||
label: Text(
|
||||
child: Text(
|
||||
'Опубликовать',
|
||||
style: theme.textTheme.titleSmall,
|
||||
),
|
||||
onPressed: () => context.read<RecipeCreateCubit>().publishRecipe(createRecipeFromState(state)),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -240,15 +240,15 @@ class RecipeEditScreen extends StatelessWidget {
|
||||
Container(
|
||||
height: 48,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
child: FloatingActionButton.extended(
|
||||
highlightElevation: 0,
|
||||
elevation: 0,
|
||||
focusElevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
elevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
backgroundColor: appTheme.blueA400,
|
||||
),
|
||||
backgroundColor: appTheme.blueA400,
|
||||
label: Text(
|
||||
child: Text(
|
||||
'+',
|
||||
style: theme.textTheme.titleSmall,
|
||||
),
|
||||
@@ -271,38 +271,38 @@ class RecipeEditScreen extends StatelessWidget {
|
||||
Container(
|
||||
height: 48,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
child: FloatingActionButton.extended(
|
||||
highlightElevation: 0,
|
||||
elevation: 0,
|
||||
focusElevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
elevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
backgroundColor: appTheme.blueA400,
|
||||
),
|
||||
backgroundColor: appTheme.blueA400,
|
||||
onPressed: () => context.read<RecipeCreateCubit>().addStep(),
|
||||
label: Text(
|
||||
child: Text(
|
||||
'+',
|
||||
style: theme.textTheme.titleSmall,
|
||||
),
|
||||
onPressed: () => context.read<RecipeCreateCubit>().addStep(),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
Container(
|
||||
height: 48,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
child: FloatingActionButton.extended(
|
||||
highlightElevation: 0,
|
||||
elevation: 0,
|
||||
focusElevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
elevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
backgroundColor: appTheme.blueA400,
|
||||
),
|
||||
backgroundColor: Colors.grey,
|
||||
onPressed: () => context.read<RecipeCreateCubit>().removeStep(),
|
||||
label: Text(
|
||||
child: Text(
|
||||
'-',
|
||||
style: theme.textTheme.titleSmall,
|
||||
),
|
||||
onPressed: () => context.read<RecipeCreateCubit>().removeStep(),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 24),
|
||||
@@ -317,19 +317,19 @@ class RecipeEditScreen extends StatelessWidget {
|
||||
Container(
|
||||
height: 48,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
child: FloatingActionButton.extended(
|
||||
highlightElevation: 0,
|
||||
elevation: 0,
|
||||
focusElevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
elevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
backgroundColor: appTheme.blueA400,
|
||||
),
|
||||
backgroundColor: appTheme.blueA400,
|
||||
onPressed: () => context.read<RecipeCreateCubit>().editRecipe(createRecipeFromState(state), recipeID),
|
||||
label: Text(
|
||||
child: Text(
|
||||
'Опубликовать',
|
||||
style: theme.textTheme.titleSmall,
|
||||
),
|
||||
onPressed: () => context.read<RecipeCreateCubit>().editRecipe(createRecipeFromState(state), recipeID),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user