Refactor StoreBloc to Cubit and Fix Staff Assignment UI (#1)
Convertito StoreBloc in StoreCubit per coerenza con il resto del progetto. Sistemata la logica di assegnazione dipendenti nel modal dei negozi. Utilizzato il doppio BlocBuilder per garantire la reattività tra StaffCubit e StoreCubit. Reviewed-on: http://catelliub.zapto.org:3000/brontomark/flux/pulls/1 Co-authored-by: Mark M2 Macbook <marco@catelli.it> Co-committed-by: Mark M2 Macbook <marco@catelli.it>
This commit is contained in:
@@ -5,7 +5,7 @@ import 'package:flux/core/theme/theme.dart';
|
||||
import 'package:flux/core/widgets/flux_text_field.dart';
|
||||
import 'package:flux/features/master_data/staff/blocs/staff_cubit.dart'; // Tuo percorso
|
||||
import 'package:flux/features/master_data/staff/models/staff_member_model.dart';
|
||||
import 'package:flux/features/master_data/store/bloc/store_bloc.dart';
|
||||
import 'package:flux/features/master_data/store/bloc/store_cubit.dart';
|
||||
|
||||
class StaffScreen extends StatefulWidget {
|
||||
const StaffScreen({super.key});
|
||||
@@ -94,7 +94,7 @@ class _StaffScreenState extends State<StaffScreen> {
|
||||
}
|
||||
|
||||
Widget _buildStoreSelector() {
|
||||
return BlocBuilder<StoreBloc, StoreState>(
|
||||
return BlocBuilder<StoreCubit, StoreState>(
|
||||
// Assumendo tu abbia uno StoreCubit
|
||||
builder: (context, state) {
|
||||
return Padding(
|
||||
@@ -222,7 +222,7 @@ class _StaffScreenState extends State<StaffScreen> {
|
||||
|
||||
// --- SELETTORE NEGOZI (CHIPS) ---
|
||||
// Qui usiamo il BlocBuilder per i negozi, ma il setModalState per il refresh
|
||||
BlocBuilder<StoreBloc, StoreState>(
|
||||
BlocBuilder<StoreCubit, StoreState>(
|
||||
builder: (context, storeState) {
|
||||
if (storeState.status == StoreStatus.loading) {
|
||||
return const CircularProgressIndicator();
|
||||
|
||||
Reference in New Issue
Block a user