Skip to content

Commit e30a814

Browse files
committed
feat: Add Windows support for Flutter application
- Created CMakeLists.txt for Windows build configuration. - Added manifest.json for web application configuration. - Implemented Windows runner with necessary source files. - Included resource files for application icon and versioning. - Established plugin registration mechanism for Flutter plugins. - Configured build settings for multi-configuration support. - Added utility functions for console handling and command line argument parsing. - Implemented Win32 window management with DPI awareness and theme support. - Added .gitignore for Visual Studio specific files.
1 parent 0318379 commit e30a814

File tree

112 files changed

+3647
-292
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+3647
-292
lines changed

Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
FROM debian:stable-slim
2+
3+
# Variables
4+
ENV FLUTTER_VERSION=3.24.3
5+
ENV FLUTTER_HOME=/opt/flutter
6+
ENV PATH="$FLUTTER_HOME/bin:$PATH"
7+
8+
# Dépendances nécessaires
9+
RUN apt-get update && apt-get install -y \
10+
curl git unzip xz-utils zip libglu1-mesa \
11+
&& rm -rf /var/lib/apt/lists/*
12+
13+
# Installer Flutter SDK
14+
RUN git clone https://github.com/flutter/flutter.git -b stable $FLUTTER_HOME \
15+
&& flutter doctor
16+
17+
# Pré-télécharger les artefacts pour éviter des téléchargements à chaque run
18+
RUN flutter precache
19+
20+
# Vérifier l’installation
21+
RUN flutter doctor -v
22+
23+
WORKDIR /app

Taskfile.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,16 @@ tasks:
4040
desc: "Affiche l'aide détaillée"
4141
aliases: [ h ]
4242
cmds:
43-
- task: default
43+
- task: default
44+
45+
create:container:
46+
desc: "Construit l'image Docker pour l'environnement de développement Flutter"
47+
silent: true
48+
cmds:
49+
- docker build -t flutter-dev .
50+
51+
new:apps:
52+
desc: "Crée une nouvelle application Flutter dans le répertoire apps"
53+
silent: true
54+
cmds:
55+
- docker run --rm -it -v $PWD:/app flutter-dev flutter create apps

apps/.gitignore

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@
55
*.swp
66
.DS_Store
77
.atom/
8+
.build/
89
.buildlog/
910
.history
1011
.svn/
12+
.swiftpm/
13+
migrate_working_dir/
1114

1215
# IntelliJ related
1316
*.iml
@@ -24,18 +27,19 @@
2427
**/doc/api/
2528
**/ios/Flutter/.last_build_id
2629
.dart_tool/
27-
.flutter-plugins
2830
.flutter-plugins-dependencies
29-
.packages
3031
.pub-cache/
3132
.pub/
3233
/build/
33-
34-
# Web related
35-
lib/generated_plugin_registrant.dart
34+
/coverage/
3635

3736
# Symbolication related
3837
app.*.symbols
3938

4039
# Obfuscation related
4140
app.*.map.json
41+
42+
# Android Studio will place build artifacts here
43+
/android/app/debug
44+
/android/app/profile
45+
/android/app/release

apps/.metadata

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,42 @@
44
# This file should be version controlled and should not be manually edited.
55

66
version:
7-
revision: 78910062997c3a836feee883712c241a5fd22983
8-
channel: stable
7+
revision: "ac4e799d237041cf905519190471f657b657155a"
8+
channel: "stable"
99

1010
project_type: app
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: ac4e799d237041cf905519190471f657b657155a
17+
base_revision: ac4e799d237041cf905519190471f657b657155a
18+
- platform: android
19+
create_revision: ac4e799d237041cf905519190471f657b657155a
20+
base_revision: ac4e799d237041cf905519190471f657b657155a
21+
- platform: ios
22+
create_revision: ac4e799d237041cf905519190471f657b657155a
23+
base_revision: ac4e799d237041cf905519190471f657b657155a
24+
- platform: linux
25+
create_revision: ac4e799d237041cf905519190471f657b657155a
26+
base_revision: ac4e799d237041cf905519190471f657b657155a
27+
- platform: macos
28+
create_revision: ac4e799d237041cf905519190471f657b657155a
29+
base_revision: ac4e799d237041cf905519190471f657b657155a
30+
- platform: web
31+
create_revision: ac4e799d237041cf905519190471f657b657155a
32+
base_revision: ac4e799d237041cf905519190471f657b657155a
33+
- platform: windows
34+
create_revision: ac4e799d237041cf905519190471f657b657155a
35+
base_revision: ac4e799d237041cf905519190471f657b657155a
36+
37+
# User provided section
38+
39+
# List of Local paths (relative to this file) that should be
40+
# ignored by the migrate tool.
41+
#
42+
# Files that are not part of the templates will be ignored by default.
43+
unmanaged_files:
44+
- 'lib/main.dart'
45+
- 'ios/Runner.xcodeproj/project.pbxproj'

