pennellato git da rosso ad arancio e verde

This commit is contained in:
2026-04-21 11:26:42 +02:00
parent a19fd1104f
commit 09398a1b34
27 changed files with 237 additions and 389 deletions

View File

@@ -34,7 +34,7 @@ class _CreateStoreScreenState extends State<CreateStoreScreen> {
/// Funzione magica per copiare i dati dall'azienda salvata in GetIt
void _useCompanyAddress() {
final company = context.read<SessionBloc>().state.company;
final company = context.read<SessionCubit>().state.company;
if (company != null) {
setState(() {
_indirizzoController.text = company.indirizzo;
@@ -58,7 +58,7 @@ class _CreateStoreScreenState extends State<CreateStoreScreen> {
void _onSave() {
if (_formKey.currentState!.validate()) {
final company = context.read<SessionBloc>().state.company;
final company = context.read<SessionCubit>().state.company;
if (company == null) {
ScaffoldMessenger.of(context).showSnackBar(
@@ -69,7 +69,7 @@ class _CreateStoreScreenState extends State<CreateStoreScreen> {
final store = StoreModel(
nome: _nomeController.text.trim(),
companyId: company.id,
companyId: company.id!,
indirizzo: _indirizzoController.text.trim(),
cap: _capController.text.trim(),
comune: _comuneController.text.trim(),
@@ -84,10 +84,10 @@ class _CreateStoreScreenState extends State<CreateStoreScreen> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Il tuo primo Negozio')),
body: BlocConsumer<StoreCubit, StoreState>(
listener: (context, state) {
body: BlocBuilder<StoreCubit, StoreState>(
/* listener: (context, state) {
if (state.status == StoreStatus.success) {
context.read<SessionBloc>().add(AppStarted());
context.read<SessionCubit>().;
}
if (state.status == StoreStatus.failure) {
ScaffoldMessenger.of(context).showSnackBar(
@@ -96,7 +96,7 @@ class _CreateStoreScreenState extends State<CreateStoreScreen> {
),
);
}
},
}, */
builder: (context, state) {
return SafeArea(
child: SingleChildScrollView(

View File

@@ -130,10 +130,10 @@ class _StoreFormState extends State<StoreForm> {
comune: comuneController.text,
provincia: provinciaController.text,
companyId: context
.read<SessionBloc>()
.read<SessionCubit>()
.state
.company!
.id, // Recuperiamo la companyId
.id!, // Recuperiamo la companyId
isActive: widget.store?.isActive ?? true,
isPaid: widget.store?.isPaid ?? false,
paymentExpiration: widget.store?.paymentExpiration,