change routes with names
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flux/core/blocs/session/session_cubit.dart';
|
||||
import 'package:flux/core/routes/app_router.dart';
|
||||
import 'package:flux/core/theme/theme.dart';
|
||||
import 'package:flux/core/utils/extensions.dart';
|
||||
import 'package:flux/features/home/latest_store_operations/bloc/latest_store_operations_bloc.dart';
|
||||
@@ -48,7 +49,7 @@ class _LatestOperationsCardContent extends StatelessWidget {
|
||||
side: BorderSide(color: theme.dividerColor.withValues(alpha: 0.5)),
|
||||
),
|
||||
child: InkWell(
|
||||
onTap: () => context.push('/operations'),
|
||||
onTap: () => context.pushNamed(operationsRoute),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Column(
|
||||
@@ -134,8 +135,9 @@ class _LatestOperationsCardContent extends StatelessWidget {
|
||||
itemBuilder: (context, index) {
|
||||
final operation = state.operations[index];
|
||||
return InkWell(
|
||||
onTap: () => context.push(
|
||||
'/operations/form/id=${operation.id}',
|
||||
onTap: () => context.pushNamed(
|
||||
operationFormRoute,
|
||||
pathParameters: {'id': operation.id!},
|
||||
extra: operation,
|
||||
),
|
||||
child: Padding(
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flux/core/blocs/session/session_cubit.dart';
|
||||
import 'package:flux/core/routes/app_router.dart';
|
||||
import 'package:flux/core/theme/theme.dart';
|
||||
import 'package:flux/core/utils/extensions.dart';
|
||||
import 'package:flux/features/home/latest_store_operations/ui/latest_store_operations_card.dart';
|
||||
@@ -83,7 +84,7 @@ class HomeScreen extends StatelessWidget {
|
||||
color: Colors.purple,
|
||||
context: context,
|
||||
onTap: () =>
|
||||
context.push('/tickets'), // <-- Aggiunto!
|
||||
context.pushNamed(ticketsRoute), // <-- Aggiunto!
|
||||
),
|
||||
]),
|
||||
),
|
||||
@@ -186,7 +187,10 @@ class HomeScreen extends StatelessWidget {
|
||||
color: Colors.blue,
|
||||
onTap: () {
|
||||
// Entriamo nel form! Nessun parametro extra = Nuovo Servizio
|
||||
context.push('/operations/form/new');
|
||||
context.pushNamed(
|
||||
operationFormRoute,
|
||||
pathParameters: {'id': 'New'},
|
||||
);
|
||||
},
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
@@ -196,7 +200,7 @@ class HomeScreen extends StatelessWidget {
|
||||
color: Colors.redAccent,
|
||||
onTap: () {
|
||||
// Andiamo alla lista! (Da lì poi aggiungeremo il tasto "+" per il form)
|
||||
context.push('/tickets/form/new');
|
||||
context.pushNamed(ticketFormRoute, pathParameters: {'id': 'New'});
|
||||
},
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
|
||||
Reference in New Issue
Block a user