update faltan los ifs
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
import 'dart:developer';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
@@ -9,10 +7,8 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import 'package:injector/injector.dart';
|
||||
import 'package:professional_repository/professional_repository.dart';
|
||||
import 'package:prosappco/blocs/my_user_bloc/my_user_bloc.dart';
|
||||
import 'package:prosappco/blocs/professional_bloc/professional_bloc.dart';
|
||||
import 'package:prosappco/blocs/professional_profile_bloc/professional_profile_bloc.dart';
|
||||
import 'package:prosappco/components/general_primary_button.dart';
|
||||
import 'package:prosappco/screens/professional/professional_map_screen.dart';
|
||||
import 'package:prosappco/screens/professional/professional_schedule_screen.dart';
|
||||
import 'package:setting_repository/setting_repository.dart';
|
||||
@@ -484,41 +480,67 @@ class _ProfessionalProfileScreenState extends State<ProfessionalProfileScreen> {
|
||||
],
|
||||
),
|
||||
),
|
||||
const Divider(height: 0),
|
||||
const SizedBox(height: 20),
|
||||
GeneralPrimaryButton(
|
||||
onPressed: () {
|
||||
context.read<ProfessionalProfileBloc>().add(
|
||||
UpdateProfessionalProfileInfo(
|
||||
address: _addressController.text,
|
||||
aditionalAddress: _aditionalAddressController.text,
|
||||
latitude: _latitudeController,
|
||||
longitude: _longitudeController,
|
||||
locationPreferences: officeValue && deliveryValue
|
||||
? LocationPreferences.both
|
||||
: officeValue && !deliveryValue
|
||||
? LocationPreferences.office
|
||||
: deliveryValue && !officeValue
|
||||
? LocationPreferences.delivery
|
||||
: LocationPreferences.office,
|
||||
paymentMethods: PaymentMethodEntity(
|
||||
datafono: isDatafonoActive,
|
||||
nequi: isNequiActive,
|
||||
transferencia: isTransferActive,
|
||||
const Divider(
|
||||
height: 1,
|
||||
thickness: 0.5,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 10,
|
||||
horizontal: 15,
|
||||
),
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
context.read<ProfessionalProfileBloc>().add(
|
||||
UpdateProfessionalProfileInfo(
|
||||
address: _addressController.text,
|
||||
aditionalAddress: _aditionalAddressController.text,
|
||||
latitude: _latitudeController,
|
||||
longitude: _longitudeController,
|
||||
locationPreferences: officeValue && deliveryValue
|
||||
? LocationPreferences.both
|
||||
: officeValue && !deliveryValue
|
||||
? LocationPreferences.office
|
||||
: deliveryValue && !officeValue
|
||||
? LocationPreferences.delivery
|
||||
: LocationPreferences.office,
|
||||
paymentMethods: PaymentMethodEntity(
|
||||
datafono: isDatafonoActive,
|
||||
nequi: isNequiActive,
|
||||
transferencia: isTransferActive,
|
||||
),
|
||||
schedules: schedules,
|
||||
rate: _rateController.text,
|
||||
),
|
||||
schedules: schedules,
|
||||
rate: _rateController.text,
|
||||
),
|
||||
);
|
||||
context.read<ProfessionalProfileBloc>().add(
|
||||
UpdateProfessionalBannerInfo(fileBanner: _imageFile?.path),
|
||||
);
|
||||
);
|
||||
context.read<ProfessionalProfileBloc>().add(
|
||||
UpdateProfessionalBannerInfo(fileBanner: _imageFile?.path),
|
||||
);
|
||||
|
||||
log('xd -- si pasa');
|
||||
},
|
||||
label: 'Guardar',
|
||||
ScaffoldMessenger.of(context).clearSnackBars();
|
||||
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
|
||||
content: Text('Información actualizada correctamente'),
|
||||
));
|
||||
},
|
||||
style: FilledButton.styleFrom(
|
||||
backgroundColor: Theme.of(context).colorScheme.primary,
|
||||
padding: const EdgeInsets.symmetric(vertical: 15),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
),
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
child: const Text(
|
||||
'Guardar',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user