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,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
+35
-23
@@ -14,42 +14,54 @@ class MiniApp {
|
||||
});
|
||||
}
|
||||
|
||||
// Sample list of mini apps (placeholders for now)
|
||||
// List of mini apps for the launcher
|
||||
List<MiniApp> miniApps = [
|
||||
MiniApp(
|
||||
title: 'Notícias',
|
||||
icon: Icons.newspaper,
|
||||
title: 'Notícias Trends',
|
||||
icon: Icons.trending_up,
|
||||
color: Colors.blue,
|
||||
route: '/news',
|
||||
),
|
||||
MiniApp(
|
||||
title: 'Clima',
|
||||
icon: Icons.wb_sunny,
|
||||
color: Colors.orange,
|
||||
route: '/weather',
|
||||
title: 'Campo Minado',
|
||||
icon: Icons.gamepad,
|
||||
color: Colors.deepPurple,
|
||||
route: '/minesweeper',
|
||||
),
|
||||
MiniApp(
|
||||
title: 'Notas',
|
||||
title: 'Calculadora',
|
||||
icon: Icons.calculate,
|
||||
color: Colors.orange,
|
||||
route: '/calculator',
|
||||
),
|
||||
MiniApp(
|
||||
title: 'Bloco de Notas',
|
||||
icon: Icons.note,
|
||||
color: Colors.green,
|
||||
route: '/notes',
|
||||
),
|
||||
MiniApp(
|
||||
title: 'Calendário',
|
||||
icon: Icons.calendar_today,
|
||||
color: Colors.red,
|
||||
route: '/calendar',
|
||||
),
|
||||
MiniApp(
|
||||
title: 'Calculadora',
|
||||
icon: Icons.calculate,
|
||||
color: Colors.purple,
|
||||
route: '/calculator',
|
||||
),
|
||||
MiniApp(
|
||||
title: 'Galeria',
|
||||
icon: Icons.photo_library,
|
||||
title: 'Conversor de Moedas',
|
||||
icon: Icons.currency_exchange,
|
||||
color: Colors.teal,
|
||||
route: '/gallery',
|
||||
route: '/currency',
|
||||
),
|
||||
MiniApp(
|
||||
title: 'Criptomoedas',
|
||||
icon: Icons.currency_bitcoin,
|
||||
color: Colors.amber,
|
||||
route: '/crypto',
|
||||
),
|
||||
MiniApp(
|
||||
title: 'Jogo do Dinossauro',
|
||||
icon: Icons.directions_run,
|
||||
color: Colors.red,
|
||||
route: '/dino',
|
||||
),
|
||||
MiniApp(
|
||||
title: 'Jogo da Memória',
|
||||
icon: Icons.memory,
|
||||
color: Colors.indigo,
|
||||
route: '/memory',
|
||||
),
|
||||
];
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class CalculatorScreen extends StatelessWidget {
|
||||
const CalculatorScreen({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Calculadora'),
|
||||
),
|
||||
body: const Center(
|
||||
child: Text('Calculadora - Em desenvolvimento'),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class CryptoScreen extends StatelessWidget {
|
||||
const CryptoScreen({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Criptomoedas'),
|
||||
),
|
||||
body: const Center(
|
||||
child: Text('Criptomoedas - Em desenvolvimento'),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class CurrencyScreen extends StatelessWidget {
|
||||
const CurrencyScreen({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Conversor de Moedas'),
|
||||
),
|
||||
body: const Center(
|
||||
child: Text('Conversor de Moedas - Em desenvolvimento'),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class DinoScreen extends StatelessWidget {
|
||||
const DinoScreen({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Jogo do Dinossauro'),
|
||||
),
|
||||
body: const Center(
|
||||
child: Text('Jogo do Dinossauro - Em desenvolvimento'),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MemoryScreen extends StatelessWidget {
|
||||
const MemoryScreen({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Jogo da Memória'),
|
||||
),
|
||||
body: const Center(
|
||||
child: Text('Jogo da Memória - Em desenvolvimento'),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MinesweeperScreen extends StatelessWidget {
|
||||
const MinesweeperScreen({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Campo Minado'),
|
||||
),
|
||||
body: const Center(
|
||||
child: Text('Campo Minado - Em desenvolvimento'),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class NewsScreen extends StatelessWidget {
|
||||
const NewsScreen({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Notícias Trends'),
|
||||
),
|
||||
body: const Center(
|
||||
child: Text('Notícias Trends - Em desenvolvimento'),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class NotesScreen extends StatelessWidget {
|
||||
const NotesScreen({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Bloco de Notas'),
|
||||
),
|
||||
body: const Center(
|
||||
child: Text('Bloco de Notas - Em desenvolvimento'),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user