create-mobile-arch 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +180 -0
- package/bin/index.js +144 -0
- package/package.json +43 -0
- package/src/generator.js +229 -0
- package/src/prompts.js +140 -0
- package/src/utils.js +185 -0
- package/templates/flutter-clean/analysis_options.yaml +46 -0
- package/templates/flutter-clean/lib/core/constants/app_constants.dart +26 -0
- package/templates/flutter-clean/lib/core/theme/app_theme.dart +90 -0
- package/templates/flutter-clean/lib/core/utils/app_utils.dart +29 -0
- package/templates/flutter-clean/lib/data/datasources/.gitkeep +0 -0
- package/templates/flutter-clean/lib/data/models/user_model.dart +57 -0
- package/templates/flutter-clean/lib/data/repositories/.gitkeep +0 -0
- package/templates/flutter-clean/lib/domain/entities/user.dart +23 -0
- package/templates/flutter-clean/lib/domain/repositories/.gitkeep +0 -0
- package/templates/flutter-clean/lib/domain/usecases/.gitkeep +0 -0
- package/templates/flutter-clean/lib/main.dart +33 -0
- package/templates/flutter-clean/lib/presentation/providers/.gitkeep +0 -0
- package/templates/flutter-clean/lib/presentation/screens/home_screen.dart +106 -0
- package/templates/flutter-clean/lib/presentation/widgets/.gitkeep +0 -0
- package/templates/flutter-clean/pubspec.yaml +69 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import 'package:flutter/material.dart';
|
|
2
|
+
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
3
|
+
|
|
4
|
+
/// Home screen of the application
|
|
5
|
+
/// Demonstrates Clean Architecture with Riverpod state management
|
|
6
|
+
class HomeScreen extends ConsumerWidget {
|
|
7
|
+
const HomeScreen({super.key});
|
|
8
|
+
|
|
9
|
+
@override
|
|
10
|
+
Widget build(BuildContext context, WidgetRef ref) {
|
|
11
|
+
return Scaffold(
|
|
12
|
+
appBar: AppBar(
|
|
13
|
+
title: const Text('__APP_NAME_PASCAL__'),
|
|
14
|
+
),
|
|
15
|
+
body: Center(
|
|
16
|
+
child: Padding(
|
|
17
|
+
padding: const EdgeInsets.all(24.0),
|
|
18
|
+
child: Column(
|
|
19
|
+
mainAxisAlignment: MainAxisAlignment.center,
|
|
20
|
+
children: [
|
|
21
|
+
const Icon(
|
|
22
|
+
Icons.rocket_launch,
|
|
23
|
+
size: 100,
|
|
24
|
+
color: Color(0xFF2196F3),
|
|
25
|
+
),
|
|
26
|
+
const SizedBox(height: 32),
|
|
27
|
+
Text(
|
|
28
|
+
'Welcome to __APP_NAME_PASCAL__',
|
|
29
|
+
style: Theme.of(context).textTheme.headlineSmall?.copyWith(
|
|
30
|
+
fontWeight: FontWeight.bold,
|
|
31
|
+
),
|
|
32
|
+
textAlign: TextAlign.center,
|
|
33
|
+
),
|
|
34
|
+
const SizedBox(height: 16),
|
|
35
|
+
Text(
|
|
36
|
+
'Your Flutter app is ready!',
|
|
37
|
+
style: Theme.of(context).textTheme.bodyLarge?.copyWith(
|
|
38
|
+
color: Colors.grey[600],
|
|
39
|
+
),
|
|
40
|
+
textAlign: TextAlign.center,
|
|
41
|
+
),
|
|
42
|
+
const SizedBox(height: 48),
|
|
43
|
+
_buildInfoCard(context, 'Architecture', 'Clean Architecture'),
|
|
44
|
+
const SizedBox(height: 12),
|
|
45
|
+
_buildInfoCard(context, 'State Management', '__STATE_MANAGEMENT__'),
|
|
46
|
+
const SizedBox(height: 12),
|
|
47
|
+
_buildInfoCard(context, 'Backend', '__BACKEND_TYPE__'),
|
|
48
|
+
const SizedBox(height: 48),
|
|
49
|
+
ElevatedButton.icon(
|
|
50
|
+
onPressed: () {
|
|
51
|
+
ScaffoldMessenger.of(context).showSnackBar(
|
|
52
|
+
const SnackBar(
|
|
53
|
+
content: Text('Start building your app!'),
|
|
54
|
+
duration: Duration(seconds: 2),
|
|
55
|
+
),
|
|
56
|
+
);
|
|
57
|
+
},
|
|
58
|
+
icon: const Icon(Icons.code),
|
|
59
|
+
label: const Text('Get Started'),
|
|
60
|
+
),
|
|
61
|
+
],
|
|
62
|
+
),
|
|
63
|
+
),
|
|
64
|
+
),
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
Widget _buildInfoCard(BuildContext context, String label, String value) {
|
|
69
|
+
return Container(
|
|
70
|
+
width: double.infinity,
|
|
71
|
+
padding: const EdgeInsets.all(16),
|
|
72
|
+
decoration: BoxDecoration(
|
|
73
|
+
color: Theme.of(context).brightness == Brightness.light
|
|
74
|
+
? Colors.white
|
|
75
|
+
: Colors.grey[850],
|
|
76
|
+
borderRadius: BorderRadius.circular(12),
|
|
77
|
+
boxShadow: [
|
|
78
|
+
BoxShadow(
|
|
79
|
+
color: Colors.black.withOpacity(0.05),
|
|
80
|
+
blurRadius: 10,
|
|
81
|
+
offset: const Offset(0, 2),
|
|
82
|
+
),
|
|
83
|
+
],
|
|
84
|
+
),
|
|
85
|
+
child: Row(
|
|
86
|
+
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
87
|
+
children: [
|
|
88
|
+
Text(
|
|
89
|
+
label,
|
|
90
|
+
style: TextStyle(
|
|
91
|
+
fontWeight: FontWeight.w600,
|
|
92
|
+
color: Colors.grey[600],
|
|
93
|
+
),
|
|
94
|
+
),
|
|
95
|
+
Text(
|
|
96
|
+
value,
|
|
97
|
+
style: const TextStyle(
|
|
98
|
+
fontWeight: FontWeight.bold,
|
|
99
|
+
color: Color(0xFF2196F3),
|
|
100
|
+
),
|
|
101
|
+
),
|
|
102
|
+
],
|
|
103
|
+
),
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
name: __APP_NAME__
|
|
2
|
+
description: A Flutter project built with Clean Architecture
|
|
3
|
+
publish_to: 'none'
|
|
4
|
+
version: 1.0.0+1
|
|
5
|
+
|
|
6
|
+
environment:
|
|
7
|
+
sdk: '>=3.0.0 <4.0.0'
|
|
8
|
+
|
|
9
|
+
dependencies:
|
|
10
|
+
flutter:
|
|
11
|
+
sdk: flutter
|
|
12
|
+
|
|
13
|
+
# UI
|
|
14
|
+
cupertino_icons: ^1.0.6
|
|
15
|
+
|
|
16
|
+
# State Management - Riverpod
|
|
17
|
+
flutter_riverpod: ^2.4.9
|
|
18
|
+
riverpod_annotation: ^2.3.3
|
|
19
|
+
|
|
20
|
+
# Dependency Injection
|
|
21
|
+
get_it: ^7.6.4
|
|
22
|
+
injectable: ^2.3.2
|
|
23
|
+
|
|
24
|
+
# Navigation
|
|
25
|
+
go_router: ^12.1.3
|
|
26
|
+
|
|
27
|
+
# Network - REST API
|
|
28
|
+
dio: ^5.4.0
|
|
29
|
+
retrofit: ^4.0.3
|
|
30
|
+
pretty_dio_logger: ^1.3.1
|
|
31
|
+
|
|
32
|
+
# Local Storage
|
|
33
|
+
shared_preferences: ^2.2.2
|
|
34
|
+
hive: ^2.2.3
|
|
35
|
+
hive_flutter: ^1.1.0
|
|
36
|
+
|
|
37
|
+
# Utilities
|
|
38
|
+
equatable: ^2.0.5
|
|
39
|
+
dartz: ^0.10.1
|
|
40
|
+
freezed_annotation: ^2.4.1
|
|
41
|
+
json_annotation: ^4.8.1
|
|
42
|
+
intl: ^0.18.1
|
|
43
|
+
|
|
44
|
+
dev_dependencies:
|
|
45
|
+
flutter_test:
|
|
46
|
+
sdk: flutter
|
|
47
|
+
|
|
48
|
+
# Linting
|
|
49
|
+
flutter_lints: ^3.0.1
|
|
50
|
+
|
|
51
|
+
# Code Generation
|
|
52
|
+
build_runner: ^2.4.7
|
|
53
|
+
freezed: ^2.4.6
|
|
54
|
+
json_serializable: ^6.7.1
|
|
55
|
+
riverpod_generator: ^2.3.9
|
|
56
|
+
injectable_generator: ^2.4.1
|
|
57
|
+
retrofit_generator: ^8.0.6
|
|
58
|
+
|
|
59
|
+
flutter:
|
|
60
|
+
uses-material-design: true
|
|
61
|
+
|
|
62
|
+
# assets:
|
|
63
|
+
# - images/
|
|
64
|
+
# - icons/
|
|
65
|
+
|
|
66
|
+
# fonts:
|
|
67
|
+
# - family: CustomFont
|
|
68
|
+
# fonts:
|
|
69
|
+
# - asset: fonts/CustomFont-Regular.ttf
|