fix: use widget.type in _ServiceViewState (build error)

After converting ServiceView to StatefulWidget, the build() method and
helper callbacks still referenced 'type' as a bare name instead of
widget.type, causing compilation failure.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-07-22 09:41:21 -05:00
co-authored by Claude Sonnet 4.6
parent 646e44d126
commit ea442aafa7
+10 -10
View File
@@ -218,12 +218,12 @@ class _ServiceViewState extends State<ServiceView> {
),
ElevatedButton(
onPressed: () {
if (type == 'user') {
if (widget.type == 'user') {
NavigationService.navigateTo(
'/dashboard/user/service/${service.id}/chat/${user.id}');
}
if (type == 'professional') {
if (widget.type == 'professional') {
NavigationService.navigateTo(
'/dashboard/professional/service/${service.id}/chat/${user.id}');
}
@@ -266,7 +266,7 @@ class _ServiceViewState extends State<ServiceView> {
service.range1Hour2.minute,
);
if (type == 'user') {
if (widget.type == 'user') {
if (service.status == ServiceStatus.completed &&
service.professionalScored == false) {
return Stack(
@@ -482,7 +482,7 @@ class _ServiceViewState extends State<ServiceView> {
}
}
if (type == 'professional') {
if (widget.type == 'professional') {
if (service.status == ServiceStatus.completed &&
service.userScored == false) {
return Stack(
@@ -732,7 +732,7 @@ class _ServiceViewState extends State<ServiceView> {
),
);
} else {
if (type == 'professional') {
if (widget.type == 'professional') {
if (service.status == ServiceStatus.pending) {
return Column(
children: [
@@ -853,7 +853,7 @@ class _ServiceViewState extends State<ServiceView> {
}
}
if (type == 'user') {
if (widget.type == 'user') {
if (service.status == ServiceStatus.pending) {
return ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 130),
@@ -931,10 +931,10 @@ class _ServiceViewState extends State<ServiceView> {
constraints: const BoxConstraints(maxWidth: 130),
child: ElevatedButton(
onPressed: () {
if (type == 'professional') {
if (widget.type == 'professional') {
navigateTo(Flurorouter.professionalServicesRequestsRoute);
}
if (type == 'user') {
if (widget.type == 'user') {
navigateTo(Flurorouter.dashboardRoute);
}
},
@@ -953,13 +953,13 @@ class _ServiceViewState extends State<ServiceView> {
}
String _CustomServiceLocation(ServiceLocationPreferences location) {
if (type == 'user') {
if (widget.type == 'user') {
if (location == ServiceLocationPreferences.office) {
return 'Servicio en sitio / consultorio';
}
}
if (type == 'professional') {
if (widget.type == 'professional') {
if (location == ServiceLocationPreferences.office) {
return 'Servicio en tu consultorio';
}