feat(app): scaffolding initial du projet Flutter GameTime
Structure Flutter iOS/Android (lib/ organisé en couches domain, application, infrastructure, presentation), intégration Drift pour la persistance locale (sqlite3_flutter_libs), configuration des plateformes android/ et ios/. Build APK debug validé. Ajuste le .gitignore pour ignorer l'état d'exécution IdeA (.ideai/permissions.json) au même titre que le reste du runtime. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
16
lib/application/app_bootstrap.dart
Normal file
16
lib/application/app_bootstrap.dart
Normal file
@ -0,0 +1,16 @@
|
||||
import '../infrastructure/local/app_database.dart';
|
||||
|
||||
final class AppBootstrap {
|
||||
AppBootstrap._({required this.database});
|
||||
|
||||
final AppDatabase database;
|
||||
|
||||
static Future<AppBootstrap> create() async {
|
||||
final database = AppDatabase.open();
|
||||
await database.customSelect('SELECT 1').get();
|
||||
|
||||
return AppBootstrap._(database: database);
|
||||
}
|
||||
|
||||
Future<void> dispose() => database.close();
|
||||
}
|
||||
5
lib/application/application.dart
Normal file
5
lib/application/application.dart
Normal file
@ -0,0 +1,5 @@
|
||||
/// Application layer entry point.
|
||||
///
|
||||
/// This layer owns use cases and ports. It may depend on domain, but concrete
|
||||
/// adapters are wired only from the composition root.
|
||||
library;
|
||||
4
lib/domain/domain.dart
Normal file
4
lib/domain/domain.dart
Normal file
@ -0,0 +1,4 @@
|
||||
/// Domain layer entry point.
|
||||
///
|
||||
/// Keep this layer free from Flutter, Drift, platform APIs, and IO.
|
||||
library;
|
||||
5
lib/infrastructure/infrastructure.dart
Normal file
5
lib/infrastructure/infrastructure.dart
Normal file
@ -0,0 +1,5 @@
|
||||
/// Infrastructure layer entry point.
|
||||
///
|
||||
/// Concrete adapters live here and depend inward on application/domain
|
||||
/// contracts.
|
||||
library;
|
||||
23
lib/infrastructure/local/app_database.dart
Normal file
23
lib/infrastructure/local/app_database.dart
Normal file
@ -0,0 +1,23 @@
|
||||
import 'package:drift/drift.dart';
|
||||
import 'package:drift_flutter/drift_flutter.dart';
|
||||
|
||||
final class AppDatabase extends GeneratedDatabase {
|
||||
AppDatabase(DatabaseConnection connection) : super.connect(connection);
|
||||
|
||||
factory AppDatabase.open() {
|
||||
return AppDatabase(
|
||||
driftDatabase(
|
||||
name: 'gametime',
|
||||
native: const DriftNativeOptions(
|
||||
shareAcrossIsolates: true,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
int get schemaVersion => 1;
|
||||
|
||||
@override
|
||||
Iterable<TableInfo<Table, dynamic>> get allTables => const [];
|
||||
}
|
||||
1
lib/infrastructure/local/local.dart
Normal file
1
lib/infrastructure/local/local.dart
Normal file
@ -0,0 +1 @@
|
||||
export 'app_database.dart';
|
||||
12
lib/main.dart
Normal file
12
lib/main.dart
Normal file
@ -0,0 +1,12 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'application/app_bootstrap.dart';
|
||||
import 'presentation/game_time_app.dart';
|
||||
|
||||
Future<void> main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
final bootstrap = await AppBootstrap.create();
|
||||
|
||||
runApp(GameTimeApp(bootstrap: bootstrap));
|
||||
}
|
||||
23
lib/presentation/game_time_app.dart
Normal file
23
lib/presentation/game_time_app.dart
Normal file
@ -0,0 +1,23 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../application/app_bootstrap.dart';
|
||||
|
||||
final class GameTimeApp extends StatelessWidget {
|
||||
const GameTimeApp({required this.bootstrap, super.key});
|
||||
|
||||
final AppBootstrap bootstrap;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
title: 'GameTime',
|
||||
theme: ThemeData(
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: const Color(0xFF0E7C66)),
|
||||
useMaterial3: true,
|
||||
),
|
||||
home: const Scaffold(
|
||||
body: SizedBox.shrink(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
1
lib/presentation/presentation.dart
Normal file
1
lib/presentation/presentation.dart
Normal file
@ -0,0 +1 @@
|
||||
export 'game_time_app.dart';
|
||||
Reference in New Issue
Block a user