feat:mini apps: adicione telas placeholder para todos os oito mini apps (Notícias Trends, Campo Minado, Calculadora, Bloco de Notas, Conversor de Moedas, Criptomoedas, Jogo do Dinossauro, Jogo da Memória) e atualize navegação
This commit is contained in:
+77
-36
@@ -1,5 +1,13 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'models/mini_app.dart';
|
||||
import 'screens/news_screen.dart';
|
||||
import 'screens/notes_screen.dart';
|
||||
import 'screens/currency_screen.dart';
|
||||
import 'screens/crypto_screen.dart';
|
||||
import 'screens/dino_screen.dart';
|
||||
import 'screens/memory_screen.dart';
|
||||
import 'screens/minesweeper_screen.dart';
|
||||
import 'screens/calculator_screen.dart';
|
||||
|
||||
void main() {
|
||||
runApp(const CarteiraAppsApp());
|
||||
@@ -17,6 +25,16 @@ class CarteiraAppsApp extends StatelessWidget {
|
||||
useMaterial3: true,
|
||||
),
|
||||
home: const HomePage(),
|
||||
routes: {
|
||||
'/news': (context) => const NewsScreen(),
|
||||
'/notes': (context) => const NotesScreen(),
|
||||
'/currency': (context) => const CurrencyScreen(),
|
||||
'/crypto': (context) => const CryptoScreen(),
|
||||
'/dino': (context) => const DinoScreen(),
|
||||
'/memory': (context) => const MemoryScreen(),
|
||||
'/minesweeper': (context) => const MinesweeperScreen(),
|
||||
'/calculator': (context) => const CalculatorScreen(),
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -29,47 +47,70 @@ class HomePage extends StatelessWidget {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Carteira Apps'),
|
||||
centerTitle: true,
|
||||
),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: GridView.builder(
|
||||
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 2,
|
||||
crossAxisSpacing: 16,
|
||||
mainAxisSpacing: 16,
|
||||
childAspectRatio: 1,
|
||||
),
|
||||
itemCount: miniApps.length,
|
||||
itemBuilder: (context, index) {
|
||||
final app = miniApps[index];
|
||||
return Card(
|
||||
color: app.color.withValues(alpha: 0.1),
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
// TODO: navigate to actual 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: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: app.color,
|
||||
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: () {
|
||||
// Navigate to the named route
|
||||
Navigator.of(context).pushNamed(app.route);
|
||||
},
|
||||
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,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user