Skip to content

Commit

Permalink
Copy for build
Browse files Browse the repository at this point in the history
  • Loading branch information
ignaciaurrutia committed Jul 3, 2024
1 parent 2706a26 commit 619ba41
Show file tree
Hide file tree
Showing 261 changed files with 14,647 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
.env

# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/

# Symbolication related
app.*.symbols

# Obfuscation related
app.*.map.json

# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release
45 changes: 45 additions & 0 deletions .metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled.

version:
revision: 2ad6cd72c040113b47ee9055e722606a490ef0da
channel: stable

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: 2ad6cd72c040113b47ee9055e722606a490ef0da
base_revision: 2ad6cd72c040113b47ee9055e722606a490ef0da
- platform: android
create_revision: 2ad6cd72c040113b47ee9055e722606a490ef0da
base_revision: 2ad6cd72c040113b47ee9055e722606a490ef0da
- platform: ios
create_revision: 2ad6cd72c040113b47ee9055e722606a490ef0da
base_revision: 2ad6cd72c040113b47ee9055e722606a490ef0da
- platform: linux
create_revision: 2ad6cd72c040113b47ee9055e722606a490ef0da
base_revision: 2ad6cd72c040113b47ee9055e722606a490ef0da
- platform: macos
create_revision: 2ad6cd72c040113b47ee9055e722606a490ef0da
base_revision: 2ad6cd72c040113b47ee9055e722606a490ef0da
- platform: web
create_revision: 2ad6cd72c040113b47ee9055e722606a490ef0da
base_revision: 2ad6cd72c040113b47ee9055e722606a490ef0da
- platform: windows
create_revision: 2ad6cd72c040113b47ee9055e722606a490ef0da
base_revision: 2ad6cd72c040113b47ee9055e722606a490ef0da

# User provided section

# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
10 changes: 10 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"configurations": [
{
"name": "Flutter",
"program": "lib/main.dart",
"request": "launch",
"type": "dart"
}
]
}
82 changes: 82 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@

# Aplicación Móvil en Flutter - Mi Tribu

## Copiar el repositorio de la aplicación móvil en el computador
#### En GitHub
* Entrar a github, al link del repositorio: https://github.com/iic2154-uc-cl/2024-1-S2-Grupo5-Movil/tree/main
* Seleccionar en la parte derecha el botón: <>Code
* Verificar que esté marcada la opción HTTPS.
* Copiar el vínculo que aparece ahí. En este caso: https://github.com/iic2154-uc-cl/2024-1-S2-Grupo5-Movil.git

#### En el computador
* Abrir la carpeta o el lugar donde se quiera clonar el repositorio
* Hacer click derecho -> Mostrar más opciones
* Seleccionar "Open Git Bash Here"
* Una vez abierta la terminal de git, escribir lo siguiente "git clone" + link del repositorio. En este caso, el comando quedaría como: git clone https://github.com/iic2154-uc-cl/2024-1-S2-Grupo5-Movil.git.
* Una vez hecho aquello, se puede abrir la carpeta directamente arrastrándola a Visual Studio Code.

## Descargar e instalar flutter en el computador
Dependiendo del tipo de dispositivo (Windows, iOS, Linux), se tendrán distintas configuraciones y pasos a seguir para utilizar Flutter y Dart. A continuación, se encuentra el vínculo donde se pueden encontrar las instrucciones de instalación para cada tipo de dispositivo: https://docs.flutter.dev/get-started/install

Si se quiere trabajar el código en un dispositivo **iOS**:
* **Instalar Xcode:** emulador de celulares con iOS.
* **Instalar AndroidStudio:** emulador de celulares con Android.

Si se quiere trabajar el código en un dispositivo **Windows**:
* **Xcode:** no disponible.
* **Instalar AndroidStudio:** emulador de celulares con Android.

Si se quiere trabajar el código en un dispositivo **Linux**:
* **Xcode:** no disponible.
* **Instalar AndroidStudio:** emulador de celulares con Android.

Las instrucciones para instalar cada emulador y sus configuraciones correspondientes están en el mismo link que se adjuntó para instalar Flutter.

## Definición del archivo .env

Se debe crear el archivo de manera local en el computador (.env) y pegar la información que está a continuación para las credenciales:

