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(
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16),
side: BorderSide(color: theme.dividerColor.withValues(alpha: 0.5)),
borderRadius: BorderRadius.circular(12),
side: BorderSide(color: theme.dividerColor.withValues(alpha: 0.3)),
),
child: InkWell(
onTap: () => context.pushNamed(Routes.operations),
child: Padding(
padding: const EdgeInsets.all(16.0),
padding: const EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
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/notes/data/notes_repository.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:go_router/go_router.dart';
@@ -73,13 +74,7 @@ class HomeScreen extends StatelessWidget {
color: Colors.orange,
context: context,
),
_buildDashboardWidget(
title: context.l10n.commonStickyNotes,
icon: Icons.sticky_note_2_outlined,
color: Colors.yellow.shade700,
context: context,
onTap: () => context.pushNamed(Routes.notes),
),
DashboardNotesWidget(),
_buildDashboardWidget(
title: context.l10n.homeMyTasks,
icon: Icons.check_box_outlined,

View File

@@ -1,5 +1,7 @@
import 'package:flutter/material.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/models/note_model.dart';
import 'package:go_router/go_router.dart'; // Supponendo tu usi GoRouter per la navigazione
@@ -9,25 +11,48 @@ class DashboardNotesWidget extends StatelessWidget {
@override
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,
children: [
// Intestazione del riquadro
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
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(
'Le mie Note',
style: Theme.of(
context,
).textTheme.titleLarge?.copyWith(fontWeight: FontWeight.bold),
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 16,
color: context.primaryText,
),
TextButton(
onPressed: () {
// Vai alla bacheca completa
context.push('/notes');
},
child: const Text('Vedi tutte'),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
],
),
@@ -36,7 +61,8 @@ class DashboardNotesWidget extends StatelessWidget {
// Il corpo del widget collegato al Bloc
BlocBuilder<NotesBloc, NotesState>(
builder: (context, state) {
if (state.status == NotesStatus.loading && state.notes.isEmpty) {
if (state.status == NotesStatus.loading &&
state.notes.isEmpty) {
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:flux/core/blocs/session/session_cubit.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/notes/blocs/notes_bloc.dart';
import 'package:flux/features/notes/models/note_model.dart';
@@ -382,7 +380,7 @@ class _NoteFormScreenState extends State<NoteFormScreen> {
),
),
value: _isSharedAll,
activeColor: Colors.black87,
activeThumbColor: Colors.black87,
contentPadding: EdgeInsets.zero,
onChanged: (val) {
setState(() {