forked from eatvio/eatvio_app
refactor(iOS): Refactoring for iOS bundle
This commit is contained in:
@@ -26,6 +26,13 @@
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIMainStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
<key>NSPhotoLibraryUsageDescription</key>
|
||||
<string>UserPhotoUpload</string>
|
||||
<key>UIBackgroundModes</key>
|
||||
<array>
|
||||
<string>fetch</string>
|
||||
<string>remote-notification</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
|
||||
@@ -30,7 +30,11 @@ class AuthScreen extends StatelessWidget {
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: _buildAppBar(context),
|
||||
body: Container(
|
||||
body:GestureDetector(
|
||||
onTap: () {
|
||||
FocusScope.of(context).unfocus(); // Скрыть клавиатуру
|
||||
},
|
||||
child: Container(
|
||||
width: double.maxFinite,
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 9.v),
|
||||
child: Column(children: [
|
||||
@@ -85,7 +89,7 @@ class AuthScreen extends StatelessWidget {
|
||||
buttonStyle: CustomButtonStyles.outlinePrimaryTL15,
|
||||
onPressed: onTapAuth(state, context));
|
||||
}),
|
||||
])));
|
||||
]))));
|
||||
}
|
||||
|
||||
onTapAuth(AuthState state, BuildContext context) {
|
||||
|
||||
@@ -38,6 +38,7 @@ class DiaryEditBloc extends Bloc<DiaryEditEvent, DiaryEditState> {
|
||||
on<SendModeration>(_sendModeration);
|
||||
on<RefreshEvent>(
|
||||
reloadScreen); //пользователь нажимает "Добавить комментарий"
|
||||
on<ClearInput>(_clearInput);
|
||||
}
|
||||
|
||||
Future<void> _onInitialize(
|
||||
@@ -547,6 +548,17 @@ class DiaryEditBloc extends Bloc<DiaryEditEvent, DiaryEditState> {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
FutureOr<void> _clearInput(
|
||||
ClearInput event, Emitter<DiaryEditState> emit) {
|
||||
if (state is DiaryEditLoadedState) {
|
||||
var currentState = state as DiaryEditLoadedState;
|
||||
DiaryEditLoadedState updatedState = currentState.copyWith(
|
||||
);
|
||||
emit(updatedState);
|
||||
}
|
||||
}
|
||||
|
||||
FutureOr<void> _changePortion(
|
||||
ChangePortion event, Emitter<DiaryEditState> emit) {
|
||||
if (state is DiaryEditLoadedState) {
|
||||
|
||||
@@ -122,6 +122,15 @@ class ChangeMeal extends DiaryEditEvent {
|
||||
List<Object?> get props => [value, meals];
|
||||
}
|
||||
|
||||
|
||||
class ClearInput extends DiaryEditEvent {
|
||||
ClearInput({required this.value});
|
||||
|
||||
TextEditingController value;
|
||||
@override
|
||||
List<Object?> get props => [value];
|
||||
}
|
||||
|
||||
class ChangePortion extends DiaryEditEvent {
|
||||
ChangePortion({required this.value});
|
||||
|
||||
|
||||
@@ -376,7 +376,6 @@ class DiaryEditScreen extends StatelessWidget {
|
||||
) {
|
||||
if (state.isAdded) {
|
||||
print("Clear");
|
||||
productEditingController.clear();
|
||||
}
|
||||
return CustomTextFormField(
|
||||
hintText: "Введите название продукта",
|
||||
|
||||
@@ -35,6 +35,5 @@ class AppbarTitleImage extends StatelessWidget {
|
||||
}
|
||||
|
||||
void onTapCall() {
|
||||
onTap!.call();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user