ui iniziale fatta con gemini
This commit is contained in:
44
lib/ui/anagrafiche/anagrafiche_main_view.dart
Normal file
44
lib/ui/anagrafiche/anagrafiche_main_view.dart
Normal file
@@ -0,0 +1,44 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flux/theme.dart';
|
||||
|
||||
class AnagraficheMainView extends StatelessWidget {
|
||||
const AnagraficheMainView({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// Controller locale per gestire i Tab
|
||||
return DefaultTabController(
|
||||
length: 4,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Anagrafiche'),
|
||||
bottom: TabBar(
|
||||
isScrollable: true,
|
||||
indicatorColor: FluxColors.accentTurquoise,
|
||||
labelColor: FluxColors.accentTurquoise,
|
||||
unselectedLabelColor: FluxColors.textSecondary,
|
||||
tabs: [
|
||||
Tab(icon: Icon(Icons.storefront), text: 'Negozi'),
|
||||
Tab(icon: Icon(Icons.support_agent), text: 'Gestori'),
|
||||
Tab(icon: Icon(Icons.assignment_ind), text: 'Clienti'),
|
||||
Tab(icon: Icon(Icons.phone_android), text: 'Prodotti'),
|
||||
],
|
||||
),
|
||||
),
|
||||
body: const TabBarView(
|
||||
children: [
|
||||
// Esempi di view iniettate con Bloc dedicati (da implementare)
|
||||
/* ElencoEntitaView(tipoEntita: 'Negozi'), // Provider<AnagraficaBloc>...
|
||||
ElencoEntitaView(tipoEntita: 'Gestori'),
|
||||
ElencoEntitaView(tipoEntita: 'Clienti'),
|
||||
ElencoEntitaView(tipoEntita: 'Prodotti'), */
|
||||
Placeholder(),
|
||||
Placeholder(),
|
||||
Placeholder(),
|
||||
Placeholder(),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
117
lib/ui/dashboard/dashboard_view.dart
Normal file
117
lib/ui/dashboard/dashboard_view.dart
Normal file
@@ -0,0 +1,117 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flux/theme.dart';
|
||||
|
||||
class DashboardView extends StatelessWidget {
|
||||
const DashboardView({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// Iniezione del Bloc per la creazione di operazioni (da implementare)
|
||||
return /* BlocProvider(
|
||||
create: (context) => OperazioneBloc(), // Implementa la logica nel Bloc
|
||||
child: */ Scaffold(
|
||||
appBar: AppBar(title: Text('FLUX')),
|
||||
body: SingleChildScrollView(
|
||||
padding: EdgeInsets.all(16.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
_WelcomeHeader(),
|
||||
SizedBox(height: 24),
|
||||
_QuickActions(), // Contiene "Nuova Operazione"
|
||||
SizedBox(height: 24),
|
||||
_RecentActivityPreview(),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
// );
|
||||
}
|
||||
}
|
||||
|
||||
class _WelcomeHeader extends StatelessWidget {
|
||||
const _WelcomeHeader();
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('Benvenuto,', style: Theme.of(context).textTheme.bodyMedium),
|
||||
Text(
|
||||
'Negozio Piacenza Centro',
|
||||
style: Theme.of(context).textTheme.headlineMedium,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _QuickActions extends StatelessWidget {
|
||||
const _QuickActions();
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'AZIONI RAPIDE',
|
||||
style: Theme.of(
|
||||
context,
|
||||
).textTheme.titleSmall?.copyWith(color: FluxColors.accentTurquoise),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
ElevatedButton.icon(
|
||||
onPressed: () {
|
||||
// Emetti evento al Bloc: BlocProvider.of<OperazioneBloc>(context).add(IniziaNuovaOperazione());
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text('Avvio Nuova Operazione...')),
|
||||
);
|
||||
},
|
||||
icon: const Icon(Icons.add),
|
||||
label: const Text('NUOVA OPERAZIONE TELCO'),
|
||||
style: ElevatedButton.styleFrom(
|
||||
minimumSize: const Size(double.infinity, 50),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _RecentActivityPreview extends StatelessWidget {
|
||||
const _RecentActivityPreview();
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Card(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Text(
|
||||
'Attività Recenti',
|
||||
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
|
||||
),
|
||||
const Divider(color: FluxColors.textSecondary),
|
||||
// Sostituire con BlocBuilder
|
||||
_activityTile('Nuova Linea', 'Mario Rossi', '10 min fa'),
|
||||
_activityTile('Assistenza Tech', 'iPhone 13', '45 min fa'),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _activityTile(String title, String subtitle, String time) {
|
||||
return ListTile(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
leading: const Icon(Icons.history, color: FluxColors.accentTurquoise),
|
||||
title: Text(title, style: const TextStyle(color: FluxColors.textPrimary)),
|
||||
subtitle: Text(subtitle),
|
||||
trailing: Text(
|
||||
time,
|
||||
style: const TextStyle(color: FluxColors.textSecondary, fontSize: 12),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
66
lib/ui/home_screen.dart
Normal file
66
lib/ui/home_screen.dart
Normal file
@@ -0,0 +1,66 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flux/theme.dart';
|
||||
import 'package:flux/ui/anagrafiche/anagrafiche_main_view.dart';
|
||||
import 'package:flux/ui/dashboard/dashboard_view.dart';
|
||||
import 'package:flux/ui/settings/settings_view.dart';
|
||||
|
||||
class HomeScreen extends StatefulWidget {
|
||||
const HomeScreen({super.key});
|
||||
|
||||
@override
|
||||
State<HomeScreen> createState() => _HomeScreenState();
|
||||
}
|
||||
|
||||
class _HomeScreenState extends State<HomeScreen> {
|
||||
int _selectedIndex = 0;
|
||||
|
||||
static const List<Widget> _widgetOptions = <Widget>[
|
||||
DashboardView(), // Contiene Nuova Operazione
|
||||
Placeholder(),
|
||||
AnagraficheMainView(), // Gestisce [negozi, gestori, clienti, prodotti]
|
||||
SettingsView(),
|
||||
];
|
||||
|
||||
void _onItemTapped(int index) {
|
||||
setState(() {
|
||||
_selectedIndex = index;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: Center(child: _widgetOptions.elementAt(_selectedIndex)),
|
||||
bottomNavigationBar: BottomNavigationBar(
|
||||
items: const <BottomNavigationBarItem>[
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.dashboard_outlined),
|
||||
activeIcon: Icon(Icons.dashboard),
|
||||
label: 'Dashboard',
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.history_edu_outlined),
|
||||
activeIcon: Icon(Icons.history_edu),
|
||||
label: 'Operazioni',
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.people_alt_outlined),
|
||||
activeIcon: Icon(Icons.people_alt),
|
||||
label: 'Anagrafiche',
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.settings_outlined),
|
||||
activeIcon: Icon(Icons.settings),
|
||||
label: 'Impostazioni',
|
||||
),
|
||||
],
|
||||
currentIndex: _selectedIndex,
|
||||
selectedItemColor: FluxColors.accentTurquoise,
|
||||
unselectedItemColor: FluxColors.textSecondary,
|
||||
backgroundColor: FluxColors.surface,
|
||||
type: BottomNavigationBarType.fixed,
|
||||
onTap: _onItemTapped,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
72
lib/ui/settings/settings_view.dart
Normal file
72
lib/ui/settings/settings_view.dart
Normal file
@@ -0,0 +1,72 @@
|
||||
// lib/ui/impostazioni/impostazioni_view.dart
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flux/theme.dart';
|
||||
|
||||
class SettingsView extends StatelessWidget {
|
||||
const SettingsView({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: const Text('Impostazioni')),
|
||||
body: ListView(
|
||||
padding: const EdgeInsets.all(16),
|
||||
children: [
|
||||
_settingsSection('Account', [
|
||||
_settingsTile(
|
||||
Icons.person,
|
||||
'Profilo Utente',
|
||||
'Configura i tuoi dati',
|
||||
),
|
||||
_settingsTile(Icons.store, 'Mio Negozio', 'Piacenza Centro'),
|
||||
]),
|
||||
const SizedBox(height: 16),
|
||||
_settingsSection('Applicazione', [
|
||||
_settingsTile(Icons.sync, 'Sincronizzazione', 'Ultima: 5 min fa'),
|
||||
_settingsTile(
|
||||
Icons.dark_mode,
|
||||
'Tema (FLUX Dark Active)',
|
||||
'Configurazione visiva',
|
||||
),
|
||||
]),
|
||||
const SizedBox(height: 24),
|
||||
TextButton.icon(
|
||||
onPressed: () {},
|
||||
icon: const Icon(Icons.exit_to_app, color: Colors.red),
|
||||
label: const Text('Logout', style: TextStyle(color: Colors.red)),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _settingsSection(String title, List<Widget> tiles) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
title.toUpperCase(),
|
||||
style: const TextStyle(
|
||||
color: FluxColors.accentTurquoise,
|
||||
fontWeight: FontWeight.bold,
|
||||
letterSpacing: 1,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Card(child: Column(children: tiles)),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _settingsTile(IconData icon, String title, String subtitle) {
|
||||
return ListTile(
|
||||
leading: Icon(icon, color: FluxColors.primaryBlue),
|
||||
title: Text(title, style: const TextStyle(color: FluxColors.textPrimary)),
|
||||
subtitle: Text(subtitle),
|
||||
trailing: const Icon(
|
||||
Icons.chevron_right,
|
||||
color: FluxColors.textSecondary,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user