Atualização tela semanal |Adicoinar item com imagem
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:supabase_flutter/supabase_flutter.dart';
|
||||
import 'perfil_screen.dart';
|
||||
import 'add_item_screen.dart';
|
||||
import 'item_screen.dart';
|
||||
import 'week_screen.dart';
|
||||
import '../constants/item_categories.dart';
|
||||
|
||||
class HomeScreen extends StatefulWidget {
|
||||
@@ -34,7 +36,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
backgroundColor: Colors.white,
|
||||
type: BottomNavigationBarType.fixed,
|
||||
items: const [
|
||||
BottomNavigationBarItem(icon: Icon(Icons.home), label: 'Início'),
|
||||
BottomNavigationBarItem(icon: Icon(Icons.home), label: 'InÃcio'),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.inventory_2_outlined),
|
||||
label: 'Itens',
|
||||
@@ -62,28 +64,80 @@ class _HomeContent extends StatefulWidget {
|
||||
|
||||
class _HomeContentState extends State<_HomeContent> {
|
||||
int _itemCount = 0;
|
||||
List<Map<String, dynamic>> _todayItems = [];
|
||||
List<Map<String, dynamic>> _recentItems = [];
|
||||
bool _isLoading = true;
|
||||
|
||||
static const _weekdayLong = [
|
||||
'Segunda',
|
||||
'Terça',
|
||||
'Quarta',
|
||||
'Quinta',
|
||||
'Sexta',
|
||||
'Sábado',
|
||||
'Domingo',
|
||||
];
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_loadItemCount();
|
||||
_loadData();
|
||||
}
|
||||
|
||||
Future<void> _loadItemCount() async {
|
||||
String _dateKey(DateTime d) =>
|
||||
'${d.year.toString().padLeft(4, '0')}-'
|
||||
'${d.month.toString().padLeft(2, '0')}-'
|
||||
'${d.day.toString().padLeft(2, '0')}';
|
||||
|
||||
Future<void> _loadData() async {
|
||||
setState(() => _isLoading = true);
|
||||
try {
|
||||
final user = Supabase.instance.client.auth.currentUser;
|
||||
if (user != null) {
|
||||
final response = await Supabase.instance.client
|
||||
.from('items')
|
||||
.select('id')
|
||||
.eq('user_id', user.id);
|
||||
if (user == null) return;
|
||||
|
||||
setState(() {
|
||||
_itemCount = response.length;
|
||||
});
|
||||
// total item count
|
||||
final all = await Supabase.instance.client
|
||||
.from('items')
|
||||
.select('id')
|
||||
.eq('user_id', user.id);
|
||||
|
||||
// recent 5 items
|
||||
final recent = await Supabase.instance.client
|
||||
.from('items')
|
||||
.select('*, item_images(image_url)')
|
||||
.eq('user_id', user.id)
|
||||
.order('id', ascending: false)
|
||||
.limit(5);
|
||||
|
||||
// today's plan
|
||||
final today = DateTime.now();
|
||||
final plan = await Supabase.instance.client
|
||||
.from('plans')
|
||||
.select('plan_items(items(*, item_images(image_url)))')
|
||||
.eq('user_id', user.id)
|
||||
.eq('data', _dateKey(today))
|
||||
.maybeSingle();
|
||||
|
||||
List<Map<String, dynamic>> todayItems = [];
|
||||
if (plan != null) {
|
||||
final planItems = plan['plan_items'] as List? ?? [];
|
||||
todayItems = planItems
|
||||
.where((pi) => pi['items'] != null)
|
||||
.map<Map<String, dynamic>>(
|
||||
(pi) => Map<String, dynamic>.from(pi['items']),
|
||||
)
|
||||
.toList();
|
||||
}
|
||||
|
||||
setState(() {
|
||||
_itemCount = all.length;
|
||||
_recentItems = List<Map<String, dynamic>>.from(recent);
|
||||
_todayItems = todayItems;
|
||||
_isLoading = false;
|
||||
});
|
||||
} catch (e) {
|
||||
print('Error loading item count: $e');
|
||||
print('Error loading home: $e');
|
||||
setState(() => _isLoading = false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,7 +187,7 @@ class _HomeContentState extends State<_HomeContent> {
|
||||
onPressed: () {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text('Notificações'),
|
||||
content: Text('Notificações'),
|
||||
backgroundColor: Color(0xFF0066CC),
|
||||
),
|
||||
);
|
||||
@@ -144,138 +198,28 @@ class _HomeContentState extends State<_HomeContent> {
|
||||
),
|
||||
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(20),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// Today Section
|
||||
Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Text(
|
||||
'Hoje - Sexta',
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Color(0xFF0066CC),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
const Text(
|
||||
'2 itens planejados',
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Color(0xFF666666),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
// Placeholder for planned items
|
||||
Container(
|
||||
height: 80,
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFF5F5F5),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: const Center(
|
||||
child: Text(
|
||||
'Itens planejados aparecerão aqui',
|
||||
style: TextStyle(color: Color(0xFF999999)),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
const SizedBox(height: 24),
|
||||
|
||||
// AI Recommendations Button
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.all(20),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFF0066CC),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Text(
|
||||
'Recomendações IA',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
const Text(
|
||||
'Descubra o que levar',
|
||||
style: TextStyle(
|
||||
color: Colors.white70,
|
||||
fontSize: 14,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Row(
|
||||
children: [
|
||||
const Icon(
|
||||
Icons.auto_awesome,
|
||||
color: Colors.white,
|
||||
size: 20,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: 4,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white30,
|
||||
borderRadius: BorderRadius.circular(2),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
const SizedBox(height: 24),
|
||||
|
||||
// Recent Items Section
|
||||
const Text(
|
||||
'Itens Recentes',
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Color(0xFF333333),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// Placeholder for recent items
|
||||
Container(
|
||||
height: 100,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
border: Border.all(color: const Color(0xFFE0E0E0)),
|
||||
),
|
||||
child: const Center(
|
||||
child: Text(
|
||||
'Itens recentes aparecerão aqui',
|
||||
style: TextStyle(color: Color(0xFF999999)),
|
||||
child: RefreshIndicator(
|
||||
onRefresh: _loadData,
|
||||
child: SingleChildScrollView(
|
||||
physics: const AlwaysScrollableScrollPhysics(),
|
||||
padding: const EdgeInsets.all(20),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
_buildTodaySection(),
|
||||
const SizedBox(height: 24),
|
||||
const Text(
|
||||
'Itens Recentes',
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Color(0xFF333333),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
const SizedBox(height: 12),
|
||||
_buildRecentItems(),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -288,9 +232,11 @@ class _HomeContentState extends State<_HomeContent> {
|
||||
right: 20,
|
||||
child: FloatingActionButton(
|
||||
onPressed: () {
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(builder: (_) => const AddItemScreen()),
|
||||
);
|
||||
Navigator.of(context)
|
||||
.push(
|
||||
MaterialPageRoute(builder: (_) => const AddItemScreen()),
|
||||
)
|
||||
.then((_) => _loadData());
|
||||
},
|
||||
backgroundColor: const Color(0xFF0066CC),
|
||||
child: const Icon(Icons.add, color: Colors.white),
|
||||
@@ -300,232 +246,231 @@ class _HomeContentState extends State<_HomeContent> {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildTodaySection() {
|
||||
final today = DateTime.now();
|
||||
final dayName = _weekdayLong[today.weekday - 1];
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'Hoje - $dayName',
|
||||
style: const TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Color(0xFF0066CC),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'${today.day}/${today.month}',
|
||||
style: const TextStyle(fontSize: 14, color: Color(0xFF666666)),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
Text(
|
||||
'${_todayItems.length} ${_todayItems.length == 1 ? "item planejado" : "itens planejados"}',
|
||||
style: const TextStyle(fontSize: 14, color: Color(0xFF666666)),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
if (_isLoading)
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 16),
|
||||
child: Center(child: CircularProgressIndicator()),
|
||||
)
|
||||
else if (_todayItems.isEmpty)
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(vertical: 20),
|
||||
alignment: Alignment.center,
|
||||
child: const Text(
|
||||
'Nada planejado para hoje',
|
||||
style: TextStyle(color: Color(0xFF999999)),
|
||||
),
|
||||
)
|
||||
else
|
||||
SizedBox(
|
||||
height: 90,
|
||||
child: ListView.builder(
|
||||
scrollDirection: Axis.horizontal,
|
||||
itemCount: _todayItems.length,
|
||||
itemBuilder: (_, i) => _buildTodayChip(_todayItems[i]),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildTodayChip(Map<String, dynamic> item) {
|
||||
final images = item['item_images'] as List?;
|
||||
final imageUrl = (images != null && images.isNotEmpty)
|
||||
? images.first['image_url']
|
||||
: null;
|
||||
final category = ITEM_CATEGORIES.firstWhere(
|
||||
(c) => c.id == item['categoria'],
|
||||
orElse: () => ITEM_CATEGORIES.last,
|
||||
);
|
||||
return Container(
|
||||
width: 80,
|
||||
margin: const EdgeInsets.only(right: 10),
|
||||
child: Column(
|
||||
children: [
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
child: imageUrl != null
|
||||
? Image.network(
|
||||
imageUrl,
|
||||
width: 60,
|
||||
height: 60,
|
||||
fit: BoxFit.cover,
|
||||
errorBuilder: (_, __, ___) => _placeholder(category.icon),
|
||||
)
|
||||
: _placeholder(category.icon),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
item['nome'] ?? '',
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: const TextStyle(fontSize: 11, color: Color(0xFF333333)),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _placeholder(String icon) {
|
||||
return Container(
|
||||
width: 60,
|
||||
height: 60,
|
||||
color: const Color(0xFF0066CC).withOpacity(0.1),
|
||||
alignment: Alignment.center,
|
||||
child: Text(icon, style: const TextStyle(fontSize: 26)),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildRecentItems() {
|
||||
if (_isLoading) {
|
||||
return const SizedBox(
|
||||
height: 100,
|
||||
child: Center(child: CircularProgressIndicator()),
|
||||
);
|
||||
}
|
||||
if (_recentItems.isEmpty) {
|
||||
return Container(
|
||||
height: 100,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: const Center(
|
||||
child: Text(
|
||||
'Sem itens ainda',
|
||||
style: TextStyle(color: Color(0xFF999999)),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
return SizedBox(
|
||||
height: 130,
|
||||
child: ListView.builder(
|
||||
scrollDirection: Axis.horizontal,
|
||||
itemCount: _recentItems.length,
|
||||
itemBuilder: (_, i) {
|
||||
final item = _recentItems[i];
|
||||
final images = item['item_images'] as List?;
|
||||
final imageUrl = (images != null && images.isNotEmpty)
|
||||
? images.first['image_url']
|
||||
: null;
|
||||
final category = ITEM_CATEGORIES.firstWhere(
|
||||
(c) => c.id == item['categoria'],
|
||||
orElse: () => ITEM_CATEGORIES.last,
|
||||
);
|
||||
return Container(
|
||||
width: 110,
|
||||
margin: const EdgeInsets.only(right: 10),
|
||||
padding: const EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
child: imageUrl != null
|
||||
? Image.network(
|
||||
imageUrl,
|
||||
width: double.infinity,
|
||||
height: 70,
|
||||
fit: BoxFit.cover,
|
||||
errorBuilder: (_, __, ___) =>
|
||||
_placeholder(category.icon),
|
||||
)
|
||||
: Container(
|
||||
width: double.infinity,
|
||||
height: 70,
|
||||
color: const Color(0xFF0066CC).withOpacity(0.1),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
category.icon,
|
||||
style: const TextStyle(fontSize: 30),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
Text(
|
||||
item['nome'] ?? '',
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
category.name,
|
||||
style: const TextStyle(
|
||||
fontSize: 10,
|
||||
color: Color(0xFF666666),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _ItemsScreen extends StatefulWidget {
|
||||
class _ItemsScreen extends StatelessWidget {
|
||||
const _ItemsScreen();
|
||||
|
||||
@override
|
||||
State<_ItemsScreen> createState() => _ItemsScreenState();
|
||||
}
|
||||
|
||||
class _ItemsScreenState extends State<_ItemsScreen> {
|
||||
List<Map<String, dynamic>> _items = [];
|
||||
bool _isLoading = true;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_loadItems();
|
||||
}
|
||||
|
||||
Future<void> _loadItems() async {
|
||||
try {
|
||||
final user = Supabase.instance.client.auth.currentUser;
|
||||
if (user != null) {
|
||||
final response = await Supabase.instance.client
|
||||
.from('items')
|
||||
.select()
|
||||
.eq('user_id', user.id)
|
||||
.order('created_at', ascending: false);
|
||||
|
||||
setState(() {
|
||||
_items = List<Map<String, dynamic>>.from(response);
|
||||
_isLoading = false;
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
print('Error loading items: $e');
|
||||
setState(() => _isLoading = false);
|
||||
}
|
||||
}
|
||||
|
||||
String _getCategoryName(String categoryId) {
|
||||
final category = ITEM_CATEGORIES.firstWhere(
|
||||
(cat) => cat.id == categoryId,
|
||||
orElse: () => ITEM_CATEGORIES.last,
|
||||
);
|
||||
return category.name;
|
||||
}
|
||||
|
||||
String _getCategoryIcon(String categoryId) {
|
||||
final category = ITEM_CATEGORIES.firstWhere(
|
||||
(cat) => cat.id == categoryId,
|
||||
orElse: () => ITEM_CATEGORIES.last,
|
||||
);
|
||||
return category.icon;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: const Color(0xFFFFE5CC),
|
||||
appBar: AppBar(
|
||||
backgroundColor: const Color(0xFF0066CC),
|
||||
elevation: 0,
|
||||
title: const Text(
|
||||
'Meus Itens',
|
||||
style: TextStyle(color: Colors.white, fontSize: 20),
|
||||
),
|
||||
centerTitle: true,
|
||||
),
|
||||
body: _isLoading
|
||||
? const Center(child: CircularProgressIndicator())
|
||||
: _items.isEmpty
|
||||
? Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(
|
||||
Icons.inventory_2_outlined,
|
||||
size: 64,
|
||||
color: Colors.grey[400],
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
const Text(
|
||||
'Nenhum item ainda',
|
||||
style: TextStyle(fontSize: 18, color: Color(0xFF666666)),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
const Text(
|
||||
'Toque no + para adicionar',
|
||||
style: TextStyle(fontSize: 14, color: Color(0xFF999999)),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
: ListView.builder(
|
||||
padding: const EdgeInsets.all(16),
|
||||
itemCount: _items.length,
|
||||
itemBuilder: (context, index) {
|
||||
final item = _items[index];
|
||||
final categoryName = _getCategoryName(item['category_id']);
|
||||
final categoryIcon = _getCategoryIcon(item['category_id']);
|
||||
final tags = List<String>.from(item['context_tags'] ?? []);
|
||||
|
||||
return Card(
|
||||
margin: const EdgeInsets.only(bottom: 12),
|
||||
elevation: 2,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 48,
|
||||
height: 48,
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFF0066CC).withOpacity(0.1),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
categoryIcon,
|
||||
style: const TextStyle(fontSize: 24),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
item['name'] ?? 'Sem nome',
|
||||
style: const TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Color(0xFF333333),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
categoryName,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
color: Color(0xFF666666),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
if (item['description'] != null &&
|
||||
item['description'].toString().isNotEmpty) ...[
|
||||
const SizedBox(height: 12),
|
||||
Text(
|
||||
item['description'],
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
color: Color(0xFF666666),
|
||||
),
|
||||
),
|
||||
],
|
||||
if (tags.isNotEmpty) ...[
|
||||
const SizedBox(height: 12),
|
||||
Wrap(
|
||||
spacing: 8,
|
||||
runSpacing: 8,
|
||||
children: tags.map((tag) {
|
||||
final contextTag = CONTEXT_TAGS.firstWhere(
|
||||
(t) => t.id == tag,
|
||||
orElse: () => CONTEXT_TAGS.first,
|
||||
);
|
||||
return Chip(
|
||||
label: Text(contextTag.name),
|
||||
backgroundColor: const Color(
|
||||
0xFF0066CC,
|
||||
).withOpacity(0.1),
|
||||
labelStyle: const TextStyle(
|
||||
color: Color(0xFF0066CC),
|
||||
fontSize: 12,
|
||||
),
|
||||
padding: EdgeInsets.zero,
|
||||
materialTapTargetSize:
|
||||
MaterialTapTargetSize.shrinkWrap,
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: () {
|
||||
Navigator.of(context)
|
||||
.push(MaterialPageRoute(builder: (_) => const AddItemScreen()))
|
||||
.then((_) => _loadItems());
|
||||
},
|
||||
backgroundColor: const Color(0xFF0066CC),
|
||||
child: const Icon(Icons.add, color: Colors.white),
|
||||
),
|
||||
);
|
||||
}
|
||||
Widget build(BuildContext context) => const ItemScreen();
|
||||
}
|
||||
|
||||
class _WeekScreen extends StatelessWidget {
|
||||
const _WeekScreen();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Center(child: Text('Semana'));
|
||||
}
|
||||
Widget build(BuildContext context) => const WeekScreen();
|
||||
}
|
||||
|
||||
class _ProfileScreen extends StatelessWidget {
|
||||
const _ProfileScreen();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const PerfilScreen();
|
||||
}
|
||||
Widget build(BuildContext context) => const PerfilScreen();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user