forked from eatvio/eatvio_app
New screen names
This commit is contained in:
@@ -0,0 +1,122 @@
|
||||
import 'bloc/additional_information_bloc.dart';
|
||||
import 'models/additional_information_model.dart';
|
||||
import 'package:eatvio_app/core/app_export.dart';
|
||||
import 'package:eatvio_app/widgets/app_bar/appbar_leading_image.dart';
|
||||
import 'package:eatvio_app/widgets/app_bar/appbar_title_image.dart';
|
||||
import 'package:eatvio_app/widgets/app_bar/custom_app_bar.dart';
|
||||
import 'package:eatvio_app/widgets/custom_outlined_button.dart';
|
||||
import 'package:eatvio_app/widgets/custom_text_form_field.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class AdditionalInformationScreen extends StatelessWidget {
|
||||
const AdditionalInformationScreen({Key? key}) : super(key: key);
|
||||
|
||||
static Widget builder(BuildContext context) {
|
||||
return BlocProvider<AdditionalInformationBloc>(
|
||||
create: (context) => AdditionalInformationBloc(
|
||||
AdditionalInformationState(
|
||||
additionalInformationModelObj: AdditionalInformationModel()))
|
||||
..add(AdditionalInformationInitialEvent()),
|
||||
child: AdditionalInformationScreen());
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
mediaQueryData = MediaQuery.of(context);
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: _buildAppBar(context),
|
||||
body: Container(
|
||||
width: double.maxFinite,
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 9.v),
|
||||
child: Column(children: [
|
||||
SizedBox(height: 7.v),
|
||||
_buildProgressIndicator(context),
|
||||
SizedBox(height: 20.v),
|
||||
SizedBox(
|
||||
width: 192.h,
|
||||
child: Text("msg15".tr,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
textAlign: TextAlign.center,
|
||||
style: theme.textTheme.headlineSmall)),
|
||||
SizedBox(height: 73.v),
|
||||
_buildNinetyThree(context),
|
||||
Spacer(),
|
||||
CustomOutlinedButton(text: "lbl2".tr.toUpperCase()),
|
||||
SizedBox(height: 17.v),
|
||||
Text("lbl3".tr, style: theme.textTheme.bodyLarge)
|
||||
]))));
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
PreferredSizeWidget _buildAppBar(BuildContext context) {
|
||||
return CustomAppBar(
|
||||
leadingWidth: 31.h,
|
||||
leading: AppbarLeadingImage(
|
||||
imagePath: ImageConstant.imgArrowLeft,
|
||||
margin: EdgeInsets.only(left: 18.h, top: 15.v, bottom: 15.v),
|
||||
onTap: () {
|
||||
onTapArrowLeft(context);
|
||||
}),
|
||||
centerTitle: true,
|
||||
title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio));
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
Widget _buildProgressIndicator(BuildContext context) {
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 4.h, vertical: 3.v),
|
||||
decoration: AppDecoration.outlinePrimary
|
||||
.copyWith(borderRadius: BorderRadiusStyle.circleBorder8),
|
||||
child: Container(
|
||||
height: 8.v,
|
||||
width: 332.h,
|
||||
decoration: BoxDecoration(
|
||||
color: appTheme.blueA400,
|
||||
borderRadius: BorderRadius.circular(4.h),
|
||||
border:
|
||||
Border.all(color: theme.colorScheme.primary, width: 1.h))));
|
||||
}
|
||||
|
||||
/// Section Widget
|
||||
Widget _buildNinetyThree(BuildContext context) {
|
||||
return SizedBox(
|
||||
height: 257.v,
|
||||
width: 343.h,
|
||||
child: Stack(alignment: Alignment.center, children: [
|
||||
Align(
|
||||
alignment: Alignment.topLeft,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(left: 10.h, top: 69.v),
|
||||
child: Text("msg5".tr, style: theme.textTheme.bodyLarge))),
|
||||
Align(
|
||||
alignment: Alignment.center,
|
||||
child: Column(mainAxisSize: MainAxisSize.min, children: [
|
||||
Container(
|
||||
width: 294.h,
|
||||
margin: EdgeInsets.only(left: 24.h, right: 23.h),
|
||||
child: Text("msg16".tr,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
textAlign: TextAlign.center,
|
||||
style: CustomTextStyles.titleMediumSegoeUI)),
|
||||
SizedBox(height: 10.v),
|
||||
BlocSelector<AdditionalInformationBloc,
|
||||
AdditionalInformationState, TextEditingController?>(
|
||||
selector: (state) => state.editTextController,
|
||||
builder: (context, editTextController) {
|
||||
return CustomTextFormField(
|
||||
controller: editTextController,
|
||||
textInputAction: TextInputAction.done);
|
||||
})
|
||||
]))
|
||||
]));
|
||||
}
|
||||
|
||||
/// Navigates to the previous screen.
|
||||
onTapArrowLeft(BuildContext context) {
|
||||
NavigatorService.goBack();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '/core/app_export.dart';
|
||||
import 'package:eatvio_app/presentation/additional_information_screen/models/additional_information_model.dart';
|
||||
part 'additional_information_event.dart';
|
||||
part 'additional_information_state.dart';
|
||||
|
||||
/// A bloc that manages the state of a AdditionalInformation according to the event that is dispatched to it.
|
||||
class AdditionalInformationBloc
|
||||
extends Bloc<AdditionalInformationEvent, AdditionalInformationState> {
|
||||
AdditionalInformationBloc(AdditionalInformationState initialState)
|
||||
: super(initialState) {
|
||||
on<AdditionalInformationInitialEvent>(_onInitialize);
|
||||
}
|
||||
|
||||
_onInitialize(
|
||||
AdditionalInformationInitialEvent event,
|
||||
Emitter<AdditionalInformationState> emit,
|
||||
) async {
|
||||
emit(state.copyWith(editTextController: TextEditingController()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'additional_information_bloc.dart';
|
||||
|
||||
/// Abstract class for all events that can be dispatched from the
|
||||
///AdditionalInformation widget.
|
||||
///
|
||||
/// Events must be immutable and implement the [Equatable] interface.
|
||||
@immutable
|
||||
abstract class AdditionalInformationEvent extends Equatable {}
|
||||
|
||||
/// Event that is dispatched when the AdditionalInformation widget is first created.
|
||||
class AdditionalInformationInitialEvent extends AdditionalInformationEvent {
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
part of 'additional_information_bloc.dart';
|
||||
|
||||
/// Represents the state of AdditionalInformation in the application.
|
||||
class AdditionalInformationState extends Equatable {
|
||||
AdditionalInformationState({
|
||||
this.editTextController,
|
||||
this.additionalInformationModelObj,
|
||||
});
|
||||
|
||||
TextEditingController? editTextController;
|
||||
|
||||
AdditionalInformationModel? additionalInformationModelObj;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
editTextController,
|
||||
additionalInformationModelObj,
|
||||
];
|
||||
AdditionalInformationState copyWith({
|
||||
TextEditingController? editTextController,
|
||||
AdditionalInformationModel? additionalInformationModelObj,
|
||||
}) {
|
||||
return AdditionalInformationState(
|
||||
editTextController: editTextController ?? this.editTextController,
|
||||
additionalInformationModelObj:
|
||||
additionalInformationModelObj ?? this.additionalInformationModelObj,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
/// This class defines the variables used in the [additional_information_screen],
|
||||
/// and is typically used to hold data that is passed between different parts of the application.
|
||||
class AdditionalInformationModel extends Equatable {
|
||||
AdditionalInformationModel() {}
|
||||
|
||||
AdditionalInformationModel copyWith() {
|
||||
return AdditionalInformationModel();
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
Reference in New Issue
Block a user