#### #Ruta del Backend
API_URL= https://two024-1-s2-grupo5-backend.onrender.com

#### #Auth0 Domain
AUTH0_DOMAIN= dev-063pxjuasg8ozybk.us.auth0.com

#### #Client Id de Auth0
AUTH0_CLIENT_ID= Vc6EbiCOnVPRetYK8x1xqodqZxDL4gQW

#### #The custom scheme for the Android callback and logout URLs
AUTH0_CUSTOM_SCHEME=flutterdemo

## Correr la aplicación en Visual Studio Code

Una vez abierta la carpeta y creado el archivo .env, se deben llevar a cabo los siguientes pasos:
* Instalar las extensiones de Flutter y Dart.
* Correr en la terminal: ***flutter pub get***
* Abrir el emulador: abajo a la derecha en VSCode donde sale "No Device" o tal vez "Chrome (web-javascript)", pinchar y seleccionar el emulador que se quiere usar.
* Luego correr:
* * Modo Debug: con el teclado hacer ***Fn + F5***, o entrar en VSCode a "Run and Debug" y ponerle play arriba.
* * Aplicación de forma normal: ***flutter run***

## Hacer un APK para Android

Para crear un nuevo APK, se deben llevar a cabo los siguientes pasos:
* Correr en la terminal: ***flutter build apk***
* Una vez termine aquello, entrar al repositorio público donde se quiere hacer el realese en github y en el menú de la derecha seleccionar *Releases*.
* Dentro de *Releases*, presionar el botón *Draft a new release*.
* Se deben completar el nombre del release y el tag.
* Por otro lado, se debe subir el archivo apk que se creó. Se debe navegar hasta la ruta *buil/app/outputs/flutter-apk/app-release.apk*, y seleccionar el archivo *app-release.apk*.
* Finalmente, se debe presionar el botón *Publish release*, y a través del link que se genere del release, se puede descargar el apk en cualquier teléfono Android.

## Información Adicional

### ¿Problemas ingresando con Auth0 en Android Studio?
Si la pantalla se pone negra o aparecen imágenes borrosas de fondo cuando se intenta entrar a la aplicación utilizando Auth0, como un _glitch_, se debe revisar la configuración dentro de Android Studio. Seguir los siguientes pasos:

* Abrir Android Studio
* Ir Device Manager
* Tocar los 3 puntos en el lado derecho del dispositivo que se está utilizando
* Apretar "Edit"
* Bajar hasta encontrar Emulated Performance
* En el campo de Graphics, seleccionar Software

1 change: 1 addition & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include: package:flutter_lints/flutter.yaml
13 changes: 13 additions & 0 deletions android/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
gradle-wrapper.jar
/.gradle
/captures/
/gradlew
/gradlew.bat
/local.properties
GeneratedPluginRegistrant.java

# Remember to never publicly share your keystore.
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
key.properties
**/*.keystore
**/*.jks
73 changes: 73 additions & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.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 flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

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

android {
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.teslo_shop"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 21
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
manifestPlaceholders += [auth0Domain: "dev-s4822gfw7v8k0olc.us.auth0.com", auth0Scheme: "flutterdemo"]
}

buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}

flutter {
source '../..'
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
19 changes: 19 additions & 0 deletions android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.teslo_shop">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool 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.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>
<application
android:requestLegacyExternalStorage="true"
android:label="Mi Tribu Stork"
tools:replace="android:label"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
</application>
</manifest>
40 changes: 40 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.teslo_shop">
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>
<application
android:requestLegacyExternalStorage="true"
android:label="Mi Tribu Stork"
tools:replace="android:label"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.example.teslo_shop

import io.flutter.embedding.android.FlutterActivity

class MainActivity: FlutterActivity() {
}
12 changes: 12 additions & 0 deletions android/app/src/main/res/drawable-v21/launch_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?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">
<item android:drawable="?android:colorBackground" />

<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>
12 changes: 12 additions & 0 deletions android/app/src/main/res/drawable/launch_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?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">
<item android:drawable="@android:color/white" />

<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>
Binary file added android/app/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added android/app/src/main/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions android/app/src/main/res/values-night/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<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">
<!-- Show a splash screen on the activity. Automatically removed when
the Flutter engine draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</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">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>
Loading

0 comments on commit 619ba41

Please sign in to comment.