apps/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# flutter_hellowworld
1+
# apps
22

33
A new Flutter project.
44

@@ -8,9 +8,9 @@ This project is a starting point for a Flutter application.
88

99
A few resources to get you started if this is your first Flutter project:
1010

11-
- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
12-
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
11+
- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
12+
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
1313

14-
For help getting started with Flutter, view our
15-
[online documentation](https://flutter.dev/docs), which offers tutorials,
14+
For help getting started with Flutter development, view the
15+
[online documentation](https://docs.flutter.dev/), which offers tutorials,
1616
samples, guidance on mobile development, and a full API reference.

apps/analysis_options.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This file configures the analyzer, which statically analyzes Dart code to
2+
# check for errors, warnings, and lints.
3+
#
4+
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5+
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6+
# invoked from the command line by running `flutter analyze`.
7+
8+
# The following line activates a set of recommended lints for Flutter apps,
9+
# packages, and plugins designed to encourage good coding practices.
10+
include: package:flutter_lints/flutter.yaml
11+
12+
linter:
13+
# The lint rules applied to this project can be customized in the
14+
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
15+
# included above or to enable additional rules. A list of all available lints
16+
# and their documentation is published at https://dart.dev/lints.
17+
#
18+
# Instead of disabling a lint rule for the entire project in the
19+
# section below, it can also be suppressed for a single line of code
20+
# or a specific dart file by using the `// ignore: name_of_lint` and
21+
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
22+
# producing the lint.
23+
rules:
24+
# avoid_print: false # Uncomment to disable the `avoid_print` rule
25+
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
26+
27+
# Additional information about this file can be found at
28+
# https://dart.dev/guides/language/analysis-options

apps/android/.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ gradle-wrapper.jar
55
/gradlew.bat
66
/local.properties
77
GeneratedPluginRegistrant.java
8+
.cxx/
89

910
# Remember to never publicly share your keystore.
10-
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11+
# See https://flutter.dev/to/reference-keystore
1112
key.properties
13+
**/*.keystore
14+
**/*.jks

apps/android/app/build.gradle

Lines changed: 0 additions & 63 deletions
This file was deleted.

apps/android/app/build.gradle.kts

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
plugins {
2+
id("com.android.application")
3+
id("kotlin-android")
4+
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
5+
id("dev.flutter.flutter-gradle-plugin")
6+
}
7+
8+
android {
9+
namespace = "com.example.apps"
10+
compileSdk = flutter.compileSdkVersion
11+
ndkVersion = flutter.ndkVersion
12+
13+
compileOptions {
14+
sourceCompatibility = JavaVersion.VERSION_11
15+
targetCompatibility = JavaVersion.VERSION_11
16+
}
17+
18+
kotlinOptions {
19+
jvmTarget = JavaVersion.VERSION_11.toString()
20+
}
21+
22+
defaultConfig {
23+
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
24+
applicationId = "com.example.apps"
25+
// You can update the following values to match your application needs.
26+
// For more information, see: https://flutter.dev/to/review-gradle-config.
27+
minSdk = flutter.minSdkVersion
28+
targetSdk = flutter.targetSdkVersion
29+
versionCode = flutter.versionCode
30+
versionName = flutter.versionName
31+
}
32+
33+
buildTypes {
34+
release {
35+
// TODO: Add your own signing config for the release build.
36+
// Signing with the debug keys for now, so `flutter run --release` works.
37+
signingConfig = signingConfigs.getByName("debug")
38+
}
39+
}
40+
}
41+
42+
flutter {
43+
source = "../.."
44+
}

apps/android/app/src/debug/AndroidManifest.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.example.flutter_hellowworld">
3-
<!-- Flutter needs it to communicate with the running application
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2+
<!-- The INTERNET permission is required for development. Specifically,
3+
the Flutter tool needs it to communicate with the running application
44
to allow setting breakpoints, to provide hot reload, etc.
55
-->
66
<uses-permission android:name="android.permission.INTERNET"/>

0 commit comments

Comments
 (0)