customers
This commit is contained in:
@@ -6,16 +6,22 @@ class FluxTextField extends StatelessWidget {
|
|||||||
final String label;
|
final String label;
|
||||||
final IconData icon;
|
final IconData icon;
|
||||||
final bool isPassword;
|
final bool isPassword;
|
||||||
|
final bool autoFocus;
|
||||||
final TextEditingController? controller;
|
final TextEditingController? controller;
|
||||||
final TextInputType? keyboardType; // Aggiunto per flessibilità
|
final TextInputType? keyboardType; // Aggiunto per flessibilità
|
||||||
|
final int? minLines;
|
||||||
|
final int? maxLines;
|
||||||
|
|
||||||
const FluxTextField({
|
const FluxTextField({
|
||||||
super.key, // Usiamo super.key per Flutter moderno
|
super.key, // Usiamo super.key per Flutter moderno
|
||||||
required this.label,
|
required this.label,
|
||||||
required this.icon,
|
required this.icon,
|
||||||
this.isPassword = false,
|
this.isPassword = false,
|
||||||
|
this.autoFocus = false,
|
||||||
this.controller,
|
this.controller,
|
||||||
this.keyboardType,
|
this.keyboardType,
|
||||||
|
this.minLines,
|
||||||
|
this.maxLines = 1,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -24,6 +30,10 @@ class FluxTextField extends StatelessWidget {
|
|||||||
controller: controller,
|
controller: controller,
|
||||||
obscureText: isPassword,
|
obscureText: isPassword,
|
||||||
keyboardType: keyboardType,
|
keyboardType: keyboardType,
|
||||||
|
autofocus: autoFocus,
|
||||||
|
minLines: minLines,
|
||||||
|
// Se minLines è impostato, maxLines deve essere almeno uguale o null (espandibile)
|
||||||
|
maxLines: minLines != null ? null : maxLines,
|
||||||
style: TextStyle(color: context.primaryText),
|
style: TextStyle(color: context.primaryText),
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
prefixIcon: Icon(icon, color: context.accent.withValues(alpha: 0.6)),
|
prefixIcon: Icon(icon, color: context.accent.withValues(alpha: 0.6)),
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ class _CustomerFormState extends State<CustomerForm> {
|
|||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
FluxTextField(
|
FluxTextField(
|
||||||
label: 'Nome Completo',
|
label: 'Nome Completo',
|
||||||
|
autoFocus: true,
|
||||||
icon: Icons.person_outline,
|
icon: Icons.person_outline,
|
||||||
controller: _nomeController,
|
controller: _nomeController,
|
||||||
),
|
),
|
||||||
@@ -112,6 +113,7 @@ class _CustomerFormState extends State<CustomerForm> {
|
|||||||
label: 'Note',
|
label: 'Note',
|
||||||
icon: Icons.notes_outlined,
|
icon: Icons.notes_outlined,
|
||||||
controller: _noteController,
|
controller: _noteController,
|
||||||
|
minLines: 3,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
SwitchListTile(
|
SwitchListTile(
|
||||||
|
|||||||
@@ -5,7 +5,13 @@ import 'package:flux/core/theme/theme.dart';
|
|||||||
|
|
||||||
class DashboardContent extends StatelessWidget {
|
class DashboardContent extends StatelessWidget {
|
||||||
final bool isLargeScreen;
|
final bool isLargeScreen;
|
||||||
const DashboardContent({super.key, this.isLargeScreen = false});
|
final Function(int)? onTabRequested;
|
||||||
|
|
||||||
|
const DashboardContent({
|
||||||
|
super.key,
|
||||||
|
this.isLargeScreen = false,
|
||||||
|
this.onTabRequested,
|
||||||
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -109,7 +115,7 @@ class DashboardContent extends StatelessWidget {
|
|||||||
label: 'Clienti',
|
label: 'Clienti',
|
||||||
icon: Icons.people,
|
icon: Icons.people,
|
||||||
color: Colors.orange,
|
color: Colors.orange,
|
||||||
onTap: () {},
|
onTap: () => onTabRequested?.call(1),
|
||||||
),
|
),
|
||||||
_ActionCard(
|
_ActionCard(
|
||||||
label: 'Campagne',
|
label: 'Campagne',
|
||||||
|
|||||||
@@ -119,7 +119,15 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
Widget _buildPageContent(int index, bool isLargeScreen) {
|
Widget _buildPageContent(int index, bool isLargeScreen) {
|
||||||
switch (index) {
|
switch (index) {
|
||||||
case 0:
|
case 0:
|
||||||
return DashboardContent(isLargeScreen: isLargeScreen);
|
return DashboardContent(
|
||||||
|
isLargeScreen: isLargeScreen,
|
||||||
|
// Questo pezzo DEVE puntare al setState dello State della HomeScreen
|
||||||
|
onTabRequested: (targetIndex) {
|
||||||
|
setState(() {
|
||||||
|
_selectedIndex = targetIndex;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
);
|
||||||
case 1:
|
case 1:
|
||||||
return const CustomersContent();
|
return const CustomersContent();
|
||||||
case 2:
|
case 2:
|
||||||
|
|||||||
Reference in New Issue
Block a user