Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Android Gradle DSL Syntax in Documentation #69

Open
beingadish opened this issue May 23, 2024 · 1 comment
Open

Support for Android Gradle DSL Syntax in Documentation #69

beingadish opened this issue May 23, 2024 · 1 comment

Comments

@beingadish
Copy link

Description

The current documentation for the 'flutter_config' package on pub.dev does not explain how to add the required Gradle files using the new DSL (Domain-Specific Language) syntax. This is crucial because all new Flutter projects now use DSL syntax by default.

Context

To build a Flutter app for Android, Flutter's Gradle plugins must be applied. Historically, this was done using Gradle's legacy, imperative apply script method. However, starting from Flutter 3.16, support was added for applying these plugins with Gradle's declarative plugins {} block (also known as the Plugin DSL), which is now the recommended approach.

Since Flutter 3.16, projects generated with flutter create use the Plugin DSL to apply Gradle plugins. Projects created with versions of Flutter prior to 3.16 need to be migrated manually.

Applying Gradle plugins using the plugins {} block executes the same code as before and should produce equivalent app binaries.

Request

Please provide updated documentation on pub.dev that includes instructions on how to configure the required Gradle files using the new Plugin DSL syntax. This will help ensure that developers using the 'flutter_config' package can easily set up their projects with the latest standards.

For more information about the advantages of the new Plugin DSL syntax over the legacy apply script syntax, you can refer to the DSL Migration Documentation.

Thank you for your attention to this matter.

@hjJunior
Copy link

hjJunior commented Sep 8, 2024

Not sure if the is best way, but I added this line after plugins, and it worked to me

plugins {
    id "com.android.application"
    id "kotlin-android"
    id "dev.flutter.flutter-gradle-plugin"
}

+ apply from: project(':flutter_config').projectDir.getPath() + "/dotenv.gradle"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants