This commit is contained in:
2026-05-23 11:08:39 +02:00
parent 361b61a694
commit 7a11e829b3
4 changed files with 86 additions and 64 deletions

View File

@@ -45,13 +45,13 @@ class _LatestOperationsCardContent extends StatelessWidget {
return Card( return Card(
elevation: 0, elevation: 0,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(12),
side: BorderSide(color: theme.dividerColor.withValues(alpha: 0.5)), side: BorderSide(color: theme.dividerColor.withValues(alpha: 0.3)),
), ),
child: InkWell( child: InkWell(
onTap: () => context.pushNamed(Routes.operations), onTap: () => context.pushNamed(Routes.operations),
child: Padding( child: Padding(
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(12.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [

View File

@@ -12,6 +12,7 @@ import 'package:flux/features/master_data/staff/blocs/staff_cubit.dart';
import 'package:flux/features/master_data/staff/models/staff_member_model.dart'; import 'package:flux/features/master_data/staff/models/staff_member_model.dart';
import 'package:flux/features/notes/data/notes_repository.dart'; import 'package:flux/features/notes/data/notes_repository.dart';
import 'package:flux/features/notes/models/note_model.dart'; import 'package:flux/features/notes/models/note_model.dart';
import 'package:flux/features/notes/ui/dashboard_notes_widget.dart';
import 'package:get_it/get_it.dart'; import 'package:get_it/get_it.dart';
import 'package:go_router/go_router.dart'; import 'package:go_router/go_router.dart';
@@ -73,13 +74,7 @@ class HomeScreen extends StatelessWidget {
color: Colors.orange, color: Colors.orange,
context: context, context: context,
), ),
_buildDashboardWidget( DashboardNotesWidget(),
title: context.l10n.commonStickyNotes,
icon: Icons.sticky_note_2_outlined,
color: Colors.yellow.shade700,
context: context,
onTap: () => context.pushNamed(Routes.notes),
),
_buildDashboardWidget( _buildDashboardWidget(
title: context.l10n.homeMyTasks, title: context.l10n.homeMyTasks,
icon: Icons.check_box_outlined, icon: Icons.check_box_outlined,

View File

@@ -1,5 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flux/core/routes/routes.dart';
import 'package:flux/core/theme/theme.dart';
import 'package:flux/features/notes/blocs/notes_bloc.dart'; import 'package:flux/features/notes/blocs/notes_bloc.dart';
import 'package:flux/features/notes/models/note_model.dart'; import 'package:flux/features/notes/models/note_model.dart';
import 'package:go_router/go_router.dart'; // Supponendo tu usi GoRouter per la navigazione import 'package:go_router/go_router.dart'; // Supponendo tu usi GoRouter per la navigazione
@@ -9,25 +11,48 @@ class DashboardNotesWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Column( return Card(
elevation: 0,
clipBehavior: Clip.antiAlias,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
side: BorderSide(
color: Theme.of(context).dividerColor.withValues(alpha: 0.3),
style: BorderStyle.solid,
),
),
child: InkWell(
onTap: () => context.pushNamed(Routes.notes),
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
// Intestazione del riquadro // Intestazione del riquadro
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Container(
padding: const EdgeInsets.all(8),
decoration: BoxDecoration(
color: Colors.yellow.shade700.withValues(alpha: 0.1),
borderRadius: BorderRadius.circular(8),
),
child: Icon(
Icons.sticky_note_2_outlined,
size: 16,
color: Colors.yellow.shade700,
),
),
const SizedBox(width: 12),
Text( Text(
'Le mie Note', 'Le mie Note',
style: Theme.of( style: TextStyle(
context, fontWeight: FontWeight.bold,
).textTheme.titleLarge?.copyWith(fontWeight: FontWeight.bold), fontSize: 16,
color: context.primaryText,
), ),
TextButton( maxLines: 1,
onPressed: () { overflow: TextOverflow.ellipsis,
// Vai alla bacheca completa
context.push('/notes');
},
child: const Text('Vedi tutte'),
), ),
], ],
), ),
@@ -36,7 +61,8 @@ class DashboardNotesWidget extends StatelessWidget {
// Il corpo del widget collegato al Bloc // Il corpo del widget collegato al Bloc
BlocBuilder<NotesBloc, NotesState>( BlocBuilder<NotesBloc, NotesState>(
builder: (context, state) { builder: (context, state) {
if (state.status == NotesStatus.loading && state.notes.isEmpty) { if (state.status == NotesStatus.loading &&
state.notes.isEmpty) {
return const Center(child: CircularProgressIndicator()); return const Center(child: CircularProgressIndicator());
} }
@@ -69,6 +95,9 @@ class DashboardNotesWidget extends StatelessWidget {
}, },
), ),
], ],
),
),
),
); );
} }

View File

@@ -2,8 +2,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flux/core/blocs/session/session_cubit.dart'; import 'package:flux/core/blocs/session/session_cubit.dart';
import 'package:flux/core/utils/debouncer.dart'; import 'package:flux/core/utils/debouncer.dart';
import 'package:flux/core/widgets/shared_forms/attachments_section.dart';
import 'package:flux/features/attachments/blocs/attachments_bloc.dart';
import 'package:flux/features/master_data/staff/blocs/staff_cubit.dart'; import 'package:flux/features/master_data/staff/blocs/staff_cubit.dart';
import 'package:flux/features/notes/blocs/notes_bloc.dart'; import 'package:flux/features/notes/blocs/notes_bloc.dart';
import 'package:flux/features/notes/models/note_model.dart'; import 'package:flux/features/notes/models/note_model.dart';
@@ -382,7 +380,7 @@ class _NoteFormScreenState extends State<NoteFormScreen> {
), ),
), ),
value: _isSharedAll, value: _isSharedAll,
activeColor: Colors.black87, activeThumbColor: Colors.black87,
contentPadding: EdgeInsets.zero, contentPadding: EdgeInsets.zero,
onChanged: (val) { onChanged: (val) {
setState(() { setState(() {