update
This commit is contained in:
@@ -561,10 +561,11 @@ class ProfessionalProfileScreenState extends State<ProfessionalProfileScreen> {
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
appBar: PopAppbar(
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
label: 'Perfil profesional'),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
label: 'Perfil profesional',
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
reverse: true,
|
||||
child: Center(
|
||||
|
||||
@@ -33,9 +33,11 @@ class _ProfileProScreenState extends State<ProfileProScreen> {
|
||||
File? image_portada;
|
||||
File? imagen_to_upload;
|
||||
|
||||
bool domicilioValue = false;
|
||||
bool tarifaValue = false;
|
||||
|
||||
bool domicilioValue = true;
|
||||
bool sitioValue = false;
|
||||
|
||||
var photoTemp = '';
|
||||
|
||||
var _photo = '...';
|
||||
@@ -385,6 +387,24 @@ class _ProfileProScreenState extends State<ProfileProScreen> {
|
||||
);
|
||||
}
|
||||
|
||||
void toggleDomicilio(bool newValue) {
|
||||
setState(() {
|
||||
domicilioValue = newValue;
|
||||
if (newValue == false && sitioValue == false) {
|
||||
sitioValue = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void toggleSitio(bool newValue) {
|
||||
setState(() {
|
||||
sitioValue = newValue;
|
||||
if (newValue == false && domicilioValue == false) {
|
||||
domicilioValue = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
String address = _direccion.toString();
|
||||
@@ -455,20 +475,9 @@ class _ProfileProScreenState extends State<ProfileProScreen> {
|
||||
),
|
||||
if (settings?.domicilios == true)
|
||||
customSwitch(
|
||||
'Servicio a domicilio',
|
||||
domicilioValue,
|
||||
(value) {
|
||||
domicilioValue = value;
|
||||
},
|
||||
),
|
||||
'Servicio a domicilio', domicilioValue, toggleDomicilio),
|
||||
const Divider(),
|
||||
customSwitch(
|
||||
'Servicio en sitio',
|
||||
sitioValue,
|
||||
(value) {
|
||||
sitioValue = value;
|
||||
},
|
||||
),
|
||||
customSwitch('Servicio en sitio', sitioValue, toggleSitio),
|
||||
sitioValue
|
||||
? Padding(
|
||||
padding:
|
||||
@@ -540,7 +549,7 @@ class _ProfileProScreenState extends State<ProfileProScreen> {
|
||||
TableCell(
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text('Lunes'),
|
||||
child: const Text('Lunes'),
|
||||
),
|
||||
),
|
||||
TableCell(
|
||||
@@ -672,7 +681,8 @@ class _ProfileProScreenState extends State<ProfileProScreen> {
|
||||
);
|
||||
}
|
||||
|
||||
customSwitch(String text, bool switchValue, ValueChanged<bool> onChanged) {
|
||||
Widget customSwitch(
|
||||
String text, bool switchValue, ValueChanged<bool> onChanged) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 30),
|
||||
child: SizedBox(
|
||||
@@ -680,22 +690,19 @@ class _ProfileProScreenState extends State<ProfileProScreen> {
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
text,
|
||||
style: const TextStyle(
|
||||
fontSize: 15,
|
||||
color: Colors.black,
|
||||
child: Text(
|
||||
text,
|
||||
style: const TextStyle(
|
||||
fontSize: 15,
|
||||
color: Colors.black,
|
||||
),
|
||||
),
|
||||
)),
|
||||
),
|
||||
Transform.scale(
|
||||
scale: 1.2,
|
||||
child: Switch(
|
||||
value: switchValue,
|
||||
onChanged: (bool newValue) {
|
||||
setState(() {
|
||||
onChanged(newValue);
|
||||
});
|
||||
},
|
||||
onChanged: onChanged,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -33,7 +33,7 @@ class _ProfileProWebScreenState extends State<ProfileProWebScreen> {
|
||||
double latUser = 0.0;
|
||||
double lngUser = 0.0;
|
||||
|
||||
bool domicilioValue = false;
|
||||
bool domicilioValue = true;
|
||||
bool tarifaValue = false;
|
||||
bool sitioValue = false;
|
||||
var photoTemp = '';
|
||||
@@ -314,6 +314,24 @@ class _ProfileProWebScreenState extends State<ProfileProWebScreen> {
|
||||
}
|
||||
}
|
||||
|
||||
void toggleDomicilio(bool newValue) {
|
||||
setState(() {
|
||||
domicilioValue = newValue;
|
||||
if (newValue == false && sitioValue == false) {
|
||||
sitioValue = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void toggleSitio(bool newValue) {
|
||||
setState(() {
|
||||
sitioValue = newValue;
|
||||
if (newValue == false && domicilioValue == false) {
|
||||
domicilioValue = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
@@ -368,20 +386,9 @@ class _ProfileProWebScreenState extends State<ProfileProWebScreen> {
|
||||
),
|
||||
if (settings?.domicilios == true)
|
||||
customSwitch(
|
||||
'Servicio a domicilio',
|
||||
domicilioValue,
|
||||
(value) {
|
||||
domicilioValue = value;
|
||||
},
|
||||
),
|
||||
'Servicio a domicilio', domicilioValue, toggleDomicilio),
|
||||
const Divider(),
|
||||
customSwitch(
|
||||
'Servicio en sitio',
|
||||
sitioValue,
|
||||
(value) {
|
||||
sitioValue = value;
|
||||
},
|
||||
),
|
||||
customSwitch('Servicio en sitio', sitioValue, toggleSitio),
|
||||
sitioValue
|
||||
? Padding(
|
||||
padding:
|
||||
@@ -589,7 +596,8 @@ class _ProfileProWebScreenState extends State<ProfileProWebScreen> {
|
||||
);
|
||||
}
|
||||
|
||||
customSwitch(String text, bool switchValue, ValueChanged<bool> onChanged) {
|
||||
Widget customSwitch(
|
||||
String text, bool switchValue, ValueChanged<bool> onChanged) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 30),
|
||||
child: SizedBox(
|
||||
@@ -597,22 +605,19 @@ class _ProfileProWebScreenState extends State<ProfileProWebScreen> {
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
text,
|
||||
style: const TextStyle(
|
||||
fontSize: 15,
|
||||
color: Colors.black,
|
||||
child: Text(
|
||||
text,
|
||||
style: const TextStyle(
|
||||
fontSize: 15,
|
||||
color: Colors.black,
|
||||
),
|
||||
),
|
||||
)),
|
||||
),
|
||||
Transform.scale(
|
||||
scale: 1.2,
|
||||
child: Switch(
|
||||
value: switchValue,
|
||||
onChanged: (bool newValue) {
|
||||
setState(() {
|
||||
onChanged(newValue);
|
||||
});
|
||||
},
|
||||
onChanged: onChanged,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -261,7 +261,7 @@ class _ServiceScreenState extends State<ServiceScreen> {
|
||||
}
|
||||
|
||||
void _checkForUpdate(String? settings) {
|
||||
if (appVersion == settings) {
|
||||
if (appVersion != settings) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
|
||||
@@ -12,16 +12,30 @@ class WebViewScreen extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _WebViewScreenState extends State<WebViewScreen> {
|
||||
bool isLoading = true;
|
||||
|
||||
late WebViewController controller;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final controller = WebViewController()
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
controller = WebViewController()
|
||||
..setJavaScriptMode(JavaScriptMode.unrestricted)
|
||||
..setBackgroundColor(const Color(0x00000000))
|
||||
..setNavigationDelegate(
|
||||
NavigationDelegate(
|
||||
onProgress: (int progress) {},
|
||||
onPageStarted: (String url) {},
|
||||
onPageFinished: (String url) {},
|
||||
onPageStarted: (String url) {
|
||||
setState(() {
|
||||
isLoading = true;
|
||||
});
|
||||
},
|
||||
onPageFinished: (String url) {
|
||||
setState(() {
|
||||
isLoading = false;
|
||||
});
|
||||
},
|
||||
onWebResourceError: (WebResourceError error) {},
|
||||
onNavigationRequest: (NavigationRequest request) {
|
||||
if (request.url.startsWith('https://www.youtube.com/')) {
|
||||
@@ -32,6 +46,10 @@ class _WebViewScreenState extends State<WebViewScreen> {
|
||||
),
|
||||
)
|
||||
..loadRequest(Uri.parse(widget.link));
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: PopAppbar(
|
||||
onPressed: () {
|
||||
@@ -41,7 +59,10 @@ class _WebViewScreenState extends State<WebViewScreen> {
|
||||
),
|
||||
body: Stack(
|
||||
children: [
|
||||
const Center(child: CircularProgressIndicator()),
|
||||
if (isLoading)
|
||||
const Center(child: CircularProgressIndicator())
|
||||
else
|
||||
const SizedBox(),
|
||||
WebViewWidget(controller: controller),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user