diff --git a/backend/src/app.module.ts b/backend/src/app.module.ts index 636933b28ed8c7739c53edc434ca2139a9ed41b2..2e4eec96e9b9083f39d366302d91888b7f968185 100644 --- a/backend/src/app.module.ts +++ b/backend/src/app.module.ts @@ -1,4 +1,4 @@ -import { Module } from '@nestjs/common'; +import { Module, OnModuleDestroy, OnModuleInit } from '@nestjs/common'; import { AppController } from './app.controller'; import { AppService } from './app.service'; import { TypeOrmModule } from '@nestjs/typeorm'; @@ -9,6 +9,11 @@ import { Admin } from './admin/entities/admin.entity'; import { User } from './user/entities/user.entity'; import { JwtModule } from '@nestjs/jwt'; import { AuthUserModule } from './auth-user/auth-user.module'; +import { CityModule } from './city/city.module'; +import { City } from './city/entities/city.entity'; +import { CityService } from './city/city.service'; +import { Place } from './place/entities/place.entity'; +import { PlaceModule } from './place/place.module'; dotenv.config() @Module({ @@ -20,15 +25,29 @@ dotenv.config() username: process.env.DATABASE_USER, password: process.env.DATABASE_PASSWORD, database: process.env.DATABASE_NAME, - entities: [Admin, User], + entities: [Admin, User,City,Place], synchronize: true, }), AdminModule, UserModule, JwtModule, AuthUserModule, + CityModule, + PlaceModule ], controllers: [AppController], //rutas providers: [AppService], //funciones para comunicarse en la bd }) -export class AppModule {} +/* +Esta clase solo se usara al principio para no tener que ingresar los datos manuelamente a la tabala city + +Este deberia de ser el adecuando una vez finalizado +export class AppModule{} + +*/ +export class AppModule implements OnModuleInit{ + constructor(private readonly cityService:CityService){} + async onModuleInit() { + await this.cityService.initializeData(); // Inicialización de datos de City al inicio + } +} diff --git a/backend/src/city/city.controller.ts b/backend/src/city/city.controller.ts new file mode 100644 index 0000000000000000000000000000000000000000..e72242b9f35000522d506bcb1363f1241108e31d --- /dev/null +++ b/backend/src/city/city.controller.ts @@ -0,0 +1,36 @@ +import { Controller, Get, Post, Body, Patch, Param, Delete, Query, BadRequestException } from '@nestjs/common'; +import { CityService } from './city.service'; +import { CreateCityDto } from './dto/create-city.dto'; +import { get } from 'http'; + +@Controller('city') +export class CityController{ + constructor(private readonly cityService: CityService){} + + @Post() + findALL(@Body()createCityDto:CreateCityDto){ + return this.cityService.findAll; + } + + @Get('name') + async getCityName(@Query('id') id: string): Promise<{ name: string }> { + const cityId = parseInt(id, 10); + if (isNaN(cityId)) { + throw new BadRequestException('Invalid city ID'); + } + + const name = await this.cityService.getCityNameById(cityId); + return { name }; + } + + @Get('description') + async getCityDescirption(@Query('id') id: string): Promise<{ description: string }> { + const cityId = parseInt(id, 10); + if (isNaN(cityId)) { + throw new BadRequestException('Invalid city ID'); + } + + const description = await this.cityService.getCityDescriptionById(cityId); + return { description }; + } +} \ No newline at end of file diff --git a/backend/src/city/city.module.ts b/backend/src/city/city.module.ts new file mode 100644 index 0000000000000000000000000000000000000000..493341d7b184b0d611e6d150da75225e5510ed29 --- /dev/null +++ b/backend/src/city/city.module.ts @@ -0,0 +1,13 @@ +import { TypeOrmModule } from '@nestjs/typeorm'; +import { Module } from '@nestjs/common'; +import { CityService } from './city.service'; +import { CityController } from './city.controller'; +import { City } from './entities/city.entity'; + +@Module({ + imports: [TypeOrmModule.forFeature([City])], + controllers:[CityController], + providers:[CityService], + exports:[CityService] +}) +export class CityModule{} \ No newline at end of file diff --git a/backend/src/city/city.service.spec.ts b/backend/src/city/city.service.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..070afa1da96797cd9efd7d64714df26f426a5e8c --- /dev/null +++ b/backend/src/city/city.service.spec.ts @@ -0,0 +1,17 @@ +import { Test,TestingModule } from "@nestjs/testing"; +import { CityService } from "./city.service"; + +describe('CityService',()=>{ + let service: CityService; + + beforeEach(async()=>{ + const module: TestingModule=await Test.createTestingModule({ + providers: [CityService], + }).compile(); + service=module.get(CityService); + }) + + it('should be defined',()=>{ + expect(service).toBeDefined(); + }) +}) \ No newline at end of file diff --git a/backend/src/city/city.service.ts b/backend/src/city/city.service.ts new file mode 100644 index 0000000000000000000000000000000000000000..91dc2a7b8aed3005846e5079d093d16fea724cc7 --- /dev/null +++ b/backend/src/city/city.service.ts @@ -0,0 +1,57 @@ +import { Inject, Injectable } from "@nestjs/common"; +import { CreateCityDto } from "./dto/create-city.dto"; +import { InjectRepository } from "@nestjs/typeorm"; +import { City } from "./entities/city.entity"; +import { Repository } from "typeorm"; + +@Injectable() +export class AppService { + getHello(): string { + return 'Adios'; + } + +} +export class CityService{ + constructor( + @InjectRepository(City) + private readonly cityRepository: Repository, + ){} + async findAll(): Promise {//Obtiene en forma de arreglos todo el contenido de la tabla + return await this.cityRepository.find(); + } + + async initializeData() { + const info_tabla = await this.cityRepository.count(); // Verifica si ya existen datos en la tabla + + if (info_tabla === 0) { + const citiesToCreate = [ + { name: 'Zacatecas', + description: ' Zacatecas es un estado diverso y de variadas altitudes que deslumbra por su colorido y generosidad, ofreciendo experiencias extravagantes y contemplativas por igual. Su cielo, el más azul del país, contrasta con el rojo intenso de su tierra fértil, de donde se extrae la típica cantera rosa que adorna las edificaciones de la capital y que también da vida a deliciosos sabores campestres en todo el estado. Zacatecas resplandece con una luz dorada única, mientras el orgullo por su historia minera se refleja desde las profundidades de la tierra hasta su influencia en la gastronomía local. Sus paisajes naturales, pintados en tonos ocres y verdes, son especialmente hermosos y revelan la belleza única de esta tierra. ' } + ]; + + // Guarda las ciudades en la base de datos + await Promise.all( + citiesToCreate.map(cityData => this.cityRepository.save(cityData)), + ); + } + } + + //Obtener el name + async getCityNameById(cityId: number): Promise { + const city = await this.cityRepository.findOne({ where: { idCity: cityId } }); + if (!city) { + throw new Error('City not found'); + } + return city.name; + } + + //Obtener el description + async getCityDescriptionById(cityId: number): Promise { + const city = await this.cityRepository.findOne({ where: { idCity: cityId } }); + if (!city) { + throw new Error('City not found'); + } + return city.description; + } + +} \ No newline at end of file diff --git a/backend/src/city/dto/create-city.dto.ts b/backend/src/city/dto/create-city.dto.ts new file mode 100644 index 0000000000000000000000000000000000000000..f30c01a201510f2046ebaf5924f9c106ee45484c --- /dev/null +++ b/backend/src/city/dto/create-city.dto.ts @@ -0,0 +1,4 @@ +export class CreateCityDto { + name: string; + description: string; +} \ No newline at end of file diff --git a/backend/src/city/dto/update-city.dto.ts b/backend/src/city/dto/update-city.dto.ts new file mode 100644 index 0000000000000000000000000000000000000000..8f64ecce7f7a2d4ac00487139fc92abc1de44ddf --- /dev/null +++ b/backend/src/city/dto/update-city.dto.ts @@ -0,0 +1,6 @@ +import { PartialType } from '@nestjs/mapped-types'; +import { CreateCityDto } from './create-city.dto'; + +export class UpdateUserDto extends PartialType(CreateCityDto) { + +} \ No newline at end of file diff --git a/backend/src/city/entities/city.entity.ts b/backend/src/city/entities/city.entity.ts new file mode 100644 index 0000000000000000000000000000000000000000..3a72f8a01ff930deb56e0c6fd7b28d337ab48feb --- /dev/null +++ b/backend/src/city/entities/city.entity.ts @@ -0,0 +1,16 @@ +import { Place } from "src/place/entities/place.entity"; +import { Column, Entity, OneToMany, PrimaryColumn, PrimaryGeneratedColumn } from "typeorm"; + @Entity() + export class City{ + @PrimaryGeneratedColumn() + idCity:number + + @Column() + name:string + + @Column({ length: 1000 }) + description:string + + @OneToMany(()=>Place,place=>place.city) //Relacion inversa con place + place:Place[] + } diff --git a/backend/src/place/dto/create-place.dto.ts b/backend/src/place/dto/create-place.dto.ts new file mode 100644 index 0000000000000000000000000000000000000000..7d0137c80775cc2fb18798466eb34d1aecbf62dc --- /dev/null +++ b/backend/src/place/dto/create-place.dto.ts @@ -0,0 +1,9 @@ +export class CreatePlaceDto { + name: string; + description: string; + schedule: string; + adress: string; + geographic_location:string; + categories:string; + idCity:number; +} \ No newline at end of file diff --git a/backend/src/place/dto/update-place.dto.ts b/backend/src/place/dto/update-place.dto.ts new file mode 100644 index 0000000000000000000000000000000000000000..a488505f419079d0f37d889483e897ac13c776e9 --- /dev/null +++ b/backend/src/place/dto/update-place.dto.ts @@ -0,0 +1,6 @@ +import { PartialType } from '@nestjs/mapped-types'; +import { CreatePlaceDto } from './create-place.dto'; + +export class UpdatePlaceDto extends PartialType(CreatePlaceDto) { + +} \ No newline at end of file diff --git a/backend/src/place/entities/place.entity.ts b/backend/src/place/entities/place.entity.ts new file mode 100644 index 0000000000000000000000000000000000000000..ec879e71f05ed8fbdcd7d2ec8458e62f70a25f14 --- /dev/null +++ b/backend/src/place/entities/place.entity.ts @@ -0,0 +1,34 @@ +// place.entity.ts +import { City } from "src/city/entities/city.entity"; +import { Column, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from "typeorm"; + +@Entity() +export class Place { + @PrimaryGeneratedColumn() + idPlace: number; + + @Column() + name: string; + + @Column({ length: 1000 }) + description: string; + + @Column() + schedule: string; + + @Column() + address: string; + + @Column({ type: "point", nullable: true, spatialFeatureType: "Point" }) + geographic_location: string; + + @Column({ length: 1000 }) + categories: string; + + @Column() + idCity: number; // Debe ser un string para almacenar el nombre de la ciudad + + @ManyToOne(() => City, city => city.place) + @JoinColumn({ name: "idCity" }) // Nombre de la columna en Place que será la llave foránea hacia City + city: City; +} diff --git a/backend/src/place/place.controller.ts b/backend/src/place/place.controller.ts new file mode 100644 index 0000000000000000000000000000000000000000..37e606cf08eb6e44b86d690b9ccbdcc0e9785bae --- /dev/null +++ b/backend/src/place/place.controller.ts @@ -0,0 +1,36 @@ +// place.controller.ts +import { Controller, Get, Param } from '@nestjs/common'; +import { PlaceService } from './place.service'; + +@Controller('place') +export class PlaceController { + constructor(private readonly placeService: PlaceService) {} + + @Get(':idCity/:name') + async findOnePlace( + @Param('idCity') idCity: number, + @Param('name') name: string, + ): Promise { + console.log(`idCity: ${idCity}, name: ${name}`); + try { + const result = await this.placeService.findOnePlace(name, idCity); + const values=Object.values(result); + console.log(`Result: ${JSON.stringify(values)}`); + return values; + } catch (error) { + console.error(`Error: ${error.message}`); + throw error; + } + } + + @Get(':idCity') + async findAllPlaceNames(@Param('idCity') idCity: number): Promise { + return await this.placeService.findAllPlaceNames(idCity); + } + + @Get('test') + getTest(): string { + return 'Test endpoint works!'; +} + +} diff --git a/backend/src/place/place.module.ts b/backend/src/place/place.module.ts new file mode 100644 index 0000000000000000000000000000000000000000..0afd9837832910abccb1697a0b320d6a4eb2ccb7 --- /dev/null +++ b/backend/src/place/place.module.ts @@ -0,0 +1,13 @@ +import { TypeOrmModule } from '@nestjs/typeorm'; +import { Module } from '@nestjs/common'; +import { PlaceService } from './place.service'; +import { Place } from './entities/place.entity'; +import { PlaceController } from './place.controller'; + +@Module({ + imports:[TypeOrmModule.forFeature([Place])], + controllers:[PlaceController], + providers:[PlaceService], + exports:[PlaceService] +}) +export class PlaceModule{} \ No newline at end of file diff --git a/backend/src/place/place.service.spec.ts b/backend/src/place/place.service.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..d8d3a0df5437095a9fe7dba7f731ccc3613a22a1 --- /dev/null +++ b/backend/src/place/place.service.spec.ts @@ -0,0 +1,17 @@ +import { Test,TestingModule } from "@nestjs/testing"; +import { PlaceService } from "./place.service"; + +describe('PlaceService',()=>{ + let service:PlaceService; + + beforeEach(async()=>{ + const module:TestingModule=await Test.createTestingModule({ + providers:[PlaceService] + }).compile(); + service=module.get(PlaceService); + }) + + it('should be defined',()=>{ + expect(service).toBeDefined(); + }) +}) \ No newline at end of file diff --git a/backend/src/place/place.service.ts b/backend/src/place/place.service.ts new file mode 100644 index 0000000000000000000000000000000000000000..a399e97cefb4e4701999128dc6e8a77b239319de --- /dev/null +++ b/backend/src/place/place.service.ts @@ -0,0 +1,43 @@ +// place.service.ts +import { Injectable } from "@nestjs/common"; +import { InjectRepository } from "@nestjs/typeorm"; +import { Repository } from "typeorm"; +import { Place } from "./entities/place.entity"; + + +@Injectable() +export class PlaceService { + constructor( + @InjectRepository(Place) + private readonly placeRepository: Repository + ) {} + + async findOnePlace(namePlace: string, idCity: number): Promise { + const place = await this.placeRepository.findOne({ + select: [ + "name", + "description", + "schedule", + "address", + "categories" + ], + where: { + name: namePlace, + idCity: idCity + }, + }); + + return place; + } + + async findAllPlaceNames(idCity: number): Promise { + const places = await this.placeRepository + .createQueryBuilder("place") + .select("place.name") + .leftJoin("place.city", "city") + .where("city.idCity = :idCity", { idCity }) + .getMany(); + + return places.map(place => place.name); + } +} diff --git a/backend/src/user/dto/create-user.dto.ts b/backend/src/user/dto/create-user.dto.ts index b9f5a75f5695ee6d4dc57cd6f2a3acd8f2824108..ba46ede8b31260e1d1897469f9fb81cea407192f 100644 --- a/backend/src/user/dto/create-user.dto.ts +++ b/backend/src/user/dto/create-user.dto.ts @@ -3,5 +3,4 @@ export class CreateUserDto { lastname: string; password: string; email: string; - phone: number; } diff --git a/backend/src/user/entities/user.entity.ts b/backend/src/user/entities/user.entity.ts index b3632865b98ba2ba6d182486bde1882d0f7d387e..dbe15f9378c27b36ea756ecbc86bfb5741eeb16a 100644 --- a/backend/src/user/entities/user.entity.ts +++ b/backend/src/user/entities/user.entity.ts @@ -16,7 +16,4 @@ export class User { @Column() email: string - - @Column() - phone: number } diff --git a/backend/src/user/user.service.ts b/backend/src/user/user.service.ts index 96a338dac541e2575c5f71be55fd3712cbe2eb9b..0eac84ccd665865140b47e76e345f9d02e30c987 100644 --- a/backend/src/user/user.service.ts +++ b/backend/src/user/user.service.ts @@ -18,4 +18,4 @@ export class UserService { return await this.userRepository.findOneBy({ email }); } -} +} \ No newline at end of file diff --git a/fronted/aplicacionrutasturisticas/android/app/build.gradle b/fronted/aplicacionrutasturisticas/android/app/build.gradle index b3bd10b7c5958442d69d798f3bf18045fe8cdddb..78bf98de51820d4c532fcb4b60d57d1597e495d2 100644 --- a/fronted/aplicacionrutasturisticas/android/app/build.gradle +++ b/fronted/aplicacionrutasturisticas/android/app/build.gradle @@ -1,5 +1,8 @@ plugins { id "com.android.application" + // START: FlutterFire Configuration + id 'com.google.gms.google-services' + // END: FlutterFire Configuration id "kotlin-android" id "dev.flutter.flutter-gradle-plugin" } diff --git a/fronted/aplicacionrutasturisticas/android/app/google-services.json b/fronted/aplicacionrutasturisticas/android/app/google-services.json new file mode 100644 index 0000000000000000000000000000000000000000..ff73e6ac3ba1fdc43f9c2128d7996a604b72a429 --- /dev/null +++ b/fronted/aplicacionrutasturisticas/android/app/google-services.json @@ -0,0 +1,48 @@ +{ + "project_info": { + "project_number": "121490225279", + "project_id": "rutas-a9c1d", + "storage_bucket": "rutas-a9c1d.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:121490225279:android:06e0216317235ce9f0a74a", + "android_client_info": { + "package_name": "com.aplicacionrutasturisticas.android" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBMTmimLOKaCtevqhJLwIxE63rZdZgItO8" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + }, + { + "client_info": { + "mobilesdk_app_id": "1:121490225279:android:d75202951f20f9e9f0a74a", + "android_client_info": { + "package_name": "com.example.aplicacionrutasturisticas" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBMTmimLOKaCtevqhJLwIxE63rZdZgItO8" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/fronted/aplicacionrutasturisticas/android/app/src/main/AndroidManifest.xml b/fronted/aplicacionrutasturisticas/android/app/src/main/AndroidManifest.xml index f031770777a3824e7806cc833809bfd31c50ab58..2523646c2f47a3a5b0af103eedc46d4031d35fc0 100644 --- a/fronted/aplicacionrutasturisticas/android/app/src/main/AndroidManifest.xml +++ b/fronted/aplicacionrutasturisticas/android/app/src/main/AndroidManifest.xml @@ -1,4 +1,5 @@ - + + + + + API_KEY + AIzaSyBbi3oeS7mOhZX8aRt3T9N-HU7tnIUzxDM + GCM_SENDER_ID + 121490225279 + PLIST_VERSION + 1 + BUNDLE_ID + com.aplicacionrutaturistica.ios + PROJECT_ID + rutas-a9c1d + STORAGE_BUCKET + rutas-a9c1d.appspot.com + IS_ADS_ENABLED + + IS_ANALYTICS_ENABLED + + IS_APPINVITE_ENABLED + + IS_GCM_ENABLED + + IS_SIGNIN_ENABLED + + GOOGLE_APP_ID + 1:121490225279:ios:b2b0d8ace3257f5af0a74a + + \ No newline at end of file diff --git a/fronted/aplicacionrutasturisticas/l10n.yaml b/fronted/aplicacionrutasturisticas/l10n.yaml new file mode 100644 index 0000000000000000000000000000000000000000..9cff297bdeb97005c0967c7a04654f89ca096ea9 --- /dev/null +++ b/fronted/aplicacionrutasturisticas/l10n.yaml @@ -0,0 +1,4 @@ +arb-dir: lib/l10n/arb/ +template-arb-file: intl_es.arb +output-localization-file: l10n.dart +output-class: S diff --git a/fronted/aplicacionrutasturisticas/lib/config/dio.dart b/fronted/aplicacionrutasturisticas/lib/config/dio.dart index 5bc2d6d6b9f31632a2c42e852d2160b9ec0ff64b..f523ec89be1c832e9b3ab1d01bbe0db779b5a17c 100644 --- a/fronted/aplicacionrutasturisticas/lib/config/dio.dart +++ b/fronted/aplicacionrutasturisticas/lib/config/dio.dart @@ -1,27 +1,74 @@ +import 'dart:convert'; + import 'package:dio/dio.dart'; final dio = Dio(); -void Registro_Datos(String nombre, String lastname, String email, - String password) async { + +const String localhost = "http://192.168.100.4:3000"; + +void Registro_Datos( + String nombre, String lastname, String email, String password) async { Response response; - //response = await dio.get("http://172.26.128.1:3000") - response = - await dio.post("http://192.168.1.81:3000/auth-user/register", data: { + response = await dio.post("$localhost/auth-user/register", data: { "name": nombre, "lastname": lastname, "password": password, "email": email, }); - print(response.data.toString()); - - } + void loginDatos(String email, String password) async { Response responselogin; - responselogin = await dio.post("http://192.168.1.81:3000/auth-user/login", data: { + responselogin = await dio.post("$localhost/auth-user/login", data: { "email": email, "password": password, }); print(responselogin.data.toString()); } +//Star page +Future datosStartPage(int cityId) async { + Response responseCity = await dio.get( + "$localhost/city/name", + queryParameters: {"id": cityId}, + ); + if (responseCity.statusCode == 200) { + dynamic cityData = responseCity.data; + String cityName = cityData['name'].toString(); + return cityName; + } else { + return "Cargando...."; + } +} + +Future datosTextStartPage(int cityId) async { + Response responseCity = await dio.get( + "$localhost/city/description", + queryParameters: {"id": cityId}, + ); + if (responseCity.statusCode == 200) { + dynamic cityData = responseCity.data; + String cityDes = cityData['description'].toString(); + return cityDes; + } else { + return "Cargando...."; + } +} + +//Place page +Future> findAllDatPlace(String placeName, int idCity) async { + try { + Response responsePlace = + await dio.get("$localhost/place/$idCity/$placeName"); + + if (responsePlace.statusCode == 200) { + // Si la petición fue exitosa + List places = responsePlace.data; + return places; + } else { + throw Exception('Error al obtener lugares'); + } + } catch (e) { + throw Exception('Error en la solicitud HTTP: $e'); + } +} diff --git a/fronted/aplicacionrutasturisticas/lib/config/router.dart b/fronted/aplicacionrutasturisticas/lib/config/router.dart index 5c03c71b2869d6b351eece0ba296b37340708e5a..dd1ab3b15599a58c552fdc73acd98d5b556fc84f 100644 --- a/fronted/aplicacionrutasturisticas/lib/config/router.dart +++ b/fronted/aplicacionrutasturisticas/lib/config/router.dart @@ -1,8 +1,9 @@ +import 'package:flutter/material.dart'; +import 'package:go_router/go_router.dart'; import 'package:aplicacionrutasturisticas/pages/login.dart'; import 'package:aplicacionrutasturisticas/pages/register.dart'; -import 'package:aplicacionrutasturisticas/pages/start_page.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:go_router/go_router.dart'; +import 'package:aplicacionrutasturisticas/pages/star_page.dart'; +import 'package:aplicacionrutasturisticas/pages/place.dart'; final GoRouter router = GoRouter(routes: [ GoRoute( @@ -24,5 +25,16 @@ final GoRouter router = GoRouter(routes: [ path: '/startpage', builder: (BuildContext context, GoRouterState state) { return const StartedPage(); - }) + }, + routes: [ + GoRoute( + name: "PlaceBase", + path: "placebase/:place", + builder: (BuildContext context, GoRouterState state) { + final place = (state.pathParameters[ + 'place']!); // Obtén el parámetro y conviértelo a entero + return PlaceBase(place: place); + }, + ) + ]), ]); diff --git a/fronted/aplicacionrutasturisticas/lib/firebase_options.dart b/fronted/aplicacionrutasturisticas/lib/firebase_options.dart new file mode 100644 index 0000000000000000000000000000000000000000..be0490c45740cc187ec6a82e3c95e11fe88e50c8 --- /dev/null +++ b/fronted/aplicacionrutasturisticas/lib/firebase_options.dart @@ -0,0 +1,76 @@ +// File generated by FlutterFire CLI. +// ignore_for_file: type=lint +import 'package:firebase_core/firebase_core.dart' show FirebaseOptions; +import 'package:flutter/foundation.dart' + show defaultTargetPlatform, kIsWeb, TargetPlatform; + +/// Default [FirebaseOptions] for use with your Firebase apps. +/// +/// Example: +/// ```dart +/// import 'firebase_options.dart'; +/// // ... +/// await Firebase.initializeApp( +/// options: DefaultFirebaseOptions.currentPlatform, +/// ); +/// ``` +class DefaultFirebaseOptions { + static FirebaseOptions get currentPlatform { + if (kIsWeb) { + throw UnsupportedError( + 'DefaultFirebaseOptions have not been configured for web - ' + 'you can reconfigure this by running the FlutterFire CLI again.', + ); + } + switch (defaultTargetPlatform) { + case TargetPlatform.android: + return android; + case TargetPlatform.iOS: + return ios; + case TargetPlatform.macOS: + throw UnsupportedError( + 'DefaultFirebaseOptions have not been configured for macos - ' + 'you can reconfigure this by running the FlutterFire CLI again.', + ); + case TargetPlatform.windows: + return windows; + case TargetPlatform.linux: + throw UnsupportedError( + 'DefaultFirebaseOptions have not been configured for linux - ' + 'you can reconfigure this by running the FlutterFire CLI again.', + ); + default: + throw UnsupportedError( + 'DefaultFirebaseOptions are not supported for this platform.', + ); + } + } + + static const FirebaseOptions android = FirebaseOptions( + apiKey: 'AIzaSyBMTmimLOKaCtevqhJLwIxE63rZdZgItO8', + appId: '1:121490225279:android:d75202951f20f9e9f0a74a', + messagingSenderId: '121490225279', + projectId: 'rutas-a9c1d', + storageBucket: 'rutas-a9c1d.appspot.com', + ); + + static const FirebaseOptions ios = FirebaseOptions( + apiKey: 'AIzaSyBbi3oeS7mOhZX8aRt3T9N-HU7tnIUzxDM', + appId: '1:121490225279:ios:ba1813516d46015bf0a74a', + messagingSenderId: '121490225279', + projectId: 'rutas-a9c1d', + storageBucket: 'rutas-a9c1d.appspot.com', + iosBundleId: 'com.example.aplicacionrutasturisticas', + ); + + static const FirebaseOptions windows = FirebaseOptions( + apiKey: 'AIzaSyDFfsust5E8ibfp2q4EsydMbz3yZ41cQmQ', + appId: '1:121490225279:web:8d3c4a52da16f22bf0a74a', + messagingSenderId: '121490225279', + projectId: 'rutas-a9c1d', + authDomain: 'rutas-a9c1d.firebaseapp.com', + storageBucket: 'rutas-a9c1d.appspot.com', + measurementId: 'G-F08WD3VKP3', + ); + +} \ No newline at end of file diff --git a/fronted/aplicacionrutasturisticas/lib/generated/intl/messages_all.dart b/fronted/aplicacionrutasturisticas/lib/generated/intl/messages_all.dart new file mode 100644 index 0000000000000000000000000000000000000000..83aec8df7f612da6b6400001556af7c6f9b06d9e --- /dev/null +++ b/fronted/aplicacionrutasturisticas/lib/generated/intl/messages_all.dart @@ -0,0 +1,67 @@ +// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart +// This is a library that looks up messages for specific locales by +// delegating to the appropriate library. + +// Ignore issues from commonly used lints in this file. +// ignore_for_file:implementation_imports, file_names, unnecessary_new +// ignore_for_file:unnecessary_brace_in_string_interps, directives_ordering +// ignore_for_file:argument_type_not_assignable, invalid_assignment +// ignore_for_file:prefer_single_quotes, prefer_generic_function_type_aliases +// ignore_for_file:comment_references + +import 'dart:async'; + +import 'package:flutter/foundation.dart'; +import 'package:intl/intl.dart'; +import 'package:intl/message_lookup_by_library.dart'; +import 'package:intl/src/intl_helpers.dart'; + +import 'messages_en.dart' as messages_en; +import 'messages_es.dart' as messages_es; + +typedef Future LibraryLoader(); +Map _deferredLibraries = { + 'en': () => new SynchronousFuture(null), + 'es': () => new SynchronousFuture(null), +}; + +MessageLookupByLibrary? _findExact(String localeName) { + switch (localeName) { + case 'en': + return messages_en.messages; + case 'es': + return messages_es.messages; + default: + return null; + } +} + +/// User programs should call this before using [localeName] for messages. +Future initializeMessages(String localeName) { + var availableLocale = Intl.verifiedLocale( + localeName, (locale) => _deferredLibraries[locale] != null, + onFailure: (_) => null); + if (availableLocale == null) { + return new SynchronousFuture(false); + } + var lib = _deferredLibraries[availableLocale]; + lib == null ? new SynchronousFuture(false) : lib(); + initializeInternalMessageLookup(() => new CompositeMessageLookup()); + messageLookup.addLocale(availableLocale, _findGeneratedMessagesFor); + return new SynchronousFuture(true); +} + +bool _messagesExistFor(String locale) { + try { + return _findExact(locale) != null; + } catch (e) { + return false; + } +} + +MessageLookupByLibrary? _findGeneratedMessagesFor(String locale) { + var actualLocale = + Intl.verifiedLocale(locale, _messagesExistFor, onFailure: (_) => null); + if (actualLocale == null) return null; + return _findExact(actualLocale); +} diff --git a/fronted/aplicacionrutasturisticas/lib/generated/intl/messages_en.dart b/fronted/aplicacionrutasturisticas/lib/generated/intl/messages_en.dart new file mode 100644 index 0000000000000000000000000000000000000000..2a6994afc0bf13aa92ea6c6732beb612062892aa --- /dev/null +++ b/fronted/aplicacionrutasturisticas/lib/generated/intl/messages_en.dart @@ -0,0 +1,53 @@ +// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart +// This is a library that provides messages for a en locale. All the +// messages from the main program should be duplicated here with the same +// function name. + +// Ignore issues from commonly used lints in this file. +// ignore_for_file:unnecessary_brace_in_string_interps, unnecessary_new +// ignore_for_file:prefer_single_quotes,comment_references, directives_ordering +// ignore_for_file:annotate_overrides,prefer_generic_function_type_aliases +// ignore_for_file:unused_import, file_names, avoid_escaping_inner_quotes +// ignore_for_file:unnecessary_string_interpolations, unnecessary_string_escapes + +import 'package:intl/intl.dart'; +import 'package:intl/message_lookup_by_library.dart'; + +final messages = new MessageLookup(); + +typedef String MessageIfAbsent(String messageStr, List args); + +class MessageLookup extends MessageLookupByLibrary { + String get localeName => 'en'; + + final messages = _notInlinedMessages(_notInlinedMessages); + static Map _notInlinedMessages(_) => { + "complete_rutes": + MessageLookupByLibrary.simpleMessage("Complete Routes"), + "confirm": MessageLookupByLibrary.simpleMessage("Confirm"), + "correo": MessageLookupByLibrary.simpleMessage("Email"), + "create_route": MessageLookupByLibrary.simpleMessage("Create Route"), + "formulario": MessageLookupByLibrary.simpleMessage("Form"), + "idiom": MessageLookupByLibrary.simpleMessage("Language"), + "informacion_personal": + MessageLookupByLibrary.simpleMessage("Personal Information"), + "inicia_sesion": MessageLookupByLibrary.simpleMessage("Log In"), + "inicio_nuevo_aplicacion": + MessageLookupByLibrary.simpleMessage("New to the app?"), + "inicio_sesion_entrar_invitado": + MessageLookupByLibrary.simpleMessage("Enter as"), + "invitado": MessageLookupByLibrary.simpleMessage("Guest"), + "list_of_places": + MessageLookupByLibrary.simpleMessage("List of Places"), + "notificacion_cambio_idioma": MessageLookupByLibrary.simpleMessage( + "The language has been changed to:"), + "pasword": MessageLookupByLibrary.simpleMessage("Password"), + "recommended_route": + MessageLookupByLibrary.simpleMessage("Recommended Route"), + "registrarte": MessageLookupByLibrary.simpleMessage("Register"), + "seleciona_tu_idioma": + MessageLookupByLibrary.simpleMessage("Select your language"), + "welcome_start_page": + MessageLookupByLibrary.simpleMessage("Welcome to ") + }; +} diff --git a/fronted/aplicacionrutasturisticas/lib/generated/intl/messages_es.dart b/fronted/aplicacionrutasturisticas/lib/generated/intl/messages_es.dart new file mode 100644 index 0000000000000000000000000000000000000000..9f1ee59738734cb8c7510080b6e096ca6b77b980 --- /dev/null +++ b/fronted/aplicacionrutasturisticas/lib/generated/intl/messages_es.dart @@ -0,0 +1,53 @@ +// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart +// This is a library that provides messages for a es locale. All the +// messages from the main program should be duplicated here with the same +// function name. + +// Ignore issues from commonly used lints in this file. +// ignore_for_file:unnecessary_brace_in_string_interps, unnecessary_new +// ignore_for_file:prefer_single_quotes,comment_references, directives_ordering +// ignore_for_file:annotate_overrides,prefer_generic_function_type_aliases +// ignore_for_file:unused_import, file_names, avoid_escaping_inner_quotes +// ignore_for_file:unnecessary_string_interpolations, unnecessary_string_escapes + +import 'package:intl/intl.dart'; +import 'package:intl/message_lookup_by_library.dart'; + +final messages = new MessageLookup(); + +typedef String MessageIfAbsent(String messageStr, List args); + +class MessageLookup extends MessageLookupByLibrary { + String get localeName => 'es'; + + final messages = _notInlinedMessages(_notInlinedMessages); + static Map _notInlinedMessages(_) => { + "complete_rutes": + MessageLookupByLibrary.simpleMessage("Rutas Completas"), + "confirm": MessageLookupByLibrary.simpleMessage("Confirmar"), + "correo": MessageLookupByLibrary.simpleMessage("Correo electrónico"), + "create_route": MessageLookupByLibrary.simpleMessage("Crear Ruta"), + "formulario": MessageLookupByLibrary.simpleMessage("Formulario"), + "idiom": MessageLookupByLibrary.simpleMessage("Idioma"), + "informacion_personal": + MessageLookupByLibrary.simpleMessage("Información Personal"), + "inicia_sesion": MessageLookupByLibrary.simpleMessage("Inicia Sesión"), + "inicio_nuevo_aplicacion": + MessageLookupByLibrary.simpleMessage("¿Nuevo en la aplicación?"), + "inicio_sesion_entrar_invitado": + MessageLookupByLibrary.simpleMessage("Entra como"), + "invitado": MessageLookupByLibrary.simpleMessage("Invitado"), + "list_of_places": + MessageLookupByLibrary.simpleMessage("Lista de Lugares"), + "notificacion_cambio_idioma": MessageLookupByLibrary.simpleMessage( + "El idioma ha sido cambiado a:"), + "pasword": MessageLookupByLibrary.simpleMessage("Contraseña"), + "recommended_route": + MessageLookupByLibrary.simpleMessage("Ruta Recomendada"), + "registrarte": MessageLookupByLibrary.simpleMessage("Registrarte"), + "seleciona_tu_idioma": + MessageLookupByLibrary.simpleMessage("Selecciona tu idioma"), + "welcome_start_page": + MessageLookupByLibrary.simpleMessage("Bienvenido a ") + }; +} diff --git a/fronted/aplicacionrutasturisticas/lib/generated/l10n.dart b/fronted/aplicacionrutasturisticas/lib/generated/l10n.dart new file mode 100644 index 0000000000000000000000000000000000000000..4b6ef2bb6ec5ba3a162e580dfc6cd2af8b198b80 --- /dev/null +++ b/fronted/aplicacionrutasturisticas/lib/generated/l10n.dart @@ -0,0 +1,259 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; +import 'intl/messages_all.dart'; + +// ************************************************************************** +// Generator: Flutter Intl IDE plugin +// Made by Localizely +// ************************************************************************** + +// ignore_for_file: non_constant_identifier_names, lines_longer_than_80_chars +// ignore_for_file: join_return_with_assignment, prefer_final_in_for_each +// ignore_for_file: avoid_redundant_argument_values, avoid_escaping_inner_quotes + +class S { + S(); + + static S? _current; + + static S get current { + assert(_current != null, + 'No instance of S was loaded. Try to initialize the S delegate before accessing S.current.'); + return _current!; + } + + static const AppLocalizationDelegate delegate = AppLocalizationDelegate(); + + static Future load(Locale locale) { + final name = (locale.countryCode?.isEmpty ?? false) + ? locale.languageCode + : locale.toString(); + final localeName = Intl.canonicalizedLocale(name); + return initializeMessages(localeName).then((_) { + Intl.defaultLocale = localeName; + final instance = S(); + S._current = instance; + + return instance; + }); + } + + static S of(BuildContext context) { + final instance = S.maybeOf(context); + assert(instance != null, + 'No instance of S present in the widget tree. Did you add S.delegate in localizationsDelegates?'); + return instance!; + } + + static S? maybeOf(BuildContext context) { + return Localizations.of(context, S); + } + + /// `Welcome to ` + String get welcome_start_page { + return Intl.message( + 'Welcome to ', + name: 'welcome_start_page', + desc: 'Welcome message on the start page', + args: [], + ); + } + + /// `Create Route` + String get create_route { + return Intl.message( + 'Create Route', + name: 'create_route', + desc: 'Button text for creating a route', + args: [], + ); + } + + /// `Recommended Route` + String get recommended_route { + return Intl.message( + 'Recommended Route', + name: 'recommended_route', + desc: 'Button text for recommended route', + args: [], + ); + } + + /// `List of Places` + String get list_of_places { + return Intl.message( + 'List of Places', + name: 'list_of_places', + desc: 'Button text for list of places', + args: [], + ); + } + + /// `Complete Routes` + String get complete_rutes { + return Intl.message( + 'Complete Routes', + name: 'complete_rutes', + desc: 'Button text for complete routes', + args: [], + ); + } + + /// `Confirm` + String get confirm { + return Intl.message( + 'Confirm', + name: 'confirm', + desc: 'Text for confirming something', + args: [], + ); + } + + /// `Language` + String get idiom { + return Intl.message( + 'Language', + name: 'idiom', + desc: 'Text for language', + args: [], + ); + } + + /// `Personal Information` + String get informacion_personal { + return Intl.message( + 'Personal Information', + name: 'informacion_personal', + desc: 'Button text for personal information', + args: [], + ); + } + + /// `Form` + String get formulario { + return Intl.message( + 'Form', + name: 'formulario', + desc: 'Text for form', + args: [], + ); + } + + /// `Select your language` + String get seleciona_tu_idioma { + return Intl.message( + 'Select your language', + name: 'seleciona_tu_idioma', + desc: 'Button text for selecting language', + args: [], + ); + } + + /// `The language has been changed to:` + String get notificacion_cambio_idioma { + return Intl.message( + 'The language has been changed to:', + name: 'notificacion_cambio_idioma', + desc: 'Text to notify language change', + args: [], + ); + } + + /// `Log In` + String get inicia_sesion { + return Intl.message( + 'Log In', + name: 'inicia_sesion', + desc: 'Text for logging in', + args: [], + ); + } + + /// `Email` + String get correo { + return Intl.message( + 'Email', + name: 'correo', + desc: 'Text for email', + args: [], + ); + } + + /// `Password` + String get pasword { + return Intl.message( + 'Password', + name: 'pasword', + desc: 'Text for password', + args: [], + ); + } + + /// `Register` + String get registrarte { + return Intl.message( + 'Register', + name: 'registrarte', + desc: 'Text for registering', + args: [], + ); + } + + /// `Guest` + String get invitado { + return Intl.message( + 'Guest', + name: 'invitado', + desc: 'Text for guest', + args: [], + ); + } + + /// `New to the app?` + String get inicio_nuevo_aplicacion { + return Intl.message( + 'New to the app?', + name: 'inicio_nuevo_aplicacion', + desc: 'Text for new to the app question', + args: [], + ); + } + + /// `Enter as` + String get inicio_sesion_entrar_invitado { + return Intl.message( + 'Enter as', + name: 'inicio_sesion_entrar_invitado', + desc: 'Text for entering as a guest', + args: [], + ); + } +} + +class AppLocalizationDelegate extends LocalizationsDelegate { + const AppLocalizationDelegate(); + + List get supportedLocales { + return const [ + Locale.fromSubtags(languageCode: 'en'), + Locale.fromSubtags(languageCode: 'es'), + ]; + } + + @override + bool isSupported(Locale locale) => _isSupported(locale); + @override + Future load(Locale locale) => S.load(locale); + @override + bool shouldReload(AppLocalizationDelegate old) => false; + + bool _isSupported(Locale locale) { + for (var supportedLocale in supportedLocales) { + if (supportedLocale.languageCode == locale.languageCode) { + return true; + } + } + return false; + } +} diff --git a/fronted/aplicacionrutasturisticas/lib/l10n/app_en.arb b/fronted/aplicacionrutasturisticas/lib/l10n/app_en.arb new file mode 100644 index 0000000000000000000000000000000000000000..576e00bdbd60d8a28776dd3fce42ab9990f51237 --- /dev/null +++ b/fronted/aplicacionrutasturisticas/lib/l10n/app_en.arb @@ -0,0 +1,39 @@ +{ + "welcome_start_page": "Welcome to ", + "create_route": "Create Route", + "recommended_route": "Recommended Route", + "list_of_places": "List of Places", + "complete_rutes": "Complete Routes", + "confirm": "Confirm", + "idiom": "Language", + "informacion_personal": "Personal Information", + "formulario": "Form", + + "@welcome_start_page": { + "description": "Welcome message on the start page" + }, + "@create_route": { + "description": "Button text for creating a route" + }, + "@recommended_route": { + "description": "Button text for recommended route" + }, + "@list_of_places": { + "description": "Button text for list of places" + }, + "@complete_rutes": { + "description": "Button text for complete routes" + }, + "@confirm": { + "description": "Text for confirming something" + }, + "@idiom": { + "description": "Text for language" + }, + "@informacion_personal": { + "description": "Text for personal information button" + }, + "@formulario": { + "description": "Text for form" + } +} diff --git a/fronted/aplicacionrutasturisticas/lib/l10n/app_es.arb b/fronted/aplicacionrutasturisticas/lib/l10n/app_es.arb new file mode 100644 index 0000000000000000000000000000000000000000..97368efcade5e335b5972eef8b7214bb6492bb84 --- /dev/null +++ b/fronted/aplicacionrutasturisticas/lib/l10n/app_es.arb @@ -0,0 +1,39 @@ +{ + "welcome_start_page": "Bienvenido a ", + "create_route": "Crear Ruta", + "recommended_route": "Ruta Recomendada", + "list_of_places": "Lista de Lugares", + "complete_rutes": "Rutas Completas", + "confirm":"Confirmar", + "idiom":"Idioma", + "informacion_personal":"Información Personal", + "formulario":"Formulario", + + "@welcome_start_page": { + "description": "Mensaje de bienvenida en la página de inicio" + }, + "@create_route": { + "description": "Texto del botón para crear una ruta" + }, + "@recommended_route": { + "description": "Texto del botón para ruta recomendada" + }, + "@list_of_places": { + "description": "Texto del botón para lista de lugares" + }, + "@complete_rutes": { + "description": "Texto del botón para rutas completas" + }, + "@confirm":{ + "description":"Texto para confirmar algo" + }, + "@idiom":{ + "description":"Texto para idioma" + }, + "@informacion_personal":{ + "description":"Texto para boton informacion personal" + }, + "@formulario":{ + "description":"Texto para formulario" + } +} diff --git a/fronted/aplicacionrutasturisticas/lib/l10n/arb/intl_en.arb b/fronted/aplicacionrutasturisticas/lib/l10n/arb/intl_en.arb new file mode 100644 index 0000000000000000000000000000000000000000..576e00bdbd60d8a28776dd3fce42ab9990f51237 --- /dev/null +++ b/fronted/aplicacionrutasturisticas/lib/l10n/arb/intl_en.arb @@ -0,0 +1,39 @@ +{ + "welcome_start_page": "Welcome to ", + "create_route": "Create Route", + "recommended_route": "Recommended Route", + "list_of_places": "List of Places", + "complete_rutes": "Complete Routes", + "confirm": "Confirm", + "idiom": "Language", + "informacion_personal": "Personal Information", + "formulario": "Form", + + "@welcome_start_page": { + "description": "Welcome message on the start page" + }, + "@create_route": { + "description": "Button text for creating a route" + }, + "@recommended_route": { + "description": "Button text for recommended route" + }, + "@list_of_places": { + "description": "Button text for list of places" + }, + "@complete_rutes": { + "description": "Button text for complete routes" + }, + "@confirm": { + "description": "Text for confirming something" + }, + "@idiom": { + "description": "Text for language" + }, + "@informacion_personal": { + "description": "Text for personal information button" + }, + "@formulario": { + "description": "Text for form" + } +} diff --git a/fronted/aplicacionrutasturisticas/lib/l10n/arb/intl_es.arb b/fronted/aplicacionrutasturisticas/lib/l10n/arb/intl_es.arb new file mode 100644 index 0000000000000000000000000000000000000000..f6248cf84f723cfe2b004ec68235b8ccc137d559 --- /dev/null +++ b/fronted/aplicacionrutasturisticas/lib/l10n/arb/intl_es.arb @@ -0,0 +1,40 @@ +{ + "welcome_start_page": "Bienvenido a ", + "create_route": "Crear Ruta", + "recommended_route": "Ruta Recomendada", + "list_of_places": "Lista de Lugares", + "complete_rutes": "Rutas Completas", + "confirm":"Confirmar", + "idiom":"Idioma", + "informacion_personal":"Información Personal", + "formulario":"Formulario", + + "@welcome_start_page": { + "description": "Mensaje de bienvenida en la página de inicio" + }, + "@create_route": { + "description": "Texto del botón para crear una ruta" + }, + "@recommended_route": { + "description": "Texto del botón para ruta recomendada" + }, + "@list_of_places": { + "description": "Texto del botón para lista de lugares" + }, + "@complete_rutes": { + "description": "Texto del botón para rutas completas" + }, + "@confirm":{ + "description":"Texto para confirmar algo" + }, + "@idiom":{ + "description":"Texto para idioma" + }, + "@informacion_personal":{ + "description":"Texto para boton informacion personal" + }, + "@formulario":{ + "description":"Texto para formulario" + } + } + \ No newline at end of file diff --git a/fronted/aplicacionrutasturisticas/lib/l10n/intl_en.arb b/fronted/aplicacionrutasturisticas/lib/l10n/intl_en.arb new file mode 100644 index 0000000000000000000000000000000000000000..498ca112ddfe74dc1f47a0b6949df3ee0c8fcb1c --- /dev/null +++ b/fronted/aplicacionrutasturisticas/lib/l10n/intl_en.arb @@ -0,0 +1,75 @@ +{ + "welcome_start_page": "Welcome to ", + "create_route": "Create Route", + "recommended_route": "Recommended Route", + "list_of_places": "List of Places", + "complete_rutes": "Complete Routes", + "confirm": "Confirm", + "idiom": "Language", + "informacion_personal": "Personal Information", + "formulario": "Form", + "seleciona_tu_idioma": "Select your language", + "notificacion_cambio_idioma": "The language has been changed to:", + "inicia_sesion": "Log In", + "correo": "Email", + "pasword": "Password", + "registrarte": "Register", + "invitado": "Guest", + "inicio_nuevo_aplicacion": "New to the app?", + "inicio_sesion_entrar_invitado": "Enter as", + + "@welcome_start_page": { + "description": "Welcome message on the start page" + }, + "@create_route": { + "description": "Button text for creating a route" + }, + "@recommended_route": { + "description": "Button text for recommended route" + }, + "@list_of_places": { + "description": "Button text for list of places" + }, + "@complete_rutes": { + "description": "Button text for complete routes" + }, + "@confirm": { + "description": "Text for confirming something" + }, + "@idiom": { + "description": "Text for language" + }, + "@informacion_personal": { + "description": "Button text for personal information" + }, + "@formulario": { + "description": "Text for form" + }, + "@seleciona_tu_idioma": { + "description": "Button text for selecting language" + }, + "@notificacion_cambio_idioma": { + "description": "Text to notify language change" + }, + "@inicia_sesion": { + "description": "Text for logging in" + }, + "@correo": { + "description": "Text for email" + }, + "@pasword": { + "description": "Text for password" + }, + "@registrarte": { + "description": "Text for registering" + }, + "@invitado": { + "description": "Text for guest" + }, + "@inicio_nuevo_aplicacion": { + "description": "Text for new to the app question" + }, + "@inicio_sesion_entrar_invitado": { + "description": "Text for entering as a guest" + } +} diff --git a/fronted/aplicacionrutasturisticas/lib/l10n/intl_es.arb b/fronted/aplicacionrutasturisticas/lib/l10n/intl_es.arb new file mode 100644 index 0000000000000000000000000000000000000000..6be271c7bec4f9f30003799a338651b74eb816f9 --- /dev/null +++ b/fronted/aplicacionrutasturisticas/lib/l10n/intl_es.arb @@ -0,0 +1,75 @@ +{ + "welcome_start_page": "Bienvenido a ", + "create_route": "Crear Ruta", + "recommended_route": "Ruta Recomendada", + "list_of_places": "Lista de Lugares", + "complete_rutes": "Rutas Completas", + "confirm": "Confirmar", + "idiom": "Idioma", + "informacion_personal": "Información Personal", + "formulario": "Formulario", + "seleciona_tu_idioma": "Selecciona tu idioma", + "notificacion_cambio_idioma": "El idioma ha sido cambiado a:", + "inicia_sesion": "Inicia Sesión", + "correo": "Correo electrónico", + "pasword": "Contraseña", + "registrarte": "Registrarte", + "invitado": "Invitado", + "inicio_nuevo_aplicacion": "¿Nuevo en la aplicación?", + "inicio_sesion_entrar_invitado": "Entra como", + + "@welcome_start_page": { + "description": "Mensaje de bienvenida en la página de inicio" + }, + "@create_route": { + "description": "Texto del botón para crear una ruta" + }, + "@recommended_route": { + "description": "Texto del botón para ruta recomendada" + }, + "@list_of_places": { + "description": "Texto del botón para lista de lugares" + }, + "@complete_rutes": { + "description": "Texto del botón para rutas completas" + }, + "@confirm": { + "description": "Texto para confirmar algo" + }, + "@idiom": { + "description": "Texto para idioma" + }, + "@informacion_personal": { + "description": "Texto para botón de información personal" + }, + "@formulario": { + "description": "Texto para formulario" + }, + "@seleciona_tu_idioma": { + "description": "Texto para botón selecciona idioma" + }, + "@notificacion_cambio_idioma": { + "description": "Texto para notificar cambio de idioma" + }, + "@inicia_sesion": { + "description": "Texto para iniciar sesión" + }, + "@correo": { + "description": "Texto para correo electrónico" + }, + "@pasword": { + "description": "Texto para contraseña" + }, + "@registrarte": { + "description": "Texto para registrarte" + }, + "@invitado": { + "description": "Texto para invitado" + }, + "@inicio_nuevo_aplicacion": { + "description": "Texto para pregunta de nuevo en la aplicación" + }, + "@inicio_sesion_entrar_invitado": { + "description": "Texto para entrar como invitado" + } +} diff --git a/fronted/aplicacionrutasturisticas/lib/l10n/json/intl_en.json b/fronted/aplicacionrutasturisticas/lib/l10n/json/intl_en.json new file mode 100644 index 0000000000000000000000000000000000000000..154446b4b235d96c66c43468a284bc8bd315fbc1 --- /dev/null +++ b/fronted/aplicacionrutasturisticas/lib/l10n/json/intl_en.json @@ -0,0 +1,7 @@ +{ + "welcome_start_page": "Welcome to ", + "create_route": "Create Route", + "recommended_route":"Recommended Route", + "list_of_places":"List of Places", + "complete_rutes":"Complete Rutes" +} \ No newline at end of file diff --git a/fronted/aplicacionrutasturisticas/lib/l10n/json/intl_es.json b/fronted/aplicacionrutasturisticas/lib/l10n/json/intl_es.json new file mode 100644 index 0000000000000000000000000000000000000000..beca90c7f28043d5daae7cfcae6bd91ba7ed8c65 --- /dev/null +++ b/fronted/aplicacionrutasturisticas/lib/l10n/json/intl_es.json @@ -0,0 +1,8 @@ +{ + "welcome_start_page": "Bienvenido a ", + "create_route": "Crear Ruta", + "recommended_route":"Ruta Recomendada", + "list_of_places":"Lista de Lugares", + "complete_rutes":"Rutas Completadas" +} + \ No newline at end of file diff --git a/fronted/aplicacionrutasturisticas/lib/main.dart b/fronted/aplicacionrutasturisticas/lib/main.dart index 066ade613b52752b234f225377b92259b40bff9e..717df4630a3994f85dec02ceca42842c2d279285 100644 --- a/fronted/aplicacionrutasturisticas/lib/main.dart +++ b/fronted/aplicacionrutasturisticas/lib/main.dart @@ -1,15 +1,52 @@ -import 'package:aplicacionrutasturisticas/config/router.dart'; import 'package:flutter/material.dart'; -import 'package:aplicacionrutasturisticas/pages/login.dart'; -import 'package:aplicacionrutasturisticas/pages/register.dart'; +import 'package:flutter_localizations/flutter_localizations.dart'; +import 'package:provider/provider.dart'; +import 'package:firebase_core/firebase_core.dart'; +import 'firebase_options.dart'; +import 'package:aplicacionrutasturisticas/config/router.dart'; +import 'package:aplicacionrutasturisticas/providers/locale_translade_provider.dart'; +import 'package:aplicacionrutasturisticas/providers/database_translade_provider.dart'; +import 'generated/l10n.dart'; -void main() { +void main() async { + WidgetsFlutterBinding.ensureInitialized(); + await Firebase.initializeApp( + options: DefaultFirebaseOptions.currentPlatform, + ); runApp(MyApp()); } class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { - return MaterialApp.router(routerConfig: router); + return MultiProvider( + providers: [ + ChangeNotifierProvider( + create: (_) => LocaleProvider(), + ), + ChangeNotifierProvider( + create: (_) => TranslationProvider(), + ), + ], + child: Consumer2( + builder: (context, localeProvider, translationProvider, child) { + return MaterialApp.router( + locale: localeProvider.locale, + supportedLocales: S.delegate.supportedLocales, + localizationsDelegates: [ + S.delegate, + GlobalMaterialLocalizations.delegate, + GlobalWidgetsLocalizations.delegate, + GlobalCupertinoLocalizations.delegate, + ], + routerConfig: router, + ); + }, + ), + ); } } + + +// Recuerda usar el comando cada vez que actualices los idiomas +//flutter pub run intl_utils:generate \ No newline at end of file diff --git a/fronted/aplicacionrutasturisticas/lib/metodos/cambio_idioma.dart b/fronted/aplicacionrutasturisticas/lib/metodos/cambio_idioma.dart new file mode 100644 index 0000000000000000000000000000000000000000..41829c0f49287b7df55c205cf44f45cb1bb01e6f --- /dev/null +++ b/fronted/aplicacionrutasturisticas/lib/metodos/cambio_idioma.dart @@ -0,0 +1,20 @@ +import 'package:aplicacionrutasturisticas/providers/database_translade_provider.dart'; +import 'package:aplicacionrutasturisticas/variables/perfil_variables.dart' + as globals; +import 'package:aplicacionrutasturisticas/providers/locale_translade_provider.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class CambiarIdioma { + // Método para cambiar el idioma del texto fijo + void cambiarIdiomaLocal(BuildContext context) { + final provider = Provider.of(context, listen: false); + provider.setLocale(Locale(globals.getLenguaje)); + } + + // Método para cambiar dinámicamente el idioma del texto + Future cambiarIdiomaDinamico(BuildContext context, String texto) { + return Provider.of(context, listen: false) + .translateText(texto); + } +} diff --git a/fronted/aplicacionrutasturisticas/lib/metodos/images/star_page/images_starpage.dart b/fronted/aplicacionrutasturisticas/lib/metodos/images/star_page/images_starpage.dart new file mode 100644 index 0000000000000000000000000000000000000000..8fcb0fc7476bffa8dab07d2badb1429cd1bdbc31 --- /dev/null +++ b/fronted/aplicacionrutasturisticas/lib/metodos/images/star_page/images_starpage.dart @@ -0,0 +1,38 @@ +import 'package:aplicacionrutasturisticas/metodos/images/star_page/obtener_imagenes_lista.dart'; +import 'package:flutter/material.dart'; +import 'package:firebase_storage/firebase_storage.dart' as firebase_storage; +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:firebase_auth/firebase_auth.dart'; + +class ImagenSola extends StatefulWidget { + @override + _ImagenSolaState createState() => _ImagenSolaState(); +} + +class _ImagenSolaState extends State { + String imageURL = ""; + @override + void initState() { + super.initState(); + // Llamar a getImageUrl en initState para obtener la URL de la imagen cuando se inicie el widget + getImageUrl(); + } + + Future getImageUrl() async { + try { + firebase_storage.Reference ref = firebase_storage.FirebaseStorage.instance + .ref('zacatecas/zacatecas-mexico-street-sunshine.jpeg'); + + // Obtener la URL del archivo + String downloadUrl = await ref.getDownloadURL(); + imageURL = downloadUrl; + } catch (e) { + print('Error al obtener la URL de la imagen: $e'); + } + } + + @override + Widget build(BuildContext context) { + return Image.network(imageURL); + } +} diff --git a/fronted/aplicacionrutasturisticas/lib/metodos/images/star_page/obtener_imagenes_lista.dart b/fronted/aplicacionrutasturisticas/lib/metodos/images/star_page/obtener_imagenes_lista.dart new file mode 100644 index 0000000000000000000000000000000000000000..aa0b3e9e1e80d446bcbfe6dfee315cc4fa05d651 --- /dev/null +++ b/fronted/aplicacionrutasturisticas/lib/metodos/images/star_page/obtener_imagenes_lista.dart @@ -0,0 +1,29 @@ +import 'package:flutter/material.dart'; +import 'package:firebase_storage/firebase_storage.dart' as firebase_storage; +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:firebase_auth/firebase_auth.dart'; + +class ImagenesDesdeStorage { + Future> ImagesFromStorage(String tu_carpeta) async { + List imageURLs = []; + + // Aquí definimos la carpeta específica de la que queremos obtener las imágenes + String folderPath = tu_carpeta; + try { + // Obtenemos la referencia a la carpeta en Firebase Storage + firebase_storage.ListResult listResult = await firebase_storage + .FirebaseStorage.instance + .ref(tu_carpeta) + .list(); + + // Iteramos sobre los elementos en la carpeta + for (firebase_storage.Reference ref in listResult.items) { + // Obtenemos la URL de descarga del archivo + String downloadURL = await ref.getDownloadURL(); + imageURLs.add(downloadURL); + } + } catch (e) {} + + return imageURLs; + } +} diff --git a/fronted/aplicacionrutasturisticas/lib/metodos/perfil_metodos.dart b/fronted/aplicacionrutasturisticas/lib/metodos/perfil_metodos.dart new file mode 100644 index 0000000000000000000000000000000000000000..e2a284b980d28c2c2b52f14c2c5ad67d3a6a3f16 --- /dev/null +++ b/fronted/aplicacionrutasturisticas/lib/metodos/perfil_metodos.dart @@ -0,0 +1,12 @@ +import 'package:aplicacionrutasturisticas/variables/perfil_variables.dart' + as globals; + +class Perfil_metodos { + void precionasteIdioma() { + print("Haz precionado idoma"); + } + + void seleccionasteIdioma(String idioma) { + print("Selecionaste el idioma: " + globals.getLenguaje); + } +} diff --git a/fronted/aplicacionrutasturisticas/lib/metodos/places/datos_places.dart b/fronted/aplicacionrutasturisticas/lib/metodos/places/datos_places.dart new file mode 100644 index 0000000000000000000000000000000000000000..0d5a4e6c9dfd38b833d94af8e153ff7059b68453 --- /dev/null +++ b/fronted/aplicacionrutasturisticas/lib/metodos/places/datos_places.dart @@ -0,0 +1,36 @@ +import 'package:aplicacionrutasturisticas/config/dio.dart'; + +class DatosPlaces { + late List description_base; + + Future loadCityNameDescription(String name, int idCity) async { + // Usa await para esperar la carga de datos + List description = await findAllDatPlace(name, idCity); + description_base = description; + } + + String loadNamePlace() { + // Accede al nombre utilizando la clave 'name' + return description_base[0] ?? ''; + } + + String loadDescriptionPlace() { + // Accede a la descripción utilizando la clave 'description' + return description_base[1] ?? ''; + } + + String loadSchedulePlace() { + // Accede al horario utilizando la clave 'schedule' + return description_base[2] ?? ''; + } + + String loadAddressPlace() { + // Accede a la dirección utilizando la clave 'address' + return description_base[3] ?? ''; + } + + String loadCategories() { + // Accede a las categorías utilizando la clave 'categories' + return description_base[4] ?? ''; + } +} diff --git a/fronted/aplicacionrutasturisticas/lib/pages/login.dart b/fronted/aplicacionrutasturisticas/lib/pages/login.dart index 84a9aa2bc848a26f1e258feea0204e7f015e5328..a799dd7c15737ad9d2a3e2be94a8bca20321e0d2 100644 --- a/fronted/aplicacionrutasturisticas/lib/pages/login.dart +++ b/fronted/aplicacionrutasturisticas/lib/pages/login.dart @@ -1,7 +1,7 @@ import 'package:aplicacionrutasturisticas/config/dio.dart'; import 'package:aplicacionrutasturisticas/utilerias/TextButtons.dart'; import 'package:flutter/material.dart'; - +import 'package:aplicacionrutasturisticas/generated/l10n.dart'; import 'package:aplicacionrutasturisticas/utilerias/Buttons.dart'; import 'package:aplicacionrutasturisticas/utilerias/Textfields.dart'; import 'package:go_router/go_router.dart'; @@ -26,7 +26,7 @@ class _TextFielEjemploState extends State { appBar: AppBar( title: SizedBox( child: Center( - child: Text("Inicia Sesión", + child: Text(S().inicia_sesion, style: const TextStyle(fontWeight: FontWeight.bold), selectionColor: Colors.black))), ), @@ -40,16 +40,14 @@ class _TextFielEjemploState extends State { height: 20.0, ), hacerTextField( - controller: correo, - texto: "Correo electronico", - ocultar: false), + controller: correo, texto: S().correo, ocultar: false), SizedBox(height: 20), Row( mainAxisAlignment: MainAxisAlignment.center, children: [ hacerTextField( controller: password, - texto: "Contraseña", + texto: S().pasword, ocultar: true, ), ], @@ -58,38 +56,38 @@ class _TextFielEjemploState extends State { ColoredBox( color: Colors.white, child: boton_Escribir( - texto: "Iniciar sesión", + texto: S().inicia_sesion, onPression: botonIniciaSesion, )), SizedBox(height: 20), Row( children: [ - const Text(" ¿Nuevo en la aplicacion?"), + Text(" ${S().inicio_nuevo_aplicacion}"), HacerTextButtons( - texto: "Registrarte", onPression: botonRegistrar) + texto: S().registrarte, onPression: botonRegistrar) ], ), SizedBox(height: 15), Row( children: [ - const Text(" Entrar como"), + Text(" ${S().inicio_sesion_entrar_invitado}"), HacerTextButtons( - texto: "Invitado", onPression: botonRegistrar) + texto: S().invitado, onPression: botonRegistrar) ], ), - ], - ), + ], ), ), ), - ); + ), + ); } void botonIniciaSesion() { corr = correo.text; pass = password.text; print(corr + " " + pass); - loginDatos(corr, pass); + //loginDatos(corr, pass); context.goNamed("StartPage"); } diff --git a/fronted/aplicacionrutasturisticas/lib/pages/place.dart b/fronted/aplicacionrutasturisticas/lib/pages/place.dart new file mode 100644 index 0000000000000000000000000000000000000000..26c8456d04cda1f35aac0d8d3c97f4aeec6e82c8 --- /dev/null +++ b/fronted/aplicacionrutasturisticas/lib/pages/place.dart @@ -0,0 +1,144 @@ +import 'package:aplicacionrutasturisticas/metodos/images/star_page/obtener_imagenes_lista.dart'; +import 'package:aplicacionrutasturisticas/utilerias/Carusels.dart'; +import 'package:aplicacionrutasturisticas/metodos/places/datos_places.dart'; +import 'package:aplicacionrutasturisticas/utilerias/FutureBuilder.dart'; +import 'package:aplicacionrutasturisticas/variables/perfil_variables.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class PlaceBase extends StatefulWidget { + final String place; +//El Rodillote + const PlaceBase({Key? key, required this.place}) : super(key: key); + + @override + _PlaceBaseState createState() => _PlaceBaseState(); +} + +class _PlaceBaseState extends State { + List imgList = []; + bool isLoading = true; + String namePlace = ""; + String descriprionPlace = ""; + String schedulePlace = ""; + String adrresPlace = ""; + String categoriesPlace = ""; + + @override //Es el contructor que se inicializa al momento de inicar la pagina + void initState() { + super.initState(); + loadImgList(); + loadData(); + } + + //Este metodo manda a llamar a la clase Datos Place para obtener la infomacion del lugar + void loadData() async { + try { + DatosPlaces datos = DatosPlaces(); + await datos.loadCityNameDescription(widget.place, getIdCity); + + setState(() { + namePlace = datos.loadNamePlace(); + descriprionPlace = datos.loadDescriptionPlace(); + schedulePlace = datos.loadSchedulePlace(); + adrresPlace = datos.loadAddressPlace(); + categoriesPlace = datos.loadCategories(); + }); + loadImgList(); + } catch (error) { + print('Error loading data: $error'); + setState(() { + isLoading = false; + }); + } + } + + void loadImgList() async { + ImagenesDesdeStorage ima = ImagenesDesdeStorage(); + List urls = + await ima.ImagesFromStorage("zacatecas/places/${widget.place}/"); + setState(() { + imgList = urls; + isLoading = false; + }); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + body: CustomScrollView( + slivers: [ + SliverList( + delegate: SliverChildListDelegate([ + // Aqui se ponen los widgets + Container( + height: 800, + decoration: BoxDecoration( + image: DecorationImage( + image: NetworkImage( + 'https://www.turimexico.com/wp-content/uploads/2015/10/ciudad-de-zacatecas.jpg', + ), + fit: BoxFit.cover, + colorFilter: ColorFilter.mode( + Colors.white.withOpacity(0.5), + BlendMode.darken, + ), + ), + ), + child: Padding( + padding: EdgeInsets.all(25), + child: ClipRRect( + borderRadius: BorderRadius.circular(35), + child: Container( + height: 3.0, + width: 2.0, + color: Colors.white.withOpacity(0.0), + child: Center( + child: Column( + children: [ + //Aqui van los objetos + SizedBox(height: 50), + Text( + namePlace, + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 24, + ), + ), + isLoading + ? Center(child: CupertinoActivityIndicator()) + : carusel_images_list(imgList: imgList), + SizedBox(height: 20), + TextoDinamico( + texto: descriprionPlace, + colors: Colors.white, + ), + TextoDinamico( + texto: 'Horario: $schedulePlace', + colors: Colors.white), + SizedBox(height: 10), + Text( + 'Dirección: $adrresPlace', + style: TextStyle( + fontSize: 16, color: Colors.white), + ), + TextoDinamico( + texto: 'Categorías: $categoriesPlace', + colors: Colors.white) + ], + ), + ), + ), + ), + )), + ]), + ), + ], + ), + ); + } +} + +//Seb \ No newline at end of file diff --git a/fronted/aplicacionrutasturisticas/lib/pages/register.dart b/fronted/aplicacionrutasturisticas/lib/pages/register.dart index 3a05ced4ba128a227a2399604509d17263a3abe4..b7b2b49b1a7ef66f6a94f610813c5f428fc1c22a 100644 --- a/fronted/aplicacionrutasturisticas/lib/pages/register.dart +++ b/fronted/aplicacionrutasturisticas/lib/pages/register.dart @@ -115,6 +115,7 @@ class RegistroPageState extends State { if (pass == passc) { Registro_Datos(nom, ape, ema, pass); + //print("Se regitraron los datos"); context.goNamed("LoginPage"); } else { print("La contraseña es incorrecta"); diff --git a/fronted/aplicacionrutasturisticas/lib/pages/star_page.dart b/fronted/aplicacionrutasturisticas/lib/pages/star_page.dart new file mode 100644 index 0000000000000000000000000000000000000000..0eebce43604278088ba08fd1d1faa0b59a79686a --- /dev/null +++ b/fronted/aplicacionrutasturisticas/lib/pages/star_page.dart @@ -0,0 +1,190 @@ +import 'package:aplicacionrutasturisticas/config/dio.dart'; +import 'package:aplicacionrutasturisticas/metodos/images/star_page/obtener_imagenes_lista.dart'; +import 'package:aplicacionrutasturisticas/utilerias/FutureBuilder.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:go_router/go_router.dart'; +import 'package:provider/provider.dart'; +import 'package:aplicacionrutasturisticas/generated/l10n.dart'; +import 'package:aplicacionrutasturisticas/providers/database_translade_provider.dart'; +import 'package:aplicacionrutasturisticas/utilerias/Carusels.dart'; +import 'package:aplicacionrutasturisticas/utilerias/Perfil/AppBar_Perfil.dart'; +import 'package:aplicacionrutasturisticas/utilerias/Perfil/Drawer_Perfil.dart'; + +class StartedPage extends StatefulWidget { + const StartedPage({super.key}); + + @override + StartedPageState createState() => StartedPageState(); +} + +class StartedPageState extends State { + String cityName = ""; + String cityDescription = ""; + List imgList = []; + bool isLoading = true; + + @override + void initState() { + super.initState(); + loadCityName(); + loadCityNameDescription(); + loadImgList(); + } + + void loadCityName() async { + String name = await datosStartPage(1); + setState(() { + cityName = name ?? 'Error al cargar el nombre de la ciudad'; + }); + } + + void loadCityNameDescription() async { + String description = await datosTextStartPage(1); + setState(() { + cityDescription = + description ?? 'Error al cargar la descripción de la ciudad'; + }); + } + + void loadImgList() async { + ImagenesDesdeStorage ima = ImagenesDesdeStorage(); + List urls = await ima.ImagesFromStorage("zacatecas/"); + setState(() { + imgList = urls; + isLoading = false; + }); + } + + @override + Widget build(BuildContext context) { + final translationProvider = Provider.of(context); + return Scaffold( + body: Stack( + children: [ + Container( + decoration: BoxDecoration( + image: DecorationImage( + image: NetworkImage( + 'https://www.turimexico.com/wp-content/uploads/2015/10/ciudad-de-zacatecas.jpg', + ), + fit: BoxFit.cover, + colorFilter: ColorFilter.mode( + Colors.black.withOpacity(0.5), + BlendMode.darken, + ), + ), + ), + ), + SingleChildScrollView( + child: Column( + children: [ + const SizedBox( + height: kToolbarHeight, // Espacio para el AppBar + ), + Padding( + padding: EdgeInsets.all(16.0), + child: Text( + S.of(context).welcome_start_page + cityName, + style: const TextStyle( + color: Colors.white, + fontSize: 24, + fontWeight: FontWeight.bold, + ), + textAlign: TextAlign.center, + ), + ), + const SizedBox(height: 20), + isLoading + ? Center(child: CupertinoActivityIndicator()) + : carusel_images_list(imgList: imgList), + const SizedBox(height: 5), + Center( + child: Padding( + padding: EdgeInsets.all(20.0), + child: Container( + child: TextoDinamico( + texto: cityDescription, + colors: Color.fromARGB(255, 255, 255, 255))), + ), + ), + const SizedBox(height: 80) + ], + ), + ), + AppBar_Perfil(), //Este app se establece en el body, para que no genere conflictos de colision + Padding( + padding: const EdgeInsets.symmetric(horizontal: 10.0), + child: DraggableScrollableSheet( + initialChildSize: 0.2, + minChildSize: 0.1, + builder: + (BuildContext context, ScrollController scrollController) { + return ClipRRect( + borderRadius: const BorderRadius.only( + topLeft: Radius.circular(60.0), + topRight: Radius.circular(60.0), + ), + child: Container( + color: Colors.white, + child: Column( + children: [ + Container( + height: 5.0, + width: 50.0, + margin: const EdgeInsets.symmetric(vertical: 10.0), + decoration: BoxDecoration( + color: Colors.grey[300], + borderRadius: BorderRadius.circular(10.0), + ), + ), + Expanded( + child: ListView( + controller: scrollController, + children: [ + ListTile( + leading: Icon(Icons.location_history), + title: Text(S.of(context).create_route), + onTap: () { + // Acción al tocar la opción + }, + ), + ListTile( + leading: Icon(Icons.map), + title: Text(S.of(context).recommended_route), + onTap: () { + // Acción al tocar la opción + }, + ), + ListTile( + leading: Icon(Icons.list), + title: Text(S.of(context).list_of_places), + onTap: () { + context.goNamed("PlaceBase", pathParameters: { + 'place': 'El Rodillote' + }); + }, + ), + ListTile( + leading: Icon(Icons.star), + title: Text(S.of(context).complete_rutes), + onTap: () { + // Acción al tocar la opción + }, + ), + ], + ), + ), + ], + ), + ), + ); + }, + ), + ), + ], + ), + endDrawer: Perfil(), + ); + } +} diff --git a/fronted/aplicacionrutasturisticas/lib/pages/start_page.dart b/fronted/aplicacionrutasturisticas/lib/pages/start_page.dart deleted file mode 100644 index 18138e9190dc53c090d8bf3cb8117bbcc8e5dd0f..0000000000000000000000000000000000000000 --- a/fronted/aplicacionrutasturisticas/lib/pages/start_page.dart +++ /dev/null @@ -1,90 +0,0 @@ -import 'dart:ui'; - -import 'package:aplicacionrutasturisticas/utilerias/Images.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/widgets.dart'; - -class StartedPage extends StatefulWidget { - const StartedPage({super.key}); - - @override - StartedPageState createState() => StartedPageState(); -} - -class StartedPageState extends State { - final String nombre = "Pancho"; - final String bienvenida = "Bienvenido!"; - - @override - Widget build(BuildContext context) { - return MaterialApp( - home: Scaffold( - appBar: AppBar( - title: Text(bienvenida, - style: const TextStyle(fontWeight: FontWeight.bold), - selectionColor: Colors.black, - textScaleFactor: lerpDouble(2, 2, 3)), - ), - body: Center( - child: SingleChildScrollView( - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - ImagesWithTextNetwork( - text: "Crear Ruta", - onTap: buttonCrearRuta, - imageURL: - "https://www.eluniversal.com.mx/resizer/cyelyPh4C4pSbIBjHdO0WSF8FSs=/1100x666/cloudfront-us-east-1.images.arcpublishing.com/eluniversal/DWSWJNA4B5HDBKAXYD6YTFUUUI.jpg"), - //WithText(text: "Crear Ruta", onTap: buttonCrearRuta), - const SizedBox(width: 20), - ImagesWithTextNetwork( - text: "Ruta Recomendada", - onTap: buttonRutaRecomendada, - imageURL: - "https://assets.turismocity.com/cdn-cgi/image/format=auto,width=500,fit=scale-down/ruta-40-argentina.jpeg") - ], - ), - const SizedBox(height: 30), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - ImagesWithTextNetwork( - text: "Lista de Lugares", - onTap: buttonListadeLugares, - imageURL: - "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQhuG72NEweDkbylMmq7Mh3MSI0orCC4Xupsg&usqp=CAU"), - const SizedBox(width: 20), - ImagesWithTextNetwork( - text: "Rutas Completadas", - onTap: buttonRutasCompletadas, - imageURL: - "https://static.vecteezy.com/system/resources/previews/015/954/844/non_2x/all-systems-are-ready-tasks-completed-conditions-met-full-readiness-fact-check-series-of-correct-decisions-implementation-of-roadmap-agreement-compliance-with-criteria-fulfill-all-requirements-photo.jpg") - ], - ) - ], - ), - ), - ), - ), - ); - } - - void buttonCrearRuta() { - print("Haz presionado Crear Ruta"); - } - - void buttonRutaRecomendada() { - print("Haz presionado Ruta Recomendada"); - } - - void buttonListadeLugares() { - print("Haz precionado Lista de Lugares"); - } - - void buttonRutasCompletadas() { - print("Haz precionado Rutas Recomendadas"); - } -} diff --git a/fronted/aplicacionrutasturisticas/lib/providers/database_translade_provider.dart b/fronted/aplicacionrutasturisticas/lib/providers/database_translade_provider.dart new file mode 100644 index 0000000000000000000000000000000000000000..9031dfc7706d942fabb021a9716b17128c5d9b0c --- /dev/null +++ b/fronted/aplicacionrutasturisticas/lib/providers/database_translade_provider.dart @@ -0,0 +1,45 @@ +import 'package:flutter/material.dart'; +import 'package:dio/dio.dart'; +import 'package:aplicacionrutasturisticas/variables/perfil_variables.dart' + as globals; + +class TranslationProvider with ChangeNotifier { + final dio = Dio(); + final apiKey = 'AIzaSyCy0fR6vgP-I8bPe9C_rFFP8ZiHpOwQz6w'; + + Future translateText(String text) async { + try { + // Validar si el idioma de destino es español ('es') + String targetLanguage = + globals.getLenguaje == 'es' ? 'es' : globals.getLenguaje; + + Response response = await dio.post( + 'https://translation.googleapis.com/language/translate/v2', + queryParameters: { + 'key': apiKey, + 'q': text, + 'source': + 'es', // Código del idioma de origen (siempre es español aquí) + 'target': targetLanguage, // Código del idioma de destino + }, + ); + + if (response.statusCode == 200) { + print( + "Translated text: ${response.data['data']['translations'][0]['translatedText']}"); + return response.data['data']['translations'][0]['translatedText']; + } else { + print("Error status code: ${response.statusCode}"); + return text; + } + } catch (e) { + print("Error translating text: $e"); + return text; + } + } + + void changeLanguage(String language) { + globals.setLenguaje = language; + notifyListeners(); // Notificar cambios a los listeners (como FutureBuilder) + } +} diff --git a/fronted/aplicacionrutasturisticas/lib/providers/locale_translade_provider.dart b/fronted/aplicacionrutasturisticas/lib/providers/locale_translade_provider.dart new file mode 100644 index 0000000000000000000000000000000000000000..e192969444992a5200df7d0399e67594a41206c0 --- /dev/null +++ b/fronted/aplicacionrutasturisticas/lib/providers/locale_translade_provider.dart @@ -0,0 +1,48 @@ +import 'package:flutter/material.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +class LocaleProvider extends ChangeNotifier { + Locale? _locale; + + Locale? get locale => _locale; + + LocaleProvider() { + _loadLocale(); + } + + Future _loadLocale() async { + final prefs = await SharedPreferences.getInstance(); + final localeCode = + prefs.getString('locale') ?? 'es'; // Por defecto en español + _locale = Locale(localeCode); + notifyListeners(); + } + + Future setLocale(Locale locale) async { + if (!L10n.supportedLocales.contains(locale)) return; + + final prefs = await SharedPreferences.getInstance(); + await prefs.setString('locale', locale.languageCode); + + _locale = locale; + notifyListeners(); + } + + void clearLocale() async { + final prefs = await SharedPreferences.getInstance(); + await prefs.remove('locale'); + + _locale = null; + notifyListeners(); + } +} + +class L10n { + static final all = [ + const Locale('en'), + const Locale('es'), + const Locale('pt'), + ]; + + static List get supportedLocales => all; +} diff --git a/fronted/aplicacionrutasturisticas/lib/utilerias/Carusels.dart b/fronted/aplicacionrutasturisticas/lib/utilerias/Carusels.dart new file mode 100644 index 0000000000000000000000000000000000000000..a97c5e9cf4a536b27935b85624961bc438c0ceda --- /dev/null +++ b/fronted/aplicacionrutasturisticas/lib/utilerias/Carusels.dart @@ -0,0 +1,30 @@ +import 'package:flutter/material.dart'; +import 'package:carousel_slider/carousel_slider.dart'; + +class carusel_images_list extends StatelessWidget { + final List imgList; + + const carusel_images_list({Key? key, required this.imgList}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return CarouselSlider( + items: imgList + .map((item) => Center( + child: ClipRRect( + borderRadius: BorderRadius.circular(20), + child: Image.network(item, fit: BoxFit.cover, width: 1000), + ))) + .toList(), + options: CarouselOptions( + height: 200.0, + autoPlay: true, + autoPlayInterval: Duration(seconds: 5), + autoPlayAnimationDuration: Duration(milliseconds: 800), + autoPlayCurve: Curves.easeIn, + pauseAutoPlayOnTouch: true, + scrollDirection: Axis.horizontal, + enlargeCenterPage: true)); + } +} diff --git a/fronted/aplicacionrutasturisticas/lib/utilerias/FutureBuilder.dart b/fronted/aplicacionrutasturisticas/lib/utilerias/FutureBuilder.dart new file mode 100644 index 0000000000000000000000000000000000000000..9c33557c6acdd16632227ce03b5149a3ffa90b4d --- /dev/null +++ b/fronted/aplicacionrutasturisticas/lib/utilerias/FutureBuilder.dart @@ -0,0 +1,34 @@ +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import 'package:aplicacionrutasturisticas/metodos/cambio_idioma.dart'; + +class TextoDinamico extends StatelessWidget { + final String texto; + final Color colors; + + const TextoDinamico({Key? key, required this.texto, required this.colors}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return FutureBuilder( + future: CambiarIdioma().cambiarIdiomaDinamico(context, texto), + builder: (context, AsyncSnapshot snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return CircularProgressIndicator(); + } else if (snapshot.hasError) { + return const Text('Error al cargar la descripción'); + } else { + return Text( + snapshot.data ?? 'Cargando...', + style: TextStyle( + color: colors, + fontSize: 15, + ), + textAlign: TextAlign.justify, + ); + } + }, + ); + } +} diff --git a/fronted/aplicacionrutasturisticas/lib/utilerias/Images.dart b/fronted/aplicacionrutasturisticas/lib/utilerias/Images.dart index 3167ecbf381a71299503ff5e938e2ce668520e87..4db4487ad8671065d9af31c124f12a389d7fea4a 100644 --- a/fronted/aplicacionrutasturisticas/lib/utilerias/Images.dart +++ b/fronted/aplicacionrutasturisticas/lib/utilerias/Images.dart @@ -23,8 +23,8 @@ class ImagesWithTextNetwork extends StatelessWidget { children: [ Image.network( imageURL, - height: 100, - width: 150, + height: 150, + width: 250, ), Container( color: Colors.black54, @@ -41,11 +41,11 @@ class ImagesWithTextNetwork extends StatelessWidget { } } -class WithText extends StatelessWidget { +class WithTextOnli extends StatelessWidget { final String text; final VoidCallback? onTap; - const WithText({ + const WithTextOnli({ Key? key, required this.text, required this.onTap, @@ -54,30 +54,89 @@ class WithText extends StatelessWidget { @override Widget build(BuildContext context) { return InkWell( - customBorder: Border.all( - color: Colors.black, - width: 500, - ), onTap: onTap, - child: ClipRRect( - borderRadius: BorderRadius.circular(30), - child: Stack( - alignment: Alignment.center, - children: [ - Container( - width: 100, - height: 100, - color: Colors.white, - child: Center( - child: Text( - text, - style: TextStyle( - color: Colors.black, + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(30), + border: Border.all(color: Colors.black, width: 2)), + child: ClipRRect( + borderRadius: BorderRadius.circular(30), + child: Stack( + alignment: Alignment.center, + children: [ + Container( + width: 200, + height: 100, + color: Colors.white, + child: Center( + child: Text( + text, + style: TextStyle( + color: Colors.black, + ), + ), + ), + ) + ], + ), + ), + )); + } +} + +class WithTextImage extends StatelessWidget { + final String text; + final VoidCallback? onTap; + final String imageURL; + + const WithTextImage( + {Key? key, + required this.text, + required this.onTap, + required this.imageURL}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return InkWell( + onTap: onTap, + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(30), + border: Border.all(color: Colors.black, width: 2)), + child: ClipRRect( + borderRadius: BorderRadius.circular(28), + child: Stack( + alignment: Alignment.center, + children: [ + Container( + width: 250, + height: 125, + color: Colors.white, + child: Center( + child: Stack( + alignment: Alignment.center, + children: [ + Image.network(imageURL, + color: Colors.grey.withOpacity(0.7), + colorBlendMode: BlendMode.darken, + width: 250, + height: 150, + fit: BoxFit.cover), + Container( + child: Text( + text, + style: TextStyle( + color: Colors.white, + ), + ), + ) + ], ), ), ), - ) - ], + ], + ), ), )); } diff --git a/fronted/aplicacionrutasturisticas/lib/utilerias/MensajeEnMEdio.dart b/fronted/aplicacionrutasturisticas/lib/utilerias/MensajeEnMEdio.dart new file mode 100644 index 0000000000000000000000000000000000000000..68298c4e574d128aabccadb9729e25a5ba72eb87 --- /dev/null +++ b/fronted/aplicacionrutasturisticas/lib/utilerias/MensajeEnMEdio.dart @@ -0,0 +1,14 @@ +import 'package:flutter/material.dart'; + +class MensajeErrorDialog { + static void show(BuildContext context, String message) { + showDialog( + context: context, + builder: (BuildContext context) { + return AlertDialog( + content: Text(message), + ); + }, + ); + } +} diff --git a/fronted/aplicacionrutasturisticas/lib/utilerias/Perfil/AppBar_Perfil.dart b/fronted/aplicacionrutasturisticas/lib/utilerias/Perfil/AppBar_Perfil.dart new file mode 100644 index 0000000000000000000000000000000000000000..fdad9d4dd4d7615eee150dc4f86a6cb6dff91a39 --- /dev/null +++ b/fronted/aplicacionrutasturisticas/lib/utilerias/Perfil/AppBar_Perfil.dart @@ -0,0 +1,30 @@ +import 'package:flutter/material.dart'; + +class AppBar_Perfil extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Positioned( + top: 0, + left: 0, + right: 0, + child: AppBar( + backgroundColor: Colors.transparent, + elevation: 0, + actions: [ + Builder( + builder: (BuildContext context) { + return IconButton( + icon: Image.network( + 'https://i.ibb.co/Vw6XLpR/actualizar.png', + ), + onPressed: () { + Scaffold.of(context).openEndDrawer(); + }, + ); + }, + ), + ], + ), + ); + } +} diff --git a/fronted/aplicacionrutasturisticas/lib/utilerias/Perfil/CupertinoPicker_Perfil.dart b/fronted/aplicacionrutasturisticas/lib/utilerias/Perfil/CupertinoPicker_Perfil.dart new file mode 100644 index 0000000000000000000000000000000000000000..00d4ed63339c8ee7e412a156af50384060e9bafa --- /dev/null +++ b/fronted/aplicacionrutasturisticas/lib/utilerias/Perfil/CupertinoPicker_Perfil.dart @@ -0,0 +1,64 @@ +import 'package:aplicacionrutasturisticas/generated/l10n.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import 'package:aplicacionrutasturisticas/variables/perfil_variables.dart' + as globals; +import 'package:aplicacionrutasturisticas/metodos/perfil_metodos.dart'; +import 'package:aplicacionrutasturisticas/utilerias/MensajeEnMEdio.dart'; +import 'package:aplicacionrutasturisticas/metodos/cambio_idioma.dart'; + +class CupertinoPickerWidget_perfil extends StatefulWidget { + @override + _CupertinoPickerWidget_perfilState createState() => + _CupertinoPickerWidget_perfilState(); +} + +class _CupertinoPickerWidget_perfilState + extends State { + int _selectedValue = 0; + final List _options = ['Español', 'Inglés']; + + @override + Widget build(BuildContext context) { + return Container( + height: MediaQuery.of(context).size.height / 3, + child: Column( + children: [ + Expanded( + child: CupertinoPicker( + backgroundColor: Colors.white, + onSelectedItemChanged: (value) { + setState(() { + _selectedValue = value; + }); + }, + itemExtent: 32.0, + children: _options.map((option) => Text(option)).toList(), + ), + ), + ElevatedButton( + onPressed: () { + // Actualizar el idioma globalmente en la aplicación + globals.setLenguaje = _options[_selectedValue]; + + // Opcional: Ejecutar métodos adicionales según la selección de idioma + Perfil_metodos().seleccionasteIdioma(_options[_selectedValue]); + CambiarIdioma().cambiarIdiomaLocal(context); + + // Mostrar mensaje de confirmación + MensajeErrorDialog.show( + context, + S().notificacion_cambio_idioma + " ${globals.getLenguaje}", + ); + }, + child: Text( + S().confirm, + style: TextStyle(fontSize: 20), + ), + ), + ], + ), + ); + } +} diff --git a/fronted/aplicacionrutasturisticas/lib/utilerias/Perfil/Drawer_Perfil.dart b/fronted/aplicacionrutasturisticas/lib/utilerias/Perfil/Drawer_Perfil.dart new file mode 100644 index 0000000000000000000000000000000000000000..5fce22c6ad3d168720a047e58a137276cf3b2ecb --- /dev/null +++ b/fronted/aplicacionrutasturisticas/lib/utilerias/Perfil/Drawer_Perfil.dart @@ -0,0 +1,70 @@ +import 'package:aplicacionrutasturisticas/utilerias/Perfil/CupertinoPicker_Perfil.dart'; +import 'package:aplicacionrutasturisticas/generated/l10n.dart'; +import 'package:aplicacionrutasturisticas/utilerias/Textfields.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; +import 'package:aplicacionrutasturisticas/metodos/perfil_metodos.dart'; + +class Perfil extends StatefulWidget { + @override + _PerfilState createState() => _PerfilState(); +} + +class _PerfilState extends State { + void llamridioma() { + showModalBottomSheet( + context: context, + builder: (BuildContext context) { + return Container( + child: Padding( + padding: const EdgeInsets.all(10), + child: Column( + mainAxisSize: MainAxisSize + .min, // Ajusta el tamaño de la columna al contenido + children: [ + Text( + S().seleciona_tu_idioma, + textAlign: TextAlign.center, + style: TextStyle(fontSize: 20), + ), + CupertinoPickerWidget_perfil() + ], + ), + ), + ); + }, + ); + } + + @override + Widget build(BuildContext context) { + return Drawer( + child: ListView( + padding: EdgeInsets.zero, + children: [ + iconButton(), + Text("Nombre", textAlign: TextAlign.center), + ListTile( + leading: Icon(Icons.message), + title: Text(S().informacion_personal), + onTap: () {}, + ), + ListTile( + leading: Icon(Icons.account_circle), + title: Text(S().formulario), + onTap: () {}, + ), + ListTile( + leading: Icon(Icons.sunny), + title: Text(S().idiom), + onTap: () { + Perfil_metodos().precionasteIdioma(); + llamridioma(); // Llama al método para mostrar el modal + }, + ), + ], + ), + ); + } +} diff --git a/fronted/aplicacionrutasturisticas/lib/variables/perfil_variables.dart b/fronted/aplicacionrutasturisticas/lib/variables/perfil_variables.dart new file mode 100644 index 0000000000000000000000000000000000000000..04e608db3873f98e5309b0fac42c994caaeb0257 --- /dev/null +++ b/fronted/aplicacionrutasturisticas/lib/variables/perfil_variables.dart @@ -0,0 +1,14 @@ +String idioma = "es"; + +String get getLenguaje => idioma; + +set setLenguaje(String lenguaje) { + if (lenguaje == "Inglés") { + idioma = 'en'; + } else if (lenguaje == "Español") { + idioma = 'es'; + } +} + +int idCity = 1; +int get getIdCity => idCity; diff --git a/fronted/aplicacionrutasturisticas/pubspec.lock b/fronted/aplicacionrutasturisticas/pubspec.lock index 723ddd69337c889a25f13a7d38a0cd521aca7ccf..fe6c0327b4793aa28ba3980895218507b558f5e1 100644 --- a/fronted/aplicacionrutasturisticas/pubspec.lock +++ b/fronted/aplicacionrutasturisticas/pubspec.lock @@ -1,6 +1,46 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: "0b2f2bd91ba804e53a61d757b986f89f1f9eaed5b11e4b2f5a2468d86d6c9fc7" + url: "https://pub.dev" + source: hosted + version: "67.0.0" + _flutterfire_internals: + dependency: transitive + description: + name: _flutterfire_internals + sha256: "37a42d06068e2fe3deddb2da079a8c4d105f241225ba27b7122b37e9865fd8f7" + url: "https://pub.dev" + source: hosted + version: "1.3.35" + analyzer: + dependency: transitive + description: + name: analyzer + sha256: "37577842a27e4338429a1cbc32679d508836510b056f1eedf0c8d20e39c1383d" + url: "https://pub.dev" + source: hosted + version: "6.4.1" + archive: + dependency: transitive + description: + name: archive + sha256: cb6a278ef2dbb298455e1a713bda08524a175630ec643a242c399c932a0a1f7d + url: "https://pub.dev" + source: hosted + version: "3.6.1" + args: + dependency: transitive + description: + name: args + sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a" + url: "https://pub.dev" + source: hosted + version: "2.5.0" async: dependency: transitive description: @@ -17,6 +57,38 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.1" + cached_network_image: + dependency: "direct main" + description: + name: cached_network_image + sha256: "28ea9690a8207179c319965c13cd8df184d5ee721ae2ce60f398ced1219cea1f" + url: "https://pub.dev" + source: hosted + version: "3.3.1" + cached_network_image_platform_interface: + dependency: transitive + description: + name: cached_network_image_platform_interface + sha256: "9e90e78ae72caa874a323d78fa6301b3fb8fa7ea76a8f96dc5b5bf79f283bf2f" + url: "https://pub.dev" + source: hosted + version: "4.0.0" + cached_network_image_web: + dependency: transitive + description: + name: cached_network_image_web + sha256: "205d6a9f1862de34b93184f22b9d2d94586b2f05c581d546695e3d8f6a805cd7" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + carousel_slider: + dependency: "direct main" + description: + name: carousel_slider + sha256: "9c695cc963bf1d04a47bd6021f68befce8970bcd61d24938e1fb0918cf5d9c42" + url: "https://pub.dev" + source: hosted + version: "4.2.1" characters: dependency: transitive description: @@ -41,6 +113,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.18.0" + convert: + dependency: transitive + description: + name: convert + sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + url: "https://pub.dev" + source: hosted + version: "3.1.1" + crypto: + dependency: transitive + description: + name: crypto + sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + url: "https://pub.dev" + source: hosted + version: "3.0.3" cupertino_icons: dependency: "direct main" description: @@ -49,6 +137,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.8" + dart_style: + dependency: transitive + description: + name: dart_style + sha256: "99e066ce75c89d6b29903d788a7bb9369cf754f7b24bf70bf4b6d6d6b26853b9" + url: "https://pub.dev" + source: hosted + version: "2.3.6" dio: dependency: "direct main" description: @@ -65,11 +161,115 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.1" + ffi: + dependency: transitive + description: + name: ffi + sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + file: + dependency: transitive + description: + name: file + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + url: "https://pub.dev" + source: hosted + version: "7.0.0" + firebase_auth: + dependency: "direct main" + description: + name: firebase_auth + sha256: cfc2d970829202eca09e2896f0a5aa7c87302817ecc0bdfa954f026046bf10ba + url: "https://pub.dev" + source: hosted + version: "4.20.0" + firebase_auth_platform_interface: + dependency: transitive + description: + name: firebase_auth_platform_interface + sha256: a0270e1db3b2098a14cb2a2342b3cd2e7e458e0c391b1f64f6f78b14296ec093 + url: "https://pub.dev" + source: hosted + version: "7.3.0" + firebase_auth_web: + dependency: transitive + description: + name: firebase_auth_web + sha256: "64e067e763c6378b7e774e872f0f59f6812885e43020e25cde08f42e9459837b" + url: "https://pub.dev" + source: hosted + version: "5.12.0" + firebase_core: + dependency: "direct main" + description: + name: firebase_core + sha256: "26de145bb9688a90962faec6f838247377b0b0d32cc0abecd9a4e43525fc856c" + url: "https://pub.dev" + source: hosted + version: "2.32.0" + firebase_core_platform_interface: + dependency: transitive + description: + name: firebase_core_platform_interface + sha256: "1003a5a03a61fc9a22ef49f37cbcb9e46c86313a7b2e7029b9390cf8c6fc32cb" + url: "https://pub.dev" + source: hosted + version: "5.1.0" + firebase_core_web: + dependency: transitive + description: + name: firebase_core_web + sha256: "6643fe3dbd021e6ccfb751f7882b39df355708afbdeb4130fc50f9305a9d1a3d" + url: "https://pub.dev" + source: hosted + version: "2.17.2" + firebase_storage: + dependency: "direct main" + description: + name: firebase_storage + sha256: "2ae478ceec9f458c1bcbf0ee3e0100e4e909708979e83f16d5d9fba35a5b42c1" + url: "https://pub.dev" + source: hosted + version: "11.7.7" + firebase_storage_platform_interface: + dependency: transitive + description: + name: firebase_storage_platform_interface + sha256: "4e18662e6a66e2e0e181c06f94707de06d5097d70cfe2b5141bf64660c5b5da9" + url: "https://pub.dev" + source: hosted + version: "5.1.22" + firebase_storage_web: + dependency: transitive + description: + name: firebase_storage_web + sha256: "3a44aacd38a372efb159f6fe36bb4a7d79823949383816457fd43d3d47602a53" + url: "https://pub.dev" + source: hosted + version: "3.9.7" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" + url: "https://pub.dev" + source: hosted + version: "1.1.0" flutter: dependency: "direct main" description: flutter source: sdk version: "0.0.0" + flutter_cache_manager: + dependency: transitive + description: + name: flutter_cache_manager + sha256: "8207f27539deb83732fdda03e259349046a39a4c767269285f449ade355d54ba" + url: "https://pub.dev" + source: hosted + version: "3.3.1" flutter_lints: dependency: "direct dev" description: @@ -78,6 +278,11 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.3" + flutter_localizations: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" flutter_test: dependency: "direct dev" description: flutter @@ -88,6 +293,14 @@ packages: description: flutter source: sdk version: "0.0.0" + glob: + dependency: transitive + description: + name: glob + sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" + url: "https://pub.dev" + source: hosted + version: "2.1.2" go_router: dependency: "direct main" description: @@ -96,6 +309,14 @@ packages: url: "https://pub.dev" source: hosted version: "13.2.5" + http: + dependency: "direct main" + description: + name: http + sha256: "5895291c13fa8a3bd82e76d5627f69e0d85ca6a30dcac95c4ea19a5d555879c2" + url: "https://pub.dev" + source: hosted + version: "0.13.6" http_parser: dependency: transitive description: @@ -104,6 +325,30 @@ packages: url: "https://pub.dev" source: hosted version: "4.0.2" + intl: + dependency: "direct main" + description: + name: intl + sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" + url: "https://pub.dev" + source: hosted + version: "0.18.1" + intl_translation: + dependency: "direct dev" + description: + name: intl_translation + sha256: b858d88b569f3c529e992ba7186aa495f3e862897df60edb932563c619943610 + url: "https://pub.dev" + source: hosted + version: "0.20.0" + intl_utils: + dependency: "direct dev" + description: + name: intl_utils + sha256: c2b1f5c72c25512cbeef5ab015c008fc50fe7e04813ba5541c25272300484bf4 + url: "https://pub.dev" + source: hosted + version: "2.8.7" leak_tracker: dependency: transitive description: @@ -168,6 +413,30 @@ packages: url: "https://pub.dev" source: hosted version: "1.11.0" + nested: + dependency: transitive + description: + name: nested + sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + octo_image: + dependency: transitive + description: + name: octo_image + sha256: "45b40f99622f11901238e18d48f5f12ea36426d8eced9f4cbf58479c7aa2430d" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + package_config: + dependency: transitive + description: + name: package_config + sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + url: "https://pub.dev" + source: hosted + version: "2.1.0" path: dependency: transitive description: @@ -176,6 +445,158 @@ packages: url: "https://pub.dev" source: hosted version: "1.9.0" + path_provider: + dependency: transitive + description: + name: path_provider + sha256: c9e7d3a4cd1410877472158bee69963a4579f78b68c65a2b7d40d1a7a88bb161 + url: "https://pub.dev" + source: hosted + version: "2.1.3" + path_provider_android: + dependency: transitive + description: + name: path_provider_android + sha256: a248d8146ee5983446bf03ed5ea8f6533129a12b11f12057ad1b4a67a2b3b41d + url: "https://pub.dev" + source: hosted + version: "2.2.4" + path_provider_foundation: + dependency: transitive + description: + name: path_provider_foundation + sha256: f234384a3fdd67f989b4d54a5d73ca2a6c422fa55ae694381ae0f4375cd1ea16 + url: "https://pub.dev" + source: hosted + version: "2.4.0" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 + url: "https://pub.dev" + source: hosted + version: "2.2.1" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + sha256: "8bc9f22eee8690981c22aa7fc602f5c85b497a6fb2ceb35ee5a5e5ed85ad8170" + url: "https://pub.dev" + source: hosted + version: "2.2.1" + petitparser: + dependency: transitive + description: + name: petitparser + sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27 + url: "https://pub.dev" + source: hosted + version: "6.0.2" + platform: + dependency: transitive + description: + name: platform + sha256: "9b71283fc13df574056616011fb138fd3b793ea47cc509c189a6c3fa5f8a1a65" + url: "https://pub.dev" + source: hosted + version: "3.1.5" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" + url: "https://pub.dev" + source: hosted + version: "2.1.8" + provider: + dependency: "direct main" + description: + name: provider + sha256: c8a055ee5ce3fd98d6fc872478b03823ffdb448699c6ebdbbc71d59b596fd48c + url: "https://pub.dev" + source: hosted + version: "6.1.2" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + rxdart: + dependency: transitive + description: + name: rxdart + sha256: "0c7c0cedd93788d996e33041ffecda924cc54389199cde4e6a34b440f50044cb" + url: "https://pub.dev" + source: hosted + version: "0.27.7" + shared_preferences: + dependency: "direct main" + description: + name: shared_preferences + sha256: d3bbe5553a986e83980916ded2f0b435ef2e1893dfaa29d5a7a790d0eca12180 + url: "https://pub.dev" + source: hosted + version: "2.2.3" + shared_preferences_android: + dependency: transitive + description: + name: shared_preferences_android + sha256: "1ee8bf911094a1b592de7ab29add6f826a7331fb854273d55918693d5364a1f2" + url: "https://pub.dev" + source: hosted + version: "2.2.2" + shared_preferences_foundation: + dependency: transitive + description: + name: shared_preferences_foundation + sha256: "0a8a893bf4fd1152f93fec03a415d11c27c74454d96e2318a7ac38dd18683ab7" + url: "https://pub.dev" + source: hosted + version: "2.4.0" + shared_preferences_linux: + dependency: transitive + description: + name: shared_preferences_linux + sha256: "9f2cbcf46d4270ea8be39fa156d86379077c8a5228d9dfdb1164ae0bb93f1faa" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + shared_preferences_platform_interface: + dependency: transitive + description: + name: shared_preferences_platform_interface + sha256: "22e2ecac9419b4246d7c22bfbbda589e3acf5c0351137d87dd2939d984d37c3b" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + shared_preferences_web: + dependency: transitive + description: + name: shared_preferences_web + sha256: "9aee1089b36bd2aafe06582b7d7817fd317ef05fc30e6ba14bff247d0933042a" + url: "https://pub.dev" + source: hosted + version: "2.3.0" + shared_preferences_windows: + dependency: transitive + description: + name: shared_preferences_windows + sha256: "841ad54f3c8381c480d0c9b508b89a34036f512482c407e6df7a9c4aa2ef8f59" + url: "https://pub.dev" + source: hosted + version: "2.3.2" sky_engine: dependency: transitive description: flutter @@ -189,6 +610,30 @@ packages: url: "https://pub.dev" source: hosted version: "1.10.0" + sprintf: + dependency: transitive + description: + name: sprintf + sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23" + url: "https://pub.dev" + source: hosted + version: "7.0.0" + sqflite: + dependency: transitive + description: + name: sqflite + sha256: a43e5a27235518c03ca238e7b4732cf35eabe863a369ceba6cbefa537a66f16d + url: "https://pub.dev" + source: hosted + version: "2.3.3+1" + sqflite_common: + dependency: transitive + description: + name: sqflite_common + sha256: "3da423ce7baf868be70e2c0976c28a1bb2f73644268b7ffa7d2e08eab71f16a4" + url: "https://pub.dev" + source: hosted + version: "2.5.4" stack_trace: dependency: transitive description: @@ -213,6 +658,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.0" + synchronized: + dependency: transitive + description: + name: synchronized + sha256: "539ef412b170d65ecdafd780f924e5be3f60032a1128df156adad6c5b373d558" + url: "https://pub.dev" + source: hosted + version: "3.1.0+1" term_glyph: dependency: transitive description: @@ -237,6 +690,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.2" + uuid: + dependency: transitive + description: + name: uuid + sha256: "814e9e88f21a176ae1359149021870e87f7cddaf633ab678a5d2b0bff7fd1ba8" + url: "https://pub.dev" + source: hosted + version: "4.4.0" vector_math: dependency: transitive description: @@ -253,6 +714,46 @@ packages: url: "https://pub.dev" source: hosted version: "13.0.0" + watcher: + dependency: transitive + description: + name: watcher + sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + web: + dependency: transitive + description: + name: web + sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27" + url: "https://pub.dev" + source: hosted + version: "0.5.1" + win32: + dependency: transitive + description: + name: win32 + sha256: "0eaf06e3446824099858367950a813472af675116bf63f008a4c2a75ae13e9cb" + url: "https://pub.dev" + source: hosted + version: "5.5.0" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + sha256: faea9dee56b520b55a566385b84f2e8de55e7496104adada9962e0bd11bcff1d + url: "https://pub.dev" + source: hosted + version: "1.0.4" + yaml: + dependency: transitive + description: + name: yaml + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + url: "https://pub.dev" + source: hosted + version: "3.1.2" sdks: - dart: ">=3.2.6 <4.0.0" - flutter: ">=3.16.0" + dart: ">=3.3.0 <4.0.0" + flutter: ">=3.19.0" diff --git a/fronted/aplicacionrutasturisticas/pubspec.yaml b/fronted/aplicacionrutasturisticas/pubspec.yaml index a66ab6ae69206e116949624dfa3b774083e78064..f74e2e692090b6b712c9825fb1fd92886901c566 100644 --- a/fronted/aplicacionrutasturisticas/pubspec.yaml +++ b/fronted/aplicacionrutasturisticas/pubspec.yaml @@ -30,24 +30,32 @@ environment: dependencies: flutter: sdk: flutter - - - # The following adds the Cupertino Icons font to your application. - # Use with the CupertinoIcons class for iOS style icons. + flutter_localizations: + sdk: flutter + shared_preferences: ^2.0.11 + provider: ^6.0.3 cupertino_icons: ^1.0.2 go_router: ^13.2.4 dio: ^5.4.3+1 - + intl: ^0.18.1 + firebase_core: ^2.32.0 + firebase_storage: ^11.7.7 + firebase_auth: ^4.8.1 + cached_network_image: ^3.3.1 + carousel_slider: ^4.0.0 + http: ^0.13.4 + dev_dependencies: flutter_test: sdk: flutter - # The "flutter_lints" package below contains a set of recommended lints to # encourage good coding practices. The lint set provided by the package is # activated in the `analysis_options.yaml` file located at the root of your # package. See that file for information about deactivating specific lint # rules and activating additional ones. flutter_lints: ^2.0.0 + intl_translation: ^0.20.0 + intl_utils: ^2.3.0 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec @@ -58,8 +66,12 @@ flutter: # The following line ensures that the Material Icons font is # included with your application, so that you can use the icons in # the material Icons class. + generate: true uses-material-design: true + assets: + - lib/l10n/arb/ + # To add assets to your application, add an assets section, like this: # assets: # - images/a_dot_burr.jpeg diff --git a/fronted/aplicacionrutasturisticas/test/widget_test.dart b/fronted/aplicacionrutasturisticas/test/widget_test.dart index 86dbf6dca1f87c63816c0b4c5993933fa073e834..2e8c3d8864d0f3a646af5af2efeaab31496859a8 100644 --- a/fronted/aplicacionrutasturisticas/test/widget_test.dart +++ b/fronted/aplicacionrutasturisticas/test/widget_test.dart @@ -13,7 +13,7 @@ import 'package:aplicacionrutasturisticas/main.dart'; void main() { testWidgets('Counter increments smoke test', (WidgetTester tester) async { // Build our app and trigger a frame. - await tester.pumpWidget(const MyApp()); + await tester.pumpWidget(MyApp()); // Verify that our counter starts at 0. expect(find.text('0'), findsOneWidget); diff --git a/fronted/aplicacionrutasturisticas/windows/flutter/generated_plugin_registrant.cc b/fronted/aplicacionrutasturisticas/windows/flutter/generated_plugin_registrant.cc index 8b6d4680af388f28db8742ef7fb8246e2bb1fffb..6013891f132fb7c79fcf3c0bdcd8289e2c40edc8 100644 --- a/fronted/aplicacionrutasturisticas/windows/flutter/generated_plugin_registrant.cc +++ b/fronted/aplicacionrutasturisticas/windows/flutter/generated_plugin_registrant.cc @@ -6,6 +6,15 @@ #include "generated_plugin_registrant.h" +#include +#include +#include void RegisterPlugins(flutter::PluginRegistry* registry) { + FirebaseAuthPluginCApiRegisterWithRegistrar( + registry->GetRegistrarForPlugin("FirebaseAuthPluginCApi")); + FirebaseCorePluginCApiRegisterWithRegistrar( + registry->GetRegistrarForPlugin("FirebaseCorePluginCApi")); + FirebaseStoragePluginCApiRegisterWithRegistrar( + registry->GetRegistrarForPlugin("FirebaseStoragePluginCApi")); } diff --git a/fronted/aplicacionrutasturisticas/windows/flutter/generated_plugins.cmake b/fronted/aplicacionrutasturisticas/windows/flutter/generated_plugins.cmake index b93c4c30c16703f640bc38523e56204ade09399e..3976ac4622edbced96462a06e4bad72f24219704 100644 --- a/fronted/aplicacionrutasturisticas/windows/flutter/generated_plugins.cmake +++ b/fronted/aplicacionrutasturisticas/windows/flutter/generated_plugins.cmake @@ -3,6 +3,9 @@ # list(APPEND FLUTTER_PLUGIN_LIST + firebase_auth + firebase_core + firebase_storage ) list(APPEND FLUTTER_FFI_PLUGIN_LIST