diff --git a/lib/main.dart b/lib/main.dart index 3dbfe7e..f5fb34f 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -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, + ), + ], ), ), - ], - ), + ); + }, ), - ); - }, + ), + ], ), ), ); diff --git a/lib/models/mini_app.dart b/lib/models/mini_app.dart index a05e8f3..448f32f 100644 --- a/lib/models/mini_app.dart +++ b/lib/models/mini_app.dart @@ -14,42 +14,54 @@ class MiniApp { }); } -// Sample list of mini apps (placeholders for now) +// List of mini apps for the launcher List 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', ), ]; diff --git a/lib/screens/calculator_screen.dart b/lib/screens/calculator_screen.dart new file mode 100644 index 0000000..0a125a2 --- /dev/null +++ b/lib/screens/calculator_screen.dart @@ -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'), + ), + ); + } +} diff --git a/lib/screens/crypto_screen.dart b/lib/screens/crypto_screen.dart new file mode 100644 index 0000000..1bb242e --- /dev/null +++ b/lib/screens/crypto_screen.dart @@ -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'), + ), + ); + } +} diff --git a/lib/screens/currency_screen.dart b/lib/screens/currency_screen.dart new file mode 100644 index 0000000..2d93cca --- /dev/null +++ b/lib/screens/currency_screen.dart @@ -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'), + ), + ); + } +} diff --git a/lib/screens/dino_screen.dart b/lib/screens/dino_screen.dart new file mode 100644 index 0000000..c42bb57 --- /dev/null +++ b/lib/screens/dino_screen.dart @@ -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'), + ), + ); + } +} diff --git a/lib/screens/memory_screen.dart b/lib/screens/memory_screen.dart new file mode 100644 index 0000000..bc2ad16 --- /dev/null +++ b/lib/screens/memory_screen.dart @@ -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'), + ), + ); + } +} diff --git a/lib/screens/minesweeper_screen.dart b/lib/screens/minesweeper_screen.dart new file mode 100644 index 0000000..d039347 --- /dev/null +++ b/lib/screens/minesweeper_screen.dart @@ -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'), + ), + ); + } +} diff --git a/lib/screens/news_screen.dart b/lib/screens/news_screen.dart new file mode 100644 index 0000000..e80063a --- /dev/null +++ b/lib/screens/news_screen.dart @@ -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'), + ), + ); + } +} diff --git a/lib/screens/notes_screen.dart b/lib/screens/notes_screen.dart new file mode 100644 index 0000000..21a7d51 --- /dev/null +++ b/lib/screens/notes_screen.dart @@ -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'), + ), + ); + } +}