Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 15-improve-app-metadata
  • 24-add-fruits
  • master
  • Release_0.0.10_10
  • Release_0.0.11_11
  • Release_0.0.12_12
  • Release_0.0.1_1
  • Release_0.0.2_2
  • Release_0.0.3_3
  • Release_0.0.4_4
  • Release_0.0.5_5
  • Release_0.0.6_6
  • Release_0.0.7_7
  • Release_0.0.8_8
  • Release_0.0.9_9
  • Release_0.1.0_13
  • Release_0.1.1_14
  • Release_0.10.0_31
  • Release_0.10.1_32
  • Release_0.2.0_15
  • Release_0.2.1_16
  • Release_0.3.0_17
  • Release_0.3.1_18
  • Release_0.4.0_19
  • Release_0.5.0_20
  • Release_0.5.1_21
  • Release_0.5.2_22
  • Release_0.5.3_23
  • Release_0.5.4_24
  • Release_0.6.0_25
  • Release_0.7.0_26
  • Release_0.8.0_27
  • Release_0.9.0_28
  • Release_0.9.1_29
  • Release_0.9.2_30
35 results

Target

Select target project
No results found
Select Git revision
  • 15-improve-app-metadata
  • 24-add-fruits
  • master
  • Release_0.0.10_10
  • Release_0.0.11_11
  • Release_0.0.12_12
  • Release_0.0.1_1
  • Release_0.0.2_2
  • Release_0.0.3_3
  • Release_0.0.4_4
  • Release_0.0.5_5
  • Release_0.0.6_6
  • Release_0.0.7_7
  • Release_0.0.8_8
  • Release_0.0.9_9
  • Release_0.1.0_13
  • Release_0.1.1_14
  • Release_0.10.0_31
  • Release_0.10.1_32
  • Release_0.2.0_15
  • Release_0.2.1_16
  • Release_0.3.0_17
  • Release_0.3.1_18
  • Release_0.4.0_19
  • Release_0.5.0_20
  • Release_0.5.1_21
  • Release_0.5.2_22
  • Release_0.5.3_23
  • Release_0.5.4_24
  • Release_0.6.0_25
  • Release_0.7.0_26
  • Release_0.8.0_27
  • Release_0.9.0_28
  • Release_0.9.1_29
  • Release_0.9.2_30
35 results
Show changes

Commits on Source 34

163 files
+ 2765
982
Compare changes
  • Side-by-side
  • Inline

Files

.editorconfig

0 → 100644
+18 −0
Original line number Original line Diff line number Diff line
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.json]
indent_size = 2

[*.yaml]
indent_size = 2

[*.md]
trim_trailing_whitespace = false
+1 −1
Original line number Original line Diff line number Diff line
@@ -8,6 +8,7 @@
.buildlog/
.buildlog/
.history
.history
.svn/
.svn/
migrate_working_dir/


# IntelliJ related
# IntelliJ related
*.iml
*.iml
@@ -22,7 +23,6 @@


# Flutter/Dart/Pub related
# Flutter/Dart/Pub related
**/doc/api/
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.dart_tool/
.flutter-plugins
.flutter-plugins
.flutter-plugins-dependencies
.flutter-plugins-dependencies
+35 −24
Original line number Original line Diff line number Diff line
image: cirrusci/flutter:latest
image: ghcr.io/cirruslabs/flutter:latest


stages:
stages:
  - update
  - build-debug
  - build-debug
  - build-release
  - build-release
  - release
  - release
  - deploy
  - deploy


update:
  stage: update
  except:
    - tags
  script:
    - flutter packages get
    - flutter packages upgrade
  interruptible: true

android:build-debug:
android:build-debug:
  stage: build-debug
  stage: build-debug
  except:
  except:
    - tags
    - tags
    - master
  script:
  script:
    # Flutter local configuration
    # Flutter local configuration
    - echo flutter.sdk=$FLUTTER_PATH > android/local.properties
    - echo flutter.sdk=$FLUTTER_PATH > android/local.properties
