forked from eatvio/eatvio_app
go router
This commit is contained in:
@@ -11,12 +11,12 @@ import 'package:eatvio_app/widgets/custom_outlined_button.dart';
|
||||
|
||||
class RecipeCreateScreen extends StatelessWidget {
|
||||
const RecipeCreateScreen({Key? key}) : super(key: key);
|
||||
|
||||
static Widget builder(BuildContext context) {
|
||||
final recipeID = ModalRoute.of(context)!.settings.arguments;
|
||||
return BlocProvider<RecipeCreateBloc>(
|
||||
create: (context) => RecipeCreateBloc(RecipeCreateState(
|
||||
recipeModelObj: RecipeCreateModel(recipeID: recipeID.toString())))
|
||||
..add(RecipeCreateInitialEvent()),
|
||||
create: (context) =>
|
||||
RecipeCreateBloc(RecipeCreateState(recipeModelObj: RecipeCreateModel(recipeID: recipeID.toString())))..add(RecipeCreateInitialEvent()),
|
||||
child: RecipeCreateScreen());
|
||||
}
|
||||
|
||||
@@ -52,25 +52,28 @@ class RecipeCreateScreen extends StatelessWidget {
|
||||
}
|
||||
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
body: Container(
|
||||
width: double.maxFinite,
|
||||
decoration: BoxDecoration(color: Colors.grey[200]),
|
||||
child: ListView(children: [
|
||||
_buldAppBar(context),
|
||||
SizedBox(height: 20.v),
|
||||
_buildRecipeInfo(state, context),
|
||||
SizedBox(height: 20.v),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: steps,
|
||||
),
|
||||
SizedBox(height: 20.v),
|
||||
_buildAdditional(context, state)
|
||||
]),
|
||||
),
|
||||
bottomNavigationBar: _buildBottomBar(context)));
|
||||
child: Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
body: Container(
|
||||
width: double.maxFinite,
|
||||
decoration: BoxDecoration(color: Colors.grey[200]),
|
||||
child: ListView(
|
||||
children: [
|
||||
_buldAppBar(context),
|
||||
SizedBox(height: 20.v),
|
||||
_buildRecipeInfo(state, context),
|
||||
SizedBox(height: 20.v),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: steps,
|
||||
),
|
||||
SizedBox(height: 20.v),
|
||||
_buildAdditional(context, state)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
_buldAppBar(BuildContext context) {
|
||||
@@ -337,9 +340,7 @@ _buildAdditional(BuildContext context, RecipeCreateLoadedState state) {
|
||||
),
|
||||
),
|
||||
SizedBox(height: 8.0),
|
||||
Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text("Ссылка на видео (необязательно)")),
|
||||
Align(alignment: Alignment.centerLeft, child: Text("Ссылка на видео (необязательно)")),
|
||||
CustomTextFormField(
|
||||
controller: state.description,
|
||||
hintText: "YouTube",
|
||||
@@ -361,10 +362,6 @@ _buildAdditional(BuildContext context, RecipeCreateLoadedState state) {
|
||||
);
|
||||
}
|
||||
|
||||
_buildBottomBar(BuildContext context) {
|
||||
return CustomBottomBar(onChanged: (BottomBarEnum type) {});
|
||||
}
|
||||
|
||||
Function onTapBack(BuildContext context) {
|
||||
return () {
|
||||
onTapArrowLeft(context);
|
||||
|
||||
Reference in New Issue
Block a user