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 'package:flutter/material.dart';
|
||||||
import 'models/mini_app.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() {
|
void main() {
|
||||||
runApp(const CarteiraAppsApp());
|
runApp(const CarteiraAppsApp());
|
||||||
@@ -17,6 +25,16 @@ class CarteiraAppsApp extends StatelessWidget {
|
|||||||
useMaterial3: true,
|
useMaterial3: true,
|
||||||
),
|
),
|
||||||
home: const HomePage(),
|
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(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: const Text('Carteira Apps'),
|
title: const Text('Carteira Apps'),
|
||||||
|
centerTitle: true,
|
||||||
),
|
),
|
||||||
body: Padding(
|
body: Padding(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(12.0),
|
||||||
child: GridView.builder(
|
child: Column(
|
||||||
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
children: [
|
||||||
crossAxisCount: 2,
|
// Search bar
|
||||||
crossAxisSpacing: 16,
|
TextField(
|
||||||
mainAxisSpacing: 16,
|
decoration: InputDecoration(
|
||||||
childAspectRatio: 1,
|
hintText: 'Pesquisar apps...',
|
||||||
),
|
prefixIcon: const Icon(Icons.search),
|
||||||
itemCount: miniApps.length,
|
border: OutlineInputBorder(
|
||||||
itemBuilder: (context, index) {
|
borderRadius: BorderRadius.circular(12),
|
||||||
final app = miniApps[index];
|
),
|
||||||
return Card(
|
filled: true,
|
||||||
color: app.color.withValues(alpha: 0.1),
|
fillColor: Theme.of(context).colorScheme.surfaceContainerHighest,
|
||||||
child: InkWell(
|
),
|
||||||
onTap: () {
|
),
|
||||||
// TODO: navigate to actual app screen
|
const SizedBox(height: 16),
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
// Grid of mini apps
|
||||||
SnackBar(content: Text('${app.title} em desenvolvimento')),
|
Expanded(
|
||||||
);
|
child: GridView.builder(
|
||||||
},
|
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
child: Column(
|
crossAxisCount: 2,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
crossAxisSpacing: 12,
|
||||||
children: [
|
mainAxisSpacing: 12,
|
||||||
Icon(app.icon, size: 48, color: app.color),
|
childAspectRatio: 0.9,
|
||||||
const SizedBox(height: 12),
|
),
|
||||||
Text(
|
itemCount: miniApps.length,
|
||||||
app.title,
|
itemBuilder: (context, index) {
|
||||||
textAlign: TextAlign.center,
|
final app = miniApps[index];
|
||||||
style: TextStyle(
|
return Card(
|
||||||
fontSize: 16,
|
elevation: 2,
|
||||||
fontWeight: FontWeight.w600,
|
shape: RoundedRectangleBorder(
|
||||||
color: app.color,
|
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 = [
|
List<MiniApp> miniApps = [
|
||||||
MiniApp(
|
MiniApp(
|
||||||
title: 'Notícias',
|
title: 'Notícias Trends',
|
||||||
icon: Icons.newspaper,
|
icon: Icons.trending_up,
|
||||||
color: Colors.blue,
|
color: Colors.blue,
|
||||||
route: '/news',
|
route: '/news',
|
||||||
),
|
),
|
||||||
MiniApp(
|
MiniApp(
|
||||||
title: 'Clima',
|
title: 'Campo Minado',
|
||||||
icon: Icons.wb_sunny,
|
icon: Icons.gamepad,
|
||||||
color: Colors.orange,
|
color: Colors.deepPurple,
|
||||||
route: '/weather',
|
route: '/minesweeper',
|
||||||
),
|
),
|
||||||
MiniApp(
|
MiniApp(
|
||||||
title: 'Notas',
|
title: 'Calculadora',
|
||||||
|
icon: Icons.calculate,
|
||||||
|
color: Colors.orange,
|
||||||
|
route: '/calculator',
|
||||||
|
),
|
||||||
|
MiniApp(
|
||||||
|
title: 'Bloco de Notas',
|
||||||
icon: Icons.note,
|
icon: Icons.note,
|
||||||
color: Colors.green,
|
color: Colors.green,
|
||||||
route: '/notes',
|
route: '/notes',
|
||||||
),
|
),
|
||||||
MiniApp(
|
MiniApp(
|
||||||
title: 'Calendário',
|
title: 'Conversor de Moedas',
|
||||||
icon: Icons.calendar_today,
|
icon: Icons.currency_exchange,
|
||||||
color: Colors.red,
|
|
||||||
route: '/calendar',
|
|
||||||
),
|
|
||||||
MiniApp(
|
|
||||||
title: 'Calculadora',
|
|
||||||
icon: Icons.calculate,
|
|
||||||
color: Colors.purple,
|
|
||||||
route: '/calculator',
|
|
||||||
),
|
|
||||||
MiniApp(
|
|
||||||
title: 'Galeria',
|
|
||||||
icon: Icons.photo_library,
|
|
||||||
color: Colors.teal,
|
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