forked from eatvio/eatvio_app
feat(plans) Plans create and edit API connect, TextController management and redirect
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -0,0 +1,21 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'plan_create_bloc.dart';
|
||||
|
||||
/// Abstract class for all events that can be dispatched from the
|
||||
///PlanCreate widget.
|
||||
///
|
||||
/// Events must be immutable and implement the [Equatable] interface.
|
||||
@immutable
|
||||
abstract class PlanCreateEvent extends Equatable {}
|
||||
|
||||
/// Event that is dispatched when the PlanCreate widget is first created.
|
||||
class PlanCreateInitialEvent extends PlanCreateEvent {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
|
||||
class CreatePlan extends PlanCreateEvent {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'plan_create_bloc.dart';
|
||||
|
||||
/// Represents the state of PlanCreate in the application.
|
||||
///
|
||||
|
||||
class PlanCreateState extends Equatable {
|
||||
PlanCreateState({
|
||||
this.planModelObj,
|
||||
});
|
||||
|
||||
PlanCreateModel? planModelObj;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [planModelObj];
|
||||
PlanCreateState copyWith({PlanCreateModel? planModelObj}) {
|
||||
return PlanCreateState(
|
||||
planModelObj: planModelObj ?? this.planModelObj,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class PlanCreateLoadedState extends PlanCreateState {
|
||||
PlanCreateLoadedState({
|
||||
this.planModelObj,
|
||||
this.name,
|
||||
this.details,
|
||||
});
|
||||
|
||||
PlanCreateModel? planModelObj;
|
||||
TextEditingController? name;
|
||||
TextEditingController? details;
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
planModelObj,
|
||||
name,
|
||||
details,
|
||||
];
|
||||
PlanCreateLoadedState copyWith({
|
||||
PlanCreateModel? planModelObj,
|
||||
TextEditingController? name,
|
||||
TextEditingController? details,
|
||||
}) {
|
||||
return PlanCreateLoadedState(
|
||||
planModelObj: planModelObj ?? this.planModelObj,
|
||||
name: name ?? this.name,
|
||||
details: details ?? this.details,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class PlanCreateErrorState extends PlanCreateState {
|
||||
final String errorMessage;
|
||||
|
||||
PlanCreateErrorState(this.errorMessage);
|
||||
|
||||
@override
|
||||
List<Object> get props => [errorMessage];
|
||||
}
|
||||
|
||||
class PlanCreateInitialState extends PlanCreateState {
|
||||
PlanCreateInitialState({required PlanCreateModel planModelObj})
|
||||
: super(planModelObj: planModelObj);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
/// This class defines the variables used in the [plan_create_screen],
|
||||
/// and is typically used to hold data that is passed between different parts of the application.
|
||||
|
||||
class PlanCreateModel extends Equatable {
|
||||
final String planID;
|
||||
|
||||
PlanCreateModel({required String planID}) : planID = planID;
|
||||
|
||||
PlanCreateModel copyWith(String planID) {
|
||||
return PlanCreateModel(planID: planID);
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [planID];
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
import 'bloc/plan_create_bloc.dart';
|
||||
import 'models/plan_create_model.dart';
|
||||
import 'package:eatvio_app/core/app_export.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:eatvio_app/widgets/custom_bottom_bar.dart';
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
|
||||
class PlanCreateScreen extends StatelessWidget {
|
||||
const PlanCreateScreen({Key? key}) : super(key: key);
|
||||
static Widget builder(BuildContext context) {
|
||||
final planID = ModalRoute.of(context)!.settings.arguments;
|
||||
return BlocProvider<PlanCreateBloc>(
|
||||
create: (context) => PlanCreateBloc(PlanCreateState(
|
||||
planModelObj: PlanCreateModel(planID: planID.toString())))
|
||||
..add(PlanCreateInitialEvent()),
|
||||
child: PlanCreateScreen());
|
||||
}
|
||||
|
||||
Widget build(BuildContext context) {
|
||||
return BlocBuilder<PlanCreateBloc, PlanCreateState>(
|
||||
builder: (context, state) {
|
||||
if (state is PlanCreateInitialState) {
|
||||
// Это начальное состояние, данные ещё не загружены.
|
||||
return Container(
|
||||
color: Colors.white,
|
||||
);
|
||||
} else if (state is PlanCreateLoadedState) {
|
||||
// Данные загружены, можно строить экран.
|
||||
return _buildPlanCreate(context, state);
|
||||
} else if (state is PlanCreateErrorState) {
|
||||
// Произошла ошибка при загрузке данных.
|
||||
return Center(child: Text(state.errorMessage));
|
||||
} else {
|
||||
// Другие состояния, если они есть.
|
||||
return Container(); // Пустой контейнер для необработанных состояний.
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
_buildPlanCreate(BuildContext context, PlanCreateLoadedState state) {
|
||||
mediaQueryData = MediaQuery.of(context);
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
body: Container(
|
||||
width: double.maxFinite,
|
||||
decoration: AppDecoration.fillGray,
|
||||
child: ListView(children: [
|
||||
SizedBox(height: 30.v),
|
||||
Container(
|
||||
margin: EdgeInsets.only(
|
||||
left: 16.h,
|
||||
right: 20.h,
|
||||
bottom: 10.h,
|
||||
),
|
||||
padding: EdgeInsets.all(12.h),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: const BorderRadius.all(Radius.circular(12)),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.grey.withOpacity(0.5),
|
||||
spreadRadius: 2,
|
||||
blurRadius: 5,
|
||||
offset: Offset(0, 3),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Column(mainAxisSize: MainAxisSize.min, children: [
|
||||
SizedBox(height: 16.0),
|
||||
TextFormField(
|
||||
controller: state.name,
|
||||
decoration: InputDecoration(labelText: 'Заголовок'),
|
||||
),
|
||||
SizedBox(height: 16.0),
|
||||
TextFormField(
|
||||
controller: state.details,
|
||||
decoration: InputDecoration(labelText: 'Описание'),
|
||||
),
|
||||
SizedBox(height: 16.0),
|
||||
// Здесь нужно добавить виджет для загрузки картинки
|
||||
ElevatedButton(
|
||||
onPressed: () =>
|
||||
context.read<PlanCreateBloc>().add(CreatePlan()),
|
||||
child: Text('Создать'),
|
||||
)
|
||||
]),
|
||||
)
|
||||
]),
|
||||
),
|
||||
bottomNavigationBar: _buildBottomBar(context)));
|
||||
}
|
||||
}
|
||||
|
||||
_buildBottomBar(BuildContext context) {
|
||||
return CustomBottomBar(onChanged: (BottomBarEnum type) {});
|
||||
}
|
||||
118
lib/presentation/plans/plan_edit_screen/bloc/plan_edit_bloc.dart
Normal file
118
lib/presentation/plans/plan_edit_screen/bloc/plan_edit_bloc.dart
Normal file
@@ -0,0 +1,118 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'dart:convert';
|
||||
import '/core/app_export.dart';
|
||||
import 'package:eatvio_app/presentation/plans/plan_edit_screen/models/plan_edit_model.dart';
|
||||
part 'plan_edit_event.dart';
|
||||
part 'plan_edit_state.dart';
|
||||
|
||||
/// A bloc that manages the state of a PlanEdit according to the event that is dispatched to it.
|
||||
class PlanEditBloc extends Bloc<PlanEditEvent, PlanEditState> {
|
||||
PlanEditBloc(PlanEditState initialState) : super(initialState) {
|
||||
on<PlanEditInitialEvent>(_onInitialize);
|
||||
on<EditPlan>(_editPlan);
|
||||
}
|
||||
|
||||
_onInitialize(
|
||||
PlanEditInitialEvent event,
|
||||
Emitter<PlanEditState> emit,
|
||||
) async {
|
||||
try {
|
||||
final box = await Hive.openBox('token');
|
||||
final token = box.get('token');
|
||||
if (token == null) {
|
||||
NavigatorService.popAndPushNamed(
|
||||
AppRoutes.authScreen,
|
||||
);
|
||||
}
|
||||
final String? planID = state.planModelObj?.planID;
|
||||
final response = await http.get(
|
||||
Uri.parse(dotenv.env['SERVER_ROOT']! + '/plans/show/$planID'),
|
||||
headers: {
|
||||
'Authorization': 'Bearer $token',
|
||||
},
|
||||
);
|
||||
if (response.statusCode == 200) {
|
||||
final data = jsonDecode(response.body);
|
||||
if (data is Map<String, dynamic>) {
|
||||
if (state is PlanEditLoadedState) {
|
||||
var currentState = state as PlanEditLoadedState;
|
||||
emit(currentState.copyWith(
|
||||
planModelObj: currentState.planModelObj,
|
||||
plan: currentState.plan,
|
||||
name: currentState.name,
|
||||
duration: currentState.duration,
|
||||
details: currentState.details));
|
||||
} else {
|
||||
emit(PlanEditLoadedState(
|
||||
plan: data,
|
||||
name: TextEditingController(text: data['name']),
|
||||
details: TextEditingController(text: data['details']),
|
||||
duration:
|
||||
TextEditingController(text: data['duration'].toString())));
|
||||
}
|
||||
} else {
|
||||
// Один или несколько ключевых полей отсутствуют, обрабатываем ошибку
|
||||
emit(PlanEditErrorState('Некоторые необходимые данные отсутствуют.'));
|
||||
}
|
||||
} else {
|
||||
// Статус ответа не равен 200, обрабатываем ошибку
|
||||
emit(PlanEditErrorState('Ошибка сервера: ${response.statusCode}'));
|
||||
}
|
||||
} catch (e) {
|
||||
// Ошибка при декодировании JSON или другая ошибка выполнения
|
||||
emit(PlanEditErrorState('Ошибка при получении данных о чатах: $e'));
|
||||
}
|
||||
}
|
||||
|
||||
FutureOr<void> _editPlan(EditPlan event, Emitter<PlanEditState> emit) async {
|
||||
if (state is PlanEditLoadedState) {
|
||||
var currentState = state as PlanEditLoadedState;
|
||||
int duration = int.parse(currentState.duration!.text) * 7;
|
||||
print(duration);
|
||||
var response = await sendPlan(currentState.plan, currentState.name?.text,
|
||||
currentState.details?.text, duration.toString());
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
NavigatorService.pushNamed(AppRoutes.planScreen,
|
||||
arguments: currentState.plan?['id'].toString());
|
||||
} else {
|
||||
print(
|
||||
'Failed to edit blog post. Status Code: ${response.statusCode} ${response.body}');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FutureOr<http.Response> sendPlan(
|
||||
Map<String, dynamic>? plan,
|
||||
String? name,
|
||||
String? details,
|
||||
String? duration,
|
||||
) async {
|
||||
int id = plan?['id'];
|
||||
String url = '${dotenv.env['SERVER_ROOT']!}/plans/update/$id';
|
||||
|
||||
final Map<String, dynamic> credentials = {
|
||||
'id': id,
|
||||
'name': name,
|
||||
'details': details,
|
||||
'duration': '14',
|
||||
};
|
||||
|
||||
var response = await http.post(
|
||||
Uri.parse(url),
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: json.encode(credentials),
|
||||
encoding: utf8,
|
||||
);
|
||||
|
||||
return response;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'plan_edit_bloc.dart';
|
||||
|
||||
/// Abstract class for all events that can be dispatched from the
|
||||
///PlanEdit widget.
|
||||
///
|
||||
/// Events must be immutable and implement the [Equatable] interface.
|
||||
@immutable
|
||||
abstract class PlanEditEvent extends Equatable {}
|
||||
|
||||
/// Event that is dispatched when the PlanEdit widget is first created.
|
||||
class PlanEditInitialEvent extends PlanEditEvent {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
|
||||
class EditPlan extends PlanEditEvent {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'plan_edit_bloc.dart';
|
||||
|
||||
/// Represents the state of PlanEdit in the application.
|
||||
///
|
||||
|
||||
class PlanEditState extends Equatable {
|
||||
PlanEditState({
|
||||
this.planModelObj,
|
||||
});
|
||||
|
||||
PlanEditModel? planModelObj;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [planModelObj];
|
||||
PlanEditState copyWith({PlanEditModel? planModelObj}) {
|
||||
return PlanEditState(
|
||||
planModelObj: planModelObj ?? this.planModelObj,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class PlanEditLoadedState extends PlanEditState {
|
||||
PlanEditLoadedState(
|
||||
{this.planModelObj, this.plan, this.name, this.details, this.duration});
|
||||
|
||||
PlanEditModel? planModelObj;
|
||||
Map<String, dynamic>? plan;
|
||||
TextEditingController? name;
|
||||
TextEditingController? details;
|
||||
TextEditingController? duration;
|
||||
@override
|
||||
List<Object?> get props => [planModelObj, plan, name, details, duration];
|
||||
PlanEditLoadedState copyWith({
|
||||
PlanEditModel? planModelObj,
|
||||
Map<String, dynamic>? plan,
|
||||
TextEditingController? name,
|
||||
TextEditingController? details,
|
||||
TextEditingController? duration,
|
||||
}) {
|
||||
return PlanEditLoadedState(
|
||||
planModelObj: planModelObj ?? this.planModelObj,
|
||||
plan: plan ?? this.plan,
|
||||
name: name ?? this.name,
|
||||
details: details ?? this.details,
|
||||
duration: duration ?? this.duration,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class PlanEditErrorState extends PlanEditState {
|
||||
final String errorMessage;
|
||||
|
||||
PlanEditErrorState(this.errorMessage);
|
||||
|
||||
@override
|
||||
List<Object> get props => [errorMessage];
|
||||
}
|
||||
|
||||
class PlanEditInitialState extends PlanEditState {
|
||||
PlanEditInitialState({required PlanEditModel planModelObj})
|
||||
: super(planModelObj: planModelObj);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
/// This class defines the variables used in the [plan_edit_screen],
|
||||
/// and is typically used to hold data that is passed between different parts of the application.
|
||||
|
||||
class PlanEditModel extends Equatable {
|
||||
final String planID;
|
||||
|
||||
PlanEditModel({required String planID}) : planID = planID;
|
||||
|
||||
PlanEditModel copyWith(String planID) {
|
||||
return PlanEditModel(planID: planID);
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [planID];
|
||||
}
|
||||
114
lib/presentation/plans/plan_edit_screen/plan_edit_screen.dart
Normal file
114
lib/presentation/plans/plan_edit_screen/plan_edit_screen.dart
Normal file
@@ -0,0 +1,114 @@
|
||||
import 'bloc/plan_edit_bloc.dart';
|
||||
import 'models/plan_edit_model.dart';
|
||||
import 'package:eatvio_app/core/app_export.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:eatvio_app/widgets/custom_bottom_bar.dart';
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
|
||||
class PlanEditScreen extends StatelessWidget {
|
||||
const PlanEditScreen({Key? key}) : super(key: key);
|
||||
static Widget builder(BuildContext context) {
|
||||
final planID = ModalRoute.of(context)!.settings.arguments;
|
||||
return BlocProvider<PlanEditBloc>(
|
||||
create: (context) => PlanEditBloc(PlanEditState(
|
||||
planModelObj: PlanEditModel(planID: planID.toString())))
|
||||
..add(PlanEditInitialEvent()),
|
||||
child: PlanEditScreen());
|
||||
}
|
||||
|
||||
Widget build(BuildContext context) {
|
||||
return BlocBuilder<PlanEditBloc, PlanEditState>(
|
||||
builder: (context, state) {
|
||||
if (state is PlanEditInitialState) {
|
||||
// Это начальное состояние, данные ещё не загружены.
|
||||
return Container(
|
||||
color: Colors.white,
|
||||
);
|
||||
} else if (state is PlanEditLoadedState) {
|
||||
// Данные загружены, можно строить экран.
|
||||
return _buildPlanEdit(context, state);
|
||||
} else if (state is PlanEditErrorState) {
|
||||
// Произошла ошибка при загрузке данных.
|
||||
return Center(child: Text(state.errorMessage));
|
||||
} else {
|
||||
// Другие состояния, если они есть.
|
||||
return Container(); // Пустой контейнер для необработанных состояний.
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
_buildPlanEdit(BuildContext context, PlanEditLoadedState state) {
|
||||
mediaQueryData = MediaQuery.of(context);
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
body: Container(
|
||||
width: double.maxFinite,
|
||||
decoration: AppDecoration.fillGray,
|
||||
child: ListView(children: [
|
||||
SizedBox(height: 30.v),
|
||||
Container(
|
||||
margin: EdgeInsets.only(
|
||||
left: 16.h,
|
||||
right: 20.h,
|
||||
bottom: 10.h,
|
||||
),
|
||||
padding: EdgeInsets.all(12.h),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: const BorderRadius.all(Radius.circular(12)),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.grey.withOpacity(0.5),
|
||||
spreadRadius: 2,
|
||||
blurRadius: 5,
|
||||
offset: Offset(0, 3),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Column(mainAxisSize: MainAxisSize.min, children: [
|
||||
CachedNetworkImage(
|
||||
imageUrl: dotenv.env['STORAGE_URL']! +
|
||||
(state.plan?['image'] ?? ''),
|
||||
imageBuilder: (context, imageProvider) => CircleAvatar(
|
||||
backgroundImage: imageProvider,
|
||||
radius: 25,
|
||||
),
|
||||
placeholder: (context, url) =>
|
||||
CircularProgressIndicator(),
|
||||
errorWidget: (context, url, error) => CircleAvatar(
|
||||
child: Icon(Icons.person),
|
||||
backgroundColor: Colors.white,
|
||||
radius: 25,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 16.0),
|
||||
TextFormField(
|
||||
controller: state.name,
|
||||
decoration: InputDecoration(labelText: 'Заголовок'),
|
||||
),
|
||||
SizedBox(height: 16.0),
|
||||
TextFormField(
|
||||
controller: state.details,
|
||||
decoration: InputDecoration(labelText: 'Описание'),
|
||||
),
|
||||
SizedBox(height: 16.0),
|
||||
// Здесь нужно добавить виджет для загрузки картинки
|
||||
ElevatedButton(
|
||||
onPressed: () =>
|
||||
context.read<PlanEditBloc>().add(EditPlan()),
|
||||
child: Text('Сохранить'),
|
||||
)
|
||||
]),
|
||||
)
|
||||
]),
|
||||
),
|
||||
bottomNavigationBar: _buildBottomBar(context)));
|
||||
}
|
||||
}
|
||||
|
||||
_buildBottomBar(BuildContext context) {
|
||||
return CustomBottomBar(onChanged: (BottomBarEnum type) {});
|
||||
}
|
||||
@@ -86,6 +86,16 @@ class PlanSelectScreen extends StatelessWidget {
|
||||
margin: EdgeInsets.only(
|
||||
left: 80.h, top: 12.v, bottom: 9.v),
|
||||
),
|
||||
Spacer(),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 20.0),
|
||||
child: GestureDetector(
|
||||
onTap: () => Navigator.pushNamed(
|
||||
context,
|
||||
AppRoutes.planCreateScreen,
|
||||
),
|
||||
child: Icon(Icons.create_outlined)),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -140,6 +150,13 @@ class PlanSelectScreen extends StatelessWidget {
|
||||
AppRoutes.planScreen,
|
||||
arguments: post?['id'].toString(),
|
||||
),
|
||||
trailing: GestureDetector(
|
||||
onTap: () => Navigator.pushNamed(
|
||||
context,
|
||||
AppRoutes.planEditScreen,
|
||||
arguments: post?['id'].toString(),
|
||||
),
|
||||
child: Icon(Icons.edit)),
|
||||
));
|
||||
},
|
||||
),
|
||||
|
||||
@@ -26,6 +26,8 @@ import 'package:eatvio_app/presentation/chat/chat_select_screen/chat_select_scre
|
||||
import 'package:eatvio_app/presentation/feed/feed_screen/feed_screen.dart';
|
||||
import 'package:eatvio_app/presentation/recipe/recipe_select_screen/recipe_select_screen.dart';
|
||||
import 'package:eatvio_app/presentation/plans/plan_select_screen/plan_select_screen.dart';
|
||||
import 'package:eatvio_app/presentation/plans/plan_edit_screen/plan_edit_screen.dart';
|
||||
import 'package:eatvio_app/presentation/plans/plan_create_screen/plan_create_screen.dart';
|
||||
import 'package:eatvio_app/presentation/diets/diet_show_screen/diet_show_screen.dart';
|
||||
import 'package:eatvio_app/presentation/diets/diet_edit_screen/diet_edit_screen.dart';
|
||||
import 'package:eatvio_app/presentation/diets/diet_create_screen/diet_create_screen.dart';
|
||||
@@ -106,7 +108,7 @@ class AppRoutes {
|
||||
|
||||
static const String dietScreen = '/diet';
|
||||
|
||||
static const String dietEditScreen = 'dietEdit';
|
||||
static const String dietEditScreen = '/dietEdit';
|
||||
|
||||
static const String dietCreateScreen = '/dietCreate';
|
||||
|
||||
@@ -114,6 +116,10 @@ class AppRoutes {
|
||||
|
||||
static const String planScreen = '/plan';
|
||||
|
||||
static const String planEditScreen = '/planEdit';
|
||||
|
||||
static const String planCreateScreen = '/planCreate';
|
||||
|
||||
static Map<String, WidgetBuilder> get routes => {
|
||||
dateOfBirthScreen: DateOfBirthScreen.builder,
|
||||
cityOfLivingScreen: CityOfLivingScreen.builder,
|
||||
@@ -146,6 +152,8 @@ class AppRoutes {
|
||||
recipeScreen: RecipeScreen.builder,
|
||||
dietScreen: DietScreen.builder,
|
||||
planScreen: PlanScreen.builder,
|
||||
planEditScreen: PlanEditScreen.builder,
|
||||
planCreateScreen: PlanCreateScreen.builder,
|
||||
blogPostScreen: BlogPostScreen.builder,
|
||||
blogPostEditScreen: BlogPostEditScreen.builder,
|
||||
blogPostCreateScreen: BlogPostCreateScreen.builder,
|
||||
|
||||
Reference in New Issue
Block a user