forked from eatvio/eatvio_app
New screen names
This commit is contained in:
@@ -0,0 +1,246 @@
|
||||
import 'bloc/app_navigation_bloc.dart';
|
||||
import 'models/app_navigation_model.dart';
|
||||
import 'package:eatvio_app/core/app_export.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class AppNavigationScreen extends StatelessWidget {
|
||||
const AppNavigationScreen({Key? key})
|
||||
: super(
|
||||
key: key,
|
||||
);
|
||||
|
||||
static Widget builder(BuildContext context) {
|
||||
return BlocProvider<AppNavigationBloc>(
|
||||
create: (context) => AppNavigationBloc(AppNavigationState(
|
||||
appNavigationModelObj: AppNavigationModel(),
|
||||
))
|
||||
..add(AppNavigationInitialEvent()),
|
||||
child: AppNavigationScreen(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
mediaQueryData = MediaQuery.of(context);
|
||||
|
||||
return BlocBuilder<AppNavigationBloc, AppNavigationState>(
|
||||
builder: (context, state) {
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
backgroundColor: Color(0XFFFFFFFF),
|
||||
body: SizedBox(
|
||||
width: double.maxFinite,
|
||||
child: Column(
|
||||
children: [
|
||||
_buildAppNavigation(context),
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0XFFFFFFFF),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
_buildScreenTitle(
|
||||
context,
|
||||
screenTitle: "date_of_birth".tr,
|
||||
onTapScreenTitle: () =>
|
||||
onTapScreenTitle(AppRoutes.dateOfBirthScreen),
|
||||
),
|
||||
_buildScreenTitle(
|
||||
context,
|
||||
screenTitle: "city_of_living".tr,
|
||||
onTapScreenTitle: () => onTapScreenTitle(
|
||||
AppRoutes.cityOfLivingScreen),
|
||||
),
|
||||
_buildScreenTitle(
|
||||
context,
|
||||
screenTitle: "body_circumferences".tr,
|
||||
onTapScreenTitle: () => onTapScreenTitle(
|
||||
AppRoutes.bodyCircumferencesScreen),
|
||||
),
|
||||
_buildScreenTitle(
|
||||
context,
|
||||
screenTitle: "weight".tr,
|
||||
onTapScreenTitle: () =>
|
||||
onTapScreenTitle(AppRoutes.weightScreen),
|
||||
),
|
||||
_buildScreenTitle(
|
||||
context,
|
||||
screenTitle: "allergies".tr,
|
||||
onTapScreenTitle: () =>
|
||||
onTapScreenTitle(AppRoutes.allergiesScreen),
|
||||
),
|
||||
_buildScreenTitle(
|
||||
context,
|
||||
screenTitle: "medicine_intake".tr,
|
||||
onTapScreenTitle: () => onTapScreenTitle(
|
||||
AppRoutes.medicineIntakeScreen),
|
||||
),
|
||||
_buildScreenTitle(
|
||||
context,
|
||||
screenTitle: "splash_screen".tr,
|
||||
onTapScreenTitle: () =>
|
||||
onTapScreenTitle(AppRoutes.splashScreen),
|
||||
),
|
||||
_buildScreenTitle(
|
||||
context,
|
||||
screenTitle: "gender".tr,
|
||||
onTapScreenTitle: () =>
|
||||
onTapScreenTitle(AppRoutes.genderScreen),
|
||||
),
|
||||
_buildScreenTitle(
|
||||
context,
|
||||
screenTitle: "blood_pressure".tr,
|
||||
onTapScreenTitle: () => onTapScreenTitle(
|
||||
AppRoutes.bloodPressureScreen),
|
||||
),
|
||||
_buildScreenTitle(
|
||||
context,
|
||||
screenTitle: "favorite_sports".tr,
|
||||
onTapScreenTitle: () => onTapScreenTitle(
|
||||
AppRoutes.favoriteSportsScreen),
|
||||
),
|
||||
_buildScreenTitle(
|
||||
context,
|
||||
screenTitle: "favorite_foods".tr,
|
||||
onTapScreenTitle: () => onTapScreenTitle(
|
||||
AppRoutes.favoriteFoodsScreen),
|
||||
),
|
||||
_buildScreenTitle(
|
||||
context,
|
||||
screenTitle: "schedule".tr,
|
||||
onTapScreenTitle: () =>
|
||||
onTapScreenTitle(AppRoutes.scheduleScreen),
|
||||
),
|
||||
_buildScreenTitle(
|
||||
context,
|
||||
screenTitle: "additional_information".tr,
|
||||
onTapScreenTitle: () => onTapScreenTitle(
|
||||
AppRoutes.additionalInformationScreen),
|
||||
),
|
||||
_buildScreenTitle(
|
||||
context,
|
||||
screenTitle: "language_select".tr,
|
||||
onTapScreenTitle: () => onTapScreenTitle(
|
||||
AppRoutes.languageSelectScreen),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
Widget _buildAppNavigation(BuildContext context) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0XFFFFFFFF),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(height: 10.v),
|
||||
Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20.h),
|
||||
child: Text(
|
||||
"App Navigation".tr,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Color(0XFF000000),
|
||||
fontSize: 20.fSize,
|
||||
fontFamily: 'Roboto',
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 10.v),
|
||||
Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(left: 20.h),
|
||||
child: Text(
|
||||
"Check your app's UI from the below demo screens of your app."
|
||||
.tr,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Color(0XFF888888),
|
||||
fontSize: 16.fSize,
|
||||
fontFamily: 'Roboto',
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 5.v),
|
||||
Divider(
|
||||
height: 1.v,
|
||||
thickness: 1.v,
|
||||
color: Color(0XFF000000),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// Common widget
|
||||
Widget _buildScreenTitle(
|
||||
BuildContext context, {
|
||||
required String screenTitle,
|
||||
Function? onTapScreenTitle,
|
||||
}) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
onTapScreenTitle!.call();
|
||||
},
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0XFFFFFFFF),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(height: 10.v),
|
||||
Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20.h),
|
||||
child: Text(
|
||||
screenTitle,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Color(0XFF000000),
|
||||
fontSize: 20.fSize,
|
||||
fontFamily: 'Roboto',
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 10.v),
|
||||
SizedBox(height: 5.v),
|
||||
Divider(
|
||||
height: 1.v,
|
||||
thickness: 1.v,
|
||||
color: Color(0XFF888888),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// Common click event
|
||||
void onTapScreenTitle(String routeName) {
|
||||
NavigatorService.pushNamed(routeName);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '/core/app_export.dart';
|
||||
import 'package:eatvio_app/presentation/app_navigation_screen/models/app_navigation_model.dart';
|
||||
part 'app_navigation_event.dart';
|
||||
part 'app_navigation_state.dart';
|
||||
|
||||
/// A bloc that manages the state of a AppNavigation according to the event that is dispatched to it.
|
||||
class AppNavigationBloc extends Bloc<AppNavigationEvent, AppNavigationState> {
|
||||
AppNavigationBloc(AppNavigationState initialState) : super(initialState) {
|
||||
on<AppNavigationInitialEvent>(_onInitialize);
|
||||
}
|
||||
|
||||
_onInitialize(
|
||||
AppNavigationInitialEvent event,
|
||||
Emitter<AppNavigationState> emit,
|
||||
) async {}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'app_navigation_bloc.dart';
|
||||
|
||||
/// Abstract class for all events that can be dispatched from the
|
||||
///AppNavigation widget.
|
||||
///
|
||||
/// Events must be immutable and implement the [Equatable] interface.
|
||||
@immutable
|
||||
abstract class AppNavigationEvent extends Equatable {}
|
||||
|
||||
/// Event that is dispatched when the AppNavigation widget is first created.
|
||||
class AppNavigationInitialEvent extends AppNavigationEvent {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'app_navigation_bloc.dart';
|
||||
|
||||
/// Represents the state of AppNavigation in the application.
|
||||
class AppNavigationState extends Equatable {
|
||||
AppNavigationState({this.appNavigationModelObj});
|
||||
|
||||
AppNavigationModel? appNavigationModelObj;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
appNavigationModelObj,
|
||||
];
|
||||
AppNavigationState copyWith({AppNavigationModel? appNavigationModelObj}) {
|
||||
return AppNavigationState(
|
||||
appNavigationModelObj:
|
||||
appNavigationModelObj ?? this.appNavigationModelObj,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
/// This class defines the variables used in the [app_navigation_screen],
|
||||
/// and is typically used to hold data that is passed between different parts of the application.
|
||||
class AppNavigationModel extends Equatable {
|
||||
AppNavigationModel() {}
|
||||
|
||||
AppNavigationModel copyWith() {
|
||||
return AppNavigationModel();
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
Reference in New Issue
Block a user