83 lines
2.8 KiB
Dart
83 lines
2.8 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'models/mini_app.dart';
|
|
|
|
class HomePage extends StatelessWidget {
|
|
const HomePage({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
title: const Text('Carteira Apps'),
|
|
centerTitle: true,
|
|
),
|
|
body: Padding(
|
|
padding: const EdgeInsets.all(12.0),
|
|
child: Column(
|
|
children: [
|
|
// Search bar
|
|
TextField(
|
|
decoration: InputDecoration(
|
|
hintText: 'Pesquisar apps...',
|
|
prefixIcon: const Icon(Icons.search),
|
|
border: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(12),
|
|
),
|
|
filled: true,
|
|
fillColor: Theme.of(context).colorScheme.surfaceContainerHighest,
|
|
),
|
|
),
|
|
const SizedBox(height: 16),
|
|
// Grid of mini apps
|
|
Expanded(
|
|
child: GridView.builder(
|
|
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
|
crossAxisCount: 2,
|
|
crossAxisSpacing: 12,
|
|
mainAxisSpacing: 12,
|
|
childAspectRatio: 0.9,
|
|
),
|
|
itemCount: miniApps.length,
|
|
itemBuilder: (context, index) {
|
|
final app = miniApps[index];
|
|
return Card(
|
|
elevation: 2,
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(16),
|
|
),
|
|
child: InkWell(
|
|
borderRadius: BorderRadius.circular(16),
|
|
onTap: () {
|
|
// TODO: navigate to actual mini app screen
|
|
ScaffoldMessenger.of(context).showSnackBar(
|
|
SnackBar(content: Text('${app.title} em desenvolvimento')),
|
|
);
|
|
},
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
Icon(
|
|
app.icon,
|
|
size: 48,
|
|
color: app.color,
|
|
),
|
|
const SizedBox(height: 12),
|
|
Text(
|
|
app.title,
|
|
textAlign: TextAlign.center,
|
|
style: Theme.of(context).textTheme.titleMedium,
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
},
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|