78 lines
2.2 KiB
Dart
78 lines
2.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'models/mini_app.dart';
|
|
|
|
void main() {
|
|
runApp(const CarteiraAppsApp());
|
|
}
|
|
|
|
class CarteiraAppsApp extends StatelessWidget {
|
|
const CarteiraAppsApp({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return MaterialApp(
|
|
title: 'Carteira Apps',
|
|
theme: ThemeData(
|
|
colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue),
|
|
useMaterial3: true,
|
|
),
|
|
home: const HomePage(),
|
|
);
|
|
}
|
|
}
|
|
|
|
class HomePage extends StatelessWidget {
|
|
const HomePage({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
title: const Text('Carteira Apps'),
|
|
),
|
|
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,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
},
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|