@@ -32,14 +23,27 @@ android:build-debug:
    - echo keyAlias=$ANDROID_DEBUG_KEY_ALIAS >> android/key.properties
    - echo keyAlias=$ANDROID_DEBUG_KEY_ALIAS >> android/key.properties
    - echo keyPassword=$ANDROID_DEBUG_KEY_PASSWORD >> android/key.properties
    - echo keyPassword=$ANDROID_DEBUG_KEY_PASSWORD >> android/key.properties
    # build flutter app
    # build flutter app
    - VERSION_NAME="$(grep '^version:' pubspec.yaml | cut -d' ' -f2 | cut -d'+' -f1)"
    - echo "${VERSION_NAME}"
    - VERSION_CODE="$(grep '^version:' pubspec.yaml | cut -d' ' -f2 | cut -d'+' -f2)"
    - echo "${VERSION_CODE}"
    - flutter packages get
    - flutter packages get
    - flutter clean
    - flutter clean
    - flutter build apk --debug --split-per-abi
    - flutter build apk --debug
    - flutter build apk --debug
    # prepare artifact
    # prepare artifact
    - find . -name "*.apk" # where is my apk?
    - BASE_APK_FOLDER="build/app/outputs/flutter-apk"
    - APP_NAME="$(grep 'namespace' android/app/build.gradle | cut -d'"' -f2)"
    - >
      if [ "$(find "${BASE_APK_FOLDER}" -name "*.apk")" != "" ]; then
        for APK in ${BASE_APK_FOLDER}/*.apk; do
          mv -v "${APK}" "$(echo "${APK}" | sed "s|\.apk|_${VERSION_CODE}.apk|" | sed "s|/app-|/${APP_NAME}-|")"
        done
      fi
    - find "${BASE_APK_FOLDER}" -name "*.apk" # where are my apk?
  artifacts:
  artifacts:
    paths:
    paths:
      - build/app/outputs/apk/debug
      - build/app/outputs/flutter-apk
    expire_in: 1 week
    expire_in: 1 week
  interruptible: true
  interruptible: true


@@ -49,8 +53,6 @@ android:build-release:
    - master
    - master
  except:
  except:
    - tags
    - tags
  dependencies:
    - android:build-debug
  script:
  script:
    # Flutter local configuration
    # Flutter local configuration
    - echo flutter.sdk=$FLUTTER_PATH > android/local.properties
    - echo flutter.sdk=$FLUTTER_PATH > android/local.properties
@@ -63,9 +65,12 @@ android:build-release:
    - echo keyAlias=$ANDROID_KEY_ALIAS >> android/key.properties
    - echo keyAlias=$ANDROID_KEY_ALIAS >> android/key.properties
    - echo keyPassword=$ANDROID_KEY_PASSWORD >> android/key.properties
    - echo keyPassword=$ANDROID_KEY_PASSWORD >> android/key.properties
    # build flutter app
    # build flutter app
    - VERSION_FILE="$(find . -name 'gradle.properties' | head -n1)"
    - BASE_APK_FOLDER="build/app/outputs/flutter-apk"
    - VERSION_NAME="$(grep '^app.versionName=' "${VERSION_FILE}" | cut -d'=' -f2)"
    - echo "${BASE_APK_FOLDER}"
    - VERSION_CODE="$(grep '^app.versionCode=' "${VERSION_FILE}" | cut -d'=' -f2)"
    - mkdir -p "${BASE_APK_FOLDER}"
    - VERSION_NAME="$(grep '^version:' pubspec.yaml | cut -d' ' -f2 | cut -d'+' -f1)"
    - VERSION_CODE="$(grep '^version:' pubspec.yaml | cut -d' ' -f2 | cut -d'+' -f2)"
    - APP_NAME="$(grep 'namespace' android/app/build.gradle | cut -d'"' -f2)"
    - TAG_NAME="Release_${VERSION_NAME}_${VERSION_CODE}"
    - TAG_NAME="Release_${VERSION_NAME}_${VERSION_CODE}"
    - echo "${TAG_NAME}"
    - echo "${TAG_NAME}"
    - >
    - >
@@ -74,13 +79,20 @@ android:build-release:
      else
      else
        flutter packages get
        flutter packages get
        flutter clean
        flutter clean
        flutter build apk --release --split-per-abi
        flutter build apk --release
        flutter build apk --release
      fi
      fi
    # prepare artifact
    # prepare artifact
    - find . -name "*.apk" # where is my apk?
    - >
      if [ "$(find "${BASE_APK_FOLDER}" -name "*.apk")" != "" ]; then
        for APK in ${BASE_APK_FOLDER}/*.apk; do
          mv -v "${APK}" "$(echo "${APK}" | sed "s|\.apk|_${VERSION_CODE}.apk|" | sed "s|/app-|/${APP_NAME}-|")"
        done
      fi
    - find "${BASE_APK_FOLDER}" -name "*.apk" # where are my apk?
  artifacts:
  artifacts:
    paths:
    paths:
      - build/app/outputs/apk/release
      - build/app/outputs/flutter-apk
    expire_in: 1 week
    expire_in: 1 week
  interruptible: true
  interruptible: true


@@ -100,9 +112,8 @@ application:release:
    - git config user.email "${GITLAB_USER_EMAIL}"
    - git config user.email "${GITLAB_USER_EMAIL}"
    - git config user.name "${GITLAB_USER_NAME}"
    - git config user.name "${GITLAB_USER_NAME}"
    - git remote set-url origin https://oauth2:${GITLAB_ACCESS_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}
    - git remote set-url origin https://oauth2:${GITLAB_ACCESS_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}
    - VERSION_FILE="$(find . -name 'gradle.properties' | head -n1)"
    - VERSION_NAME="$(grep '^version:' pubspec.yaml | cut -d' ' -f2 | cut -d'+' -f1)"
    - VERSION_NAME="$(grep '^app.versionName=' "${VERSION_FILE}" | cut -d'=' -f2)"
    - VERSION_CODE="$(grep '^version:' pubspec.yaml | cut -d' ' -f2 | cut -d'+' -f2)"
    - VERSION_CODE="$(grep '^app.versionCode=' "${VERSION_FILE}" | cut -d'=' -f2)"
    - TAG_NAME="Release_${VERSION_NAME}_${VERSION_CODE}"
    - TAG_NAME="Release_${VERSION_NAME}_${VERSION_CODE}"
    - echo "${TAG_NAME}"
    - echo "${TAG_NAME}"
    - >
    - >
@@ -121,4 +132,4 @@ android:deploy:
  dependencies:
  dependencies:
    - application:release
    - application:release
  script:
  script:
    - curl "${REPOSITORY_UPDATE_WEBHOOK}?token=${REPOSITORY_TOKEN}"
    - curl "${REPOSITORY_UPDATE_WEBHOOK}?token=${REPOSITORY_TOKEN}" --fail
+1 −1
Original line number Original line Diff line number Diff line
# calculus
# snake game

analysis_options.yaml

0 → 100644
+1 −0
Original line number Original line Diff line number Diff line
include: package:flutter_lints/flutter.yaml
Original line number Original line Diff line number Diff line
@@ -7,5 +7,7 @@ gradle-wrapper.jar
GeneratedPluginRegistrant.java
GeneratedPluginRegistrant.java


# Remember to never publicly share your keystore.
# Remember to never publicly share your keystore.
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
# See https://flutter.dev/to/reference-keystore
key.properties
key.properties
**/*.keystore
**/*.jks
Original line number Original line Diff line number Diff line
def localProperties = new Properties()
plugins {
def localPropertiesFile = rootProject.file('local.properties')
    id "com.android.application"
if (localPropertiesFile.exists()) {
    id "kotlin-android"
    localPropertiesFile.withReader('UTF-8') { reader ->
    id "dev.flutter.flutter-gradle-plugin"
        localProperties.load(reader)
    }
}

def gradleProperties = new Properties()
def gradlePropertiesFile = rootProject.file('gradle.properties')
if (gradlePropertiesFile.exists()) {
    gradlePropertiesFile.withReader('UTF-8') { reader ->
        gradleProperties.load(reader)
    }
}
}


def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
    throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def appVersionCode = gradleProperties.getProperty('app.versionCode')
if (appVersionCode == null) {
    appVersionCode = '1'
}

def appVersionName = gradleProperties.getProperty('app.versionName')
if (appVersionName == null) {
    appVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

def keystoreProperties = new Properties()
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
if (keystorePropertiesFile.exists()) {
@@ -39,32 +11,69 @@ if (keystorePropertiesFile.exists()) {
}
}


android {
android {
    compileSdkVersion 31
    namespace = "org.benoitharrault.snake"
    compileSdk = flutter.compileSdkVersion
    ndkVersion = flutter.ndkVersion

    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }

    kotlinOptions {
        jvmTarget = JavaVersion.VERSION_1_8
    }


    defaultConfig {
    defaultConfig {
        applicationId "org.benoitharrault.snake"
        applicationId = "org.benoitharrault.snake"
        minSdkVersion 16
        minSdk = flutter.minSdkVersion
        targetSdkVersion 30
        targetSdk = flutter.targetSdkVersion
        versionCode appVersionCode.toInteger()
        versionCode = flutter.versionCode
        versionName appVersionName
        versionName = flutter.versionName
        archivesBaseName = "$applicationId" + "_" + "$versionCode"
    }
    }


    signingConfigs {
    signingConfigs {
        release {
        release {
            keyAlias keystoreProperties['keyAlias']
            keyAlias = keystoreProperties['keyAlias']
            keyPassword keystoreProperties['keyPassword']
            keyPassword = keystoreProperties['keyPassword']
            storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
            storeFile = keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
            storePassword keystoreProperties['storePassword']
            storePassword = keystoreProperties['storePassword']
        }
        }
    }
    }
    buildTypes {
    buildTypes {
        release {
        release {
            signingConfig signingConfigs.release
            signingConfig = signingConfigs.release
        }
    }

    splits {
        abi {
            reset()
            include 'armeabi', 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
        }
    }
}

ext.abiCodes = [
    'x86': 1,
    'x86_64': 2,
    'armeabi': 3,
    'armeabi-v7a': 4,
    'arm64-v8a': 5,
]

import com.android.build.OutputFile

android.applicationVariants.all { variant ->
  variant.outputs.each { output ->
    def perAbiVersionCodeIncrement = project.ext.abiCodes.get(output.getFilter(OutputFile.ABI))

    if (perAbiVersionCodeIncrement != null) {
      output.versionCodeOverride = variant.versionCode * 1000 + perAbiVersionCodeIncrement
    }
    }
  }
  }
}
}


flutter {
flutter {
    source '../..'
    source = "../.."
}
}
Original line number Original line Diff line number Diff line
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
    package="org.benoitharrault.snake">
    <!-- Flutter needs it to communicate with the running application
         to allow setting breakpoints, to provide hot reload, etc.
    -->
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.INTERNET"/>
</manifest>
</manifest>
Original line number Original line Diff line number Diff line
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
    package="org.benoitharrault.snake">
    <application
    <application
        android:label="snake"
        android:label="snake"
        android:name="${applicationName}"
        android:icon="@mipmap/ic_launcher">
        android:icon="@mipmap/ic_launcher">
        <activity
        <activity
            android:name=".MainActivity"
            android:name=".MainActivity"
            android:exported="true"
            android:launchMode="singleTop"
            android:launchMode="singleTop"
            android:taskAffinity=""
            android:theme="@style/LaunchTheme"
            android:theme="@style/LaunchTheme"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:hardwareAccelerated="true"
            android:hardwareAccelerated="true"
@@ -27,4 +29,10 @@
            android:name="flutterEmbedding"
            android:name="flutterEmbedding"
            android:value="2" />
            android:value="2" />
    </application>
    </application>
    <queries>
        <intent>
            <action android:name="android.intent.action.PROCESS_TEXT"/>
            <data android:mimeType="text/plain"/>
        </intent>
    </queries>
</manifest>
</manifest>
Original line number Original line Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="?android:colorBackground" />
    <item android:drawable="?android:colorBackground" />


    <!-- You can insert your own image assets here -->
    <item>
    <!-- <item>
        <bitmap
        <bitmap
            android:gravity="center"
            android:gravity="center"
            android:src="@mipmap/launch_image" />
            android:src="@mipmap/launch_image" />
    </item> -->
    </item>
</layer-list>
</layer-list>
Original line number Original line Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@android:color/white" />
    <item android:drawable="@android:color/white" />


    <!-- You can insert your own image assets here -->
    <item>
    <!-- <item>
        <bitmap
        <bitmap
            android:gravity="center"
            android:gravity="center"
            android:src="@mipmap/launch_image" />
            android:src="@mipmap/launch_image" />
    </item> -->
    </item>
</layer-list>
</layer-list>
Original line number Original line Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<resources>
    <!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
    <style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
    <style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
        <!-- Show a splash screen on the activity. Automatically removed when
             Flutter draws its first frame -->
        <item name="android:windowBackground">@drawable/launch_background</item>
        <item name="android:windowBackground">@drawable/launch_background</item>
    </style>
    </style>
    <!-- Theme applied to the Android Window as soon as the process has started.
         This theme determines the color of the Android Window while your
         Flutter UI initializes, as well as behind your Flutter UI while its
         running.
         
         This Theme is only used starting with V2 of Flutter's Android embedding. -->
    <style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
    <style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
        <item name="android:windowBackground">?android:colorBackground</item>
        <item name="android:windowBackground">?android:colorBackground</item>
    </style>
    </style>
Original line number Original line Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<resources>
    <!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
    <style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
    <style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
        <!-- Show a splash screen on the activity. Automatically removed when
             Flutter draws its first frame -->
        <item name="android:windowBackground">@drawable/launch_background</item>
        <item name="android:windowBackground">@drawable/launch_background</item>
    </style>
    </style>
    <!-- Theme applied to the Android Window as soon as the process has started.
         This theme determines the color of the Android Window while your
         Flutter UI initializes, as well as behind your Flutter UI while its
         running.
         
         This Theme is only used starting with V2 of Flutter's Android embedding. -->
    <style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
    <style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
        <item name="android:windowBackground">?android:colorBackground</item>
        <item name="android:windowBackground">?android:colorBackground</item>
    </style>
    </style>
Original line number Original line Diff line number Diff line
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
    package="org.benoitharrault.snake">
    <!-- Flutter needs it to communicate with the running application
         to allow setting breakpoints, to provide hot reload, etc.
    -->
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.INTERNET"/>
</manifest>
</manifest>
Original line number Original line Diff line number Diff line
buildscript {
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:4.1.0'
    }
}

allprojects {
allprojects {
    repositories {
    repositories {
        google()
        google()
        jcenter()
        mavenCentral()
    }
    }
}
}


rootProject.buildDir = '../build'
rootProject.buildDir = "../build"
subprojects {
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
}
subprojects {
subprojects {
    project.evaluationDependsOn(':app')
    project.evaluationDependsOn(":app")
}
}


task clean(type: Delete) {
tasks.register("clean", Delete) {
    delete rootProject.buildDir
    delete rootProject.buildDir
}
}
Original line number Original line Diff line number Diff line
org.gradle.jvmargs=-Xmx1536M
org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError
android.useAndroidX=true
android.useAndroidX=true
android.enableJetifier=true
android.enableJetifier=true
app.versionName=0.0.1
app.versionCode=1
Original line number Original line Diff line number Diff line
#Fri Jun 23 08:50:38 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
Original line number Original line Diff line number Diff line
include ':app'
pluginManagement {

    def flutterSdkPath = {
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
        def properties = new Properties()
        def properties = new Properties()

        file("local.properties").withInputStream { properties.load(it) }
assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }

        def flutterSdkPath = properties.getProperty("flutter.sdk")
        def flutterSdkPath = properties.getProperty("flutter.sdk")
        assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
        assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
        return flutterSdkPath
    }()

    includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")

    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
    }
}

plugins {
    id "dev.flutter.flutter-plugin-loader" version "1.0.0"
    id "com.android.application" version "8.1.0" apply false
    id "org.jetbrains.kotlin.android" version "1.8.22" apply false
}

include ":app"
+12 −0
Original line number Original line Diff line number Diff line
{
  "app_name": "Snake",

  "settings_title": "Settings",
  "settings_label_theme": "Theme mode",

  "about_title": "Informations",
  "about_content": "Snake",
  "about_version": "Version: {version}",

  "": ""
}
+12 −0
Original line number Original line Diff line number Diff line
{
  "app_name": "Serpent",

  "settings_title": "Réglages",
  "settings_label_theme": "Thème de couleurs",

  "about_title": "Informations",
  "about_content": "Serpent.",
  "about_version": "Version : {version}",

  "": ""
}

fdroid_metadata.yml

0 → 100644
+16 −0
Original line number Original line Diff line number Diff line
AuthorName:   'Benoît Harrault'
Categories:
  - Games
Name:         Snake game
AutoName:     snake
License:      GPL-3.0-only
WebSite:      'https://git.harrault.fr/android/org.benoitharrault.snake'
SourceCode:   'https://git.harrault.fr/android/org.benoitharrault.snake'
IssueTracker: 'https://git.harrault.fr/android/org.benoitharrault.snake/issues'
Changelog:    'https://git.harrault.fr/android/org.benoitharrault.snake/-/tags'
Summary:      Snake game, simple and classic
Description:  |
  Snake game, simple and classic
RepoType:     git
Repo:         'https://git.harrault.fr/android/org.benoitharrault.snake.git'
FdroidAppUrl: 'https://f-droid.org/fr/packages/org.benoitharrault.snake/'

icons/build_application_icons.sh

deleted100755 → 0
+0 −93
Original line number Original line Diff line number Diff line
#! /bin/bash

# Check dependencies
command -v inkscape >/dev/null 2>&1 || { echo >&2 "I require inkscape but it's not installed. Aborting."; exit 1; }
command -v scour >/dev/null 2>&1 || { echo >&2 "I require scour but it's not installed. Aborting."; exit 1; }
command -v optipng >/dev/null 2>&1 || { echo >&2 "I require optipng but it's not installed. Aborting."; exit 1; }

CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
BASE_DIR="$(dirname "${CURRENT_DIR}")"

SOURCE="${CURRENT_DIR}/icon.svg"
SOURCE_FASTLANE="${CURRENT_DIR}/featureGraphic.svg"

OPTIPNG_OPTIONS="-preserve -quiet -o7"

if [ ! -f "${SOURCE}" ]; then
  echo "Missing file: ${SOURCE}"
fi

if [ ! -f "${SOURCE_FASTLANE}" ]; then
  echo "Missing file: ${SOURCE_FASTLANE}"
fi

# optimize svg
cp ${SOURCE} ${SOURCE}.tmp
scour \
    --remove-descriptive-elements \
    --enable-id-stripping \
    --enable-viewboxing \
    --enable-comment-stripping \
    --nindent=4 \
    --quiet \
    -i ${SOURCE}.tmp \
    -o ${SOURCE}
rm ${SOURCE}.tmp

# build icons
function build_icon() {
  ICON_SIZE="$1"
  TARGET="$2"

  echo "Building ${TARGET}"

  TARGET_PNG="${TARGET}.png"

  inkscape \
      --export-width=${ICON_SIZE} \
      --export-height=${ICON_SIZE} \
      --export-filename=${TARGET_PNG} \
      ${SOURCE}

  optipng ${OPTIPNG_OPTIONS} ${TARGET_PNG}
}

# build fastlane image
function build_fastlane_image() {
  WIDTH="$1"
  HEIGHT="$2"
  TARGET="$3"

  echo "Building ${TARGET}"

  cp ${SOURCE_FASTLANE} ${SOURCE_FASTLANE}.tmp
  scour \
      --remove-descriptive-elements \
      --enable-id-stripping \
      --enable-viewboxing \
      --enable-comment-stripping \
      --nindent=4 \
      --quiet \
      -i ${SOURCE_FASTLANE}.tmp \
      -o ${SOURCE_FASTLANE}
  rm ${SOURCE_FASTLANE}.tmp

  TARGET_PNG="${TARGET}.png"

  inkscape \
      --export-width=${WIDTH} \
      --export-height=${HEIGHT} \
      --export-filename=${TARGET_PNG} \
      ${SOURCE_FASTLANE}

  optipng ${OPTIPNG_OPTIONS} ${TARGET_PNG}
}

build_icon  72 ${BASE_DIR}/android/app/src/main/res/mipmap-hdpi/ic_launcher
build_icon  48 ${BASE_DIR}/android/app/src/main/res/mipmap-mdpi/ic_launcher
build_icon  96 ${BASE_DIR}/android/app/src/main/res/mipmap-xhdpi/ic_launcher
build_icon 144 ${BASE_DIR}/android/app/src/main/res/mipmap-xxhdpi/ic_launcher
build_icon 192 ${BASE_DIR}/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher
build_icon 512 ${BASE_DIR}/fastlane/metadata/android/en-US/images/icon

build_fastlane_image 1024 500 ${BASE_DIR}/fastlane/metadata/android/en-US/images/featureGraphic

icons/build_game_icons.sh

deleted100755 → 0
+0 −109
Original line number Original line Diff line number Diff line
#! /bin/bash

# Check dependencies
command -v inkscape >/dev/null 2>&1 || { echo >&2 "I require inkscape but it's not installed. Aborting."; exit 1; }
command -v scour >/dev/null 2>&1 || { echo >&2 "I require scour but it's not installed. Aborting."; exit 1; }
command -v optipng >/dev/null 2>&1 || { echo >&2 "I require optipng but it's not installed. Aborting."; exit 1; }

CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
BASE_DIR="$(dirname "${CURRENT_DIR}")"

OPTIPNG_OPTIONS="-preserve -quiet -o7"
ICON_SIZE=192

#######################################################

# Game images
AVAILABLE_GAME_IMAGES="
  button_back
  button_start
  game_fail
  game_win
  level_easy
  level_normal
  level_hard
  level_nightmare
"

# Skins
AVAILABLE_SKINS="
  retro
  colors
"

# Images per skin
SKIN_IMAGES="
  empty
  head
  body
  fruit
"

#######################################################

# optimize svg
function optimize_svg() {
  SOURCE="$1"

  cp ${SOURCE} ${SOURCE}.tmp
  scour \
      --remove-descriptive-elements \
      --enable-id-stripping \
      --enable-viewboxing \
      --enable-comment-stripping \
      --nindent=4 \
      --quiet \
      -i ${SOURCE}.tmp \
      -o ${SOURCE}
  rm ${SOURCE}.tmp
}

# build icons
function build_icon() {
  SOURCE="$1"
  TARGET="$2"

  echo "Building ${TARGET}"

  if [ ! -f "${SOURCE}" ]; then
    echo "Missing file: ${SOURCE}"
  fi

  optimize_svg "${SOURCE}"

  inkscape \
      --export-width=${ICON_SIZE} \
      --export-height=${ICON_SIZE} \
      --export-filename=${TARGET} \
      ${SOURCE}

  optipng ${OPTIPNG_OPTIONS} ${TARGET}
}

function build_icon_for_skin() {
  SKIN_CODE="$1"

  # skin main image
  build_icon ${CURRENT_DIR}/skin_${SKIN_CODE}.svg ${BASE_DIR}/assets/icons/skin_${SKIN_CODE}.png

  # skin images
  for SKIN_IMAGE in ${SKIN_IMAGES}
  do
    build_icon ${CURRENT_DIR}/skins/${SKIN_CODE}/${SKIN_IMAGE}.svg ${BASE_DIR}/assets/skins/${SKIN_CODE}_${SKIN_IMAGE}.png
  done
}

mkdir -p ${BASE_DIR}/assets/icons
mkdir -p ${BASE_DIR}/assets/skins

# build game images
for GAME_IMAGE in ${AVAILABLE_GAME_IMAGES}
do
  build_icon ${CURRENT_DIR}/${GAME_IMAGE}.svg ${BASE_DIR}/assets/icons/${GAME_IMAGE}.png
done

# build skins images
for SKIN in ${AVAILABLE_SKINS}
do
  build_icon_for_skin "${SKIN}"
done

icons/button_back.svg

deleted100644 → 0
+0 −2
Original line number Original line Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<svg enable-background="new 0 0 100 100" version="1.1" viewBox="0 0 93.665 93.676" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><rect x=".44662" y=".89101" width="92.772" height="91.894" ry="11.689" fill="#e41578" stroke="#fff" stroke-width=".238"/><path d="m59.387 71.362c1.1248 1.1302 4.0012 1.1302 4.0012 0v-45.921c0-1.1316-2.8832-1.1316-4.0121 0l-37.693 20.918c-1.1289 1.1248-1.1479 2.9551-0.02171 4.084z" fill="#fefeff" stroke="#930e4e" stroke-linecap="round" stroke-linejoin="round" stroke-width="8.257"/><path d="m57.857 68.048c0.96243 0.96706 3.4236 0.96706 3.4236 0v-39.292c0-0.96825-2.467-0.96825-3.4329 0l-32.252 17.898c-0.96594 0.96243-0.9822 2.5285-0.01858 3.4945z" fill="#fefeff" stroke="#feffff" stroke-linecap="round" stroke-linejoin="round" stroke-width="4.314"/></svg>

icons/button_start.svg

deleted100644 → 0
+0 −2
Original line number Original line Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<svg enable-background="new 0 0 100 100" version="1.1" viewBox="0 0 93.665 93.676" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><rect x=".44662" y=".89101" width="92.772" height="91.894" ry="11.689" fill="#49a1ee" stroke="#fff" stroke-width=".238"/><path d="m34.852 25.44c-1.1248-1.1302-4.0012-1.1302-4.0012 0v45.921c0 1.1316 2.8832 1.1316 4.0121 0l37.693-20.918c1.1289-1.1248 1.1479-2.9551 0.02171-4.084z" fill="#fefeff" stroke="#105ca1" stroke-linecap="round" stroke-linejoin="round" stroke-width="8.257"/><path d="m36.382 28.754c-0.96243-0.96706-3.4236-0.96706-3.4236 0v39.292c0 0.96825 2.467 0.96825 3.4329 0l32.252-17.898c0.96594-0.96243 0.9822-2.5285 0.01858-3.4945z" fill="#fefeff" stroke="#feffff" stroke-linecap="round" stroke-linejoin="round" stroke-width="4.314"/></svg>

icons/level_hard.svg

deleted100644 → 0
+0 −2
Original line number Original line Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<svg enable-background="new 0 0 100 100" version="1.1" viewBox="0 0 102 102" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="1" width="100" height="100" ry="0" fill="#db8616" stroke="#000" stroke-width="2"/></svg>

icons/level_nightmare.svg

deleted100644 → 0
+0 −2
Original line number Original line Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<svg enable-background="new 0 0 100 100" version="1.1" viewBox="0 0 102 102" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="1" width="100" height="100" ry="0" fill="#db1616" stroke="#000" stroke-width="2"/></svg>

icons/level_normal.svg

deleted100644 → 0
+0 −2
Original line number Original line Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<svg enable-background="new 0 0 100 100" version="1.1" viewBox="0 0 102 102" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="1" width="100" height="100" ry="0" fill="#6a78de" stroke="#000" stroke-width="2"/></svg>

icons/skin_colors.svg

deleted100644 → 0
+0 −2
Original line number Original line Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<svg enable-background="new 0 0 100 100" version="1.1" viewBox="0 0 102 102" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="1" width="100" height="100" ry="0" fill="#be6ade" stroke="#000" stroke-width="2"/><rect x="8.5767" y="8.6213" width="14.139" height="14.139" fill="#353ab0" stroke="#fff" stroke-linecap="round" stroke-width="3.6305"/><rect x="22.27" y="8.6213" width="14.139" height="14.139" fill="#353ab0" stroke="#fff" stroke-linecap="round" stroke-width="3.6305"/><rect x="36.557" y="8.6213" width="14.139" height="14.139" fill="#353ab0" stroke="#fff" stroke-linecap="round" stroke-width="3.6305"/><rect x="50.844" y="8.6213" width="14.139" height="14.139" fill="#353ab0" stroke="#fff" stroke-linecap="round" stroke-width="3.6305"/><rect x="50.844" y="22.864" width="14.139" height="14.139" fill="#353ab0" stroke="#fff" stroke-linecap="round" stroke-width="3.6305"/><rect x="50.844" y="37.105" width="14.139" height="14.139" fill="#353ab0" stroke="#fff" stroke-linecap="round" stroke-width="3.6305"/><rect x="50.844" y="51.285" width="14.139" height="14.139" fill="#353ab0" stroke="#fff" stroke-linecap="round" stroke-width="3.6305"/><rect x="65.064" y="51.285" width="14.139" height="14.139" fill="#353ab0" stroke="#fff" stroke-linecap="round" stroke-width="3.6305"/><rect x="79.284" y="51.285" width="14.139" height="14.139" fill="#353ab0" stroke="#fff" stroke-linecap="round" stroke-width="3.6305"/><rect x="79.284" y="65.266" width="14.139" height="14.139" fill="#353ab0" stroke="#fff" stroke-linecap="round" stroke-width="3.6305"/><rect x="79.284" y="79.24" width="14.139" height="14.139" fill="#353ab0" stroke="#fff" stroke-linecap="round" stroke-width="3.6305"/><rect x="65.064" y="79.24" width="14.139" height="14.139" fill="#353ab0" stroke="#fff" stroke-linecap="round" stroke-width="3.6305"/><rect x="50.844" y="79.24" width="14.139" height="14.139" fill="#353ab0" stroke="#fff" stroke-linecap="round" stroke-width="3.6305"/><rect x="36.557" y="79.24" width="14.139" height="14.139" fill="#353ab0" stroke="#fff" stroke-linecap="round" stroke-width="3.6305"/><rect x="22.27" y="79.24" width="14.139" height="14.139" fill="#353ab0" stroke="#fff" stroke-linecap="round" stroke-width="3.6305"/><rect x="22.27" y="65.266" width="14.139" height="14.139" fill="#2d00e0" stroke="#fff" stroke-linecap="round" stroke-width="3.6305"/><circle cx="29.34" cy="44.175" r="5.7602" fill="#209239" stroke="#1c6e24" stroke-linecap="round" stroke-width="4.2294"/></svg>

icons/skin_retro.svg

deleted100644 → 0
+0 −2
Original line number Original line Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<svg enable-background="new 0 0 100 100" version="1.1" viewBox="0 0 102 102" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="1" width="100" height="100" ry="0" fill="#be6ade" stroke="#000" stroke-width="2"/><rect x="8.5767" y="8.6213" width="14.139" height="14.139" fill="#727272" stroke="#fff" stroke-linecap="round" stroke-width="3.6305"/><rect x="22.27" y="8.6213" width="14.139" height="14.139" fill="#727272" stroke="#fff" stroke-linecap="round" stroke-width="3.6305"/><rect x="36.557" y="8.6213" width="14.139" height="14.139" fill="#727272" stroke="#fff" stroke-linecap="round" stroke-width="3.6305"/><rect x="50.844" y="8.6213" width="14.139" height="14.139" fill="#727272" stroke="#fff" stroke-linecap="round" stroke-width="3.6305"/><rect x="50.844" y="22.864" width="14.139" height="14.139" fill="#727272" stroke="#fff" stroke-linecap="round" stroke-width="3.6305"/><rect x="50.844" y="37.105" width="14.139" height="14.139" fill="#727272" stroke="#fff" stroke-linecap="round" stroke-width="3.6305"/><rect x="50.844" y="51.285" width="14.139" height="14.139" fill="#727272" stroke="#fff" stroke-linecap="round" stroke-width="3.6305"/><rect x="65.064" y="51.285" width="14.139" height="14.139" fill="#727272" stroke="#fff" stroke-linecap="round" stroke-width="3.6305"/><rect x="79.284" y="51.285" width="14.139" height="14.139" fill="#727272" stroke="#fff" stroke-linecap="round" stroke-width="3.6305"/><rect x="79.284" y="65.266" width="14.139" height="14.139" fill="#727272" stroke="#fff" stroke-linecap="round" stroke-width="3.6305"/><rect x="79.284" y="79.24" width="14.139" height="14.139" fill="#727272" stroke="#fff" stroke-linecap="round" stroke-width="3.6305"/><rect x="65.064" y="79.24" width="14.139" height="14.139" fill="#727272" stroke="#fff" stroke-linecap="round" stroke-width="3.6305"/><rect x="50.844" y="79.24" width="14.139" height="14.139" fill="#727272" stroke="#fff" stroke-linecap="round" stroke-width="3.6305"/><rect x="36.557" y="79.24" width="14.139" height="14.139" fill="#727272" stroke="#fff" stroke-linecap="round" stroke-width="3.6305"/><rect x="22.27" y="79.24" width="14.139" height="14.139" fill="#727272" stroke="#fff" stroke-linecap="round" stroke-width="3.6305"/><rect x="22.27" y="65.266" width="14.139" height="14.139" fill="#6f6f71" stroke="#fff" stroke-linecap="round" stroke-width="3.6305"/><circle cx="29.34" cy="44.175" r="5.7602" fill="#595959" stroke="#454545" stroke-linecap="round" stroke-width="4.2294"/></svg>

ios/Flutter/Generated.xcconfig

deleted100644 → 0
+0 −13
Original line number Original line Diff line number Diff line
// This is a generated file; do not edit or check into version control.
FLUTTER_ROOT=/home/benoit/snap/flutter/common/flutter
FLUTTER_APPLICATION_PATH=/home/benoit/dev/perso/android/org.benoitharrault.snake
COCOAPODS_PARALLEL_CODE_SIGN=true
FLUTTER_TARGET=lib/main.dart
FLUTTER_BUILD_DIR=build
FLUTTER_BUILD_NAME=1.0.0
FLUTTER_BUILD_NUMBER=1
EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386
DART_OBFUSCATION=false
TRACK_WIDGET_CREATION=false
TREE_SHAKE_ICONS=false
PACKAGE_CONFIG=.dart_tool/package_config.json
+0 −13
Original line number Original line Diff line number Diff line
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=/home/benoit/snap/flutter/common/flutter"
export "FLUTTER_APPLICATION_PATH=/home/benoit/dev/perso/android/org.benoitharrault.snake"
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_TARGET=lib/main.dart"
export "FLUTTER_BUILD_DIR=build"
export "FLUTTER_BUILD_NAME=1.0.0"
export "FLUTTER_BUILD_NUMBER=1"
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=false"
export "TREE_SHAKE_ICONS=false"
export "PACKAGE_CONFIG=.dart_tool/package_config.json"
+0 −19
Original line number Original line Diff line number Diff line
//
//  Generated file. Do not edit.
//

// clang-format off

#ifndef GeneratedPluginRegistrant_h
#define GeneratedPluginRegistrant_h

#import <Flutter/Flutter.h>

NS_ASSUME_NONNULL_BEGIN

@interface GeneratedPluginRegistrant : NSObject
+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry;
@end

NS_ASSUME_NONNULL_END
#endif /* GeneratedPluginRegistrant_h */
+0 −21
Original line number Original line Diff line number Diff line
//
//  Generated file. Do not edit.
//

// clang-format off

#import "GeneratedPluginRegistrant.h"

#if __has_include(<shared_preferences_ios/FLTSharedPreferencesPlugin.h>)
#import <shared_preferences_ios/FLTSharedPreferencesPlugin.h>
#else
@import shared_preferences_ios;
#endif

@implementation GeneratedPluginRegistrant

+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry {
  [FLTSharedPreferencesPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTSharedPreferencesPlugin"]];
}

@end

lib/config/menu.dart

0 → 100644
+52 −0

File added.

Preview size limit exceeded, changes collapsed.

+37 −0

File added.

Preview size limit exceeded, changes collapsed.

lib/layout/game.dart

deleted100644 → 0
+0 −78

File deleted.

Preview size limit exceeded, changes collapsed.

lib/layout/parameters.dart

deleted100644 → 0
+0 −118

File deleted.

Preview size limit exceeded, changes collapsed.

+95 −21

File changed.

Preview size limit exceeded, changes collapsed.

lib/provider/data.dart

deleted100644 → 0
+0 −89

File deleted.

Preview size limit exceeded, changes collapsed.

lib/screens/home.dart

deleted100644 → 0
+0 −68

File deleted.

Preview size limit exceeded, changes collapsed.

lib/ui/skeleton.dart

0 → 100644
+34 −0

File added.

Preview size limit exceeded, changes collapsed.

lib/utils/game_utils.dart

deleted100644 → 0
+0 −18

File deleted.

Preview size limit exceeded, changes collapsed.

+274 −121

File changed.

Preview size limit exceeded, changes collapsed.

+20 −11

File changed.

Preview size limit exceeded, changes collapsed.

test/widget_test.dart

deleted100644 → 0
+0 −30

File deleted.

Preview size limit exceeded, changes collapsed.