diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index f748fea..53c4580 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,6 +1,13 @@ - + + + + + + + @@ -30,5 +37,8 @@ + + + diff --git a/assets/UserForum.png b/assets/UserForum.png new file mode 100644 index 0000000..d6f6635 Binary files /dev/null and b/assets/UserForum.png differ diff --git a/assets/userPost.png b/assets/userPost.png new file mode 100644 index 0000000..76b3e99 Binary files /dev/null and b/assets/userPost.png differ diff --git a/assets/userPost2.png b/assets/userPost2.png new file mode 100644 index 0000000..8f00dfe Binary files /dev/null and b/assets/userPost2.png differ diff --git a/lib/src/screens/EmConstrucao/EmConstrucaoScreen.dart b/lib/src/screens/EmConstrucao/EmConstrucaoScreen.dart deleted file mode 100644 index cff6c06..0000000 --- a/lib/src/screens/EmConstrucao/EmConstrucaoScreen.dart +++ /dev/null @@ -1,75 +0,0 @@ -import 'package:flutter/material.dart'; -import 'dart:ui'; - -import '../../app/theme/colors.dart'; - -class EmConstrucaoScreen extends StatefulWidget { - const EmConstrucaoScreen({super.key}); - - @override - State createState() => _EmConstrucaoScreenState(); -} - -class _EmConstrucaoScreenState extends State { - @override - Widget build(BuildContext context) { - return Scaffold( - // bottomNavigationBar: const AppBottomNavigationBar(), - backgroundColor: AppColors.white, - body: Center( - child: Stack( - children: [ - Positioned.fill( - child: BackdropFilter( - filter: ImageFilter.blur(sigmaX: 8, sigmaY: 8), - child: Container( - color: Colors.transparent, - ), - ), - ), - Card( - elevation: 4, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(16), - ), - child: const Padding( - padding: EdgeInsets.all(24), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - mainAxisSize: MainAxisSize.min, - children: [ - Icon( - Icons.construction, - size: 100, - color: AppColors.lightOrange, - ), - SizedBox(height: 16), - Text( - 'Em construção', - style: TextStyle( - fontFamily: 'Poppins', - fontSize: 34, - fontWeight: FontWeight.bold, - color: AppColors.purple, - ), - ), - SizedBox(height: 16), - Text( - 'Desculpe-nos pelo transtorno.\nEstamos trabalhando nesta Funcionalidade.', - textAlign: TextAlign.center, - style: TextStyle( - fontFamily: 'Poppins', - fontSize: 23, - color: Color.fromRGBO(62, 0, 71, 0.984), - ), - ), - ], - ), - ), - ), - ], - ), - ), - ); - } -} diff --git a/lib/src/screens/Forum/CreatePost.dart b/lib/src/screens/Forum/CreatePost.dart new file mode 100644 index 0000000..5f64a59 --- /dev/null +++ b/lib/src/screens/Forum/CreatePost.dart @@ -0,0 +1,123 @@ +import 'dart:io'; +import "package:flutter/cupertino.dart"; +import "package:flutter/material.dart"; +import '../../models/user.dart'; +import 'Post/ForumPost.dart'; +import 'package:juno/src/database/dao/user_dao.dart'; +import 'package:intl/intl.dart'; + +class CreatePost extends StatefulWidget { + final int userId; + + const CreatePost({Key? key, required this.userId}) : super(key: key); + + @override + _CreatePostState createState() => _CreatePostState(); +} + +class _CreatePostState extends State { + final TextEditingController titleController = TextEditingController(); + final TextEditingController contentController = TextEditingController(); + String authorName = ""; // Nome do autor + + @override + void initState() { + super.initState(); + // Buscar o nome do usuário no banco de dados ao iniciar a tela + getUserInfo(); + } + + // Função para buscar o nome do usuário no banco de dados + void getUserInfo() async { + try { + User user = await UserDAO.getUserById(widget.userId); + setState(() { + authorName = "${user.nome}"; // Altere conforme a estrutura do seu objeto User + }); + } catch (e) { + print("Erro ao buscar informações do usuário: $e"); + } + } + + // Função para criar uma nova postagem + void criarPostagem() { + if (titleController.text.isNotEmpty && contentController.text.isNotEmpty) { + // obter data e hora atual + DateTime agora = DateTime.now(); + String dataHoraAtual = DateFormat('dd/MM/yyyy - HH:mm').format(agora); + + ForumPost novaPostagem = ForumPost( + author: authorName, // Usar o nome do autor obtido do banco de dados + date: dataHoraAtual, + content: contentController.text, + ); + + // Adicione a nova postagem à lista de postagens (que deve ser acessível a partir da tela do fórum) + // forumPosts.add(novaPostagem); + + // Navegue de volta para a tela do fórum + Navigator.pop(context, novaPostagem); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('Criar Postagem'), + backgroundColor: Color(0xFF3A0751), + ), + body: SingleChildScrollView( + child: Container( + color: Color(0xFFFFFFFF), + padding: EdgeInsets.all(16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + CircleAvatar( + radius: 80, + backgroundImage: AssetImage('assets/UserForum.png'), + ), + SizedBox(height: 16), + Text( + "Autor: $authorName", // Exibir o nome do autor + style: TextStyle( + fontSize: 18, + fontWeight: FontWeight.bold, + color: Color(0xFF3A0751), + ), + ), + SizedBox(height: 16), + TextFormField( + controller: titleController, + decoration: InputDecoration( + labelText: 'Título', + labelStyle: TextStyle( + color: Color(0xFF3A0751), + ), + ), + ), + TextFormField( + controller: contentController, + decoration: InputDecoration( + labelText: 'Conteúdo', + labelStyle: TextStyle( + color: Color(0xFF3A0751), + ), + ), + ), + SizedBox(height: 16), + ElevatedButton( + onPressed: criarPostagem, + child: Text('Criar Postagem'), + style: ElevatedButton.styleFrom( + primary: Color(0xFF3A0751), + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/src/screens/Forum/Forum.dart b/lib/src/screens/Forum/Forum.dart new file mode 100644 index 0000000..4685270 --- /dev/null +++ b/lib/src/screens/Forum/Forum.dart @@ -0,0 +1,120 @@ +import 'package:flutter/material.dart'; +import 'CreatePost.dart'; +import 'ProfileScreens/ProfileForum.dart'; +import 'PostCardForum.dart'; +import 'Post/ForumPost.dart'; + + +class ForumScreen extends StatefulWidget { + const ForumScreen({Key? key}) : super(key: key); + + @override + _ForumScreenState createState() => _ForumScreenState(); +} + +class _ForumScreenState extends State { + String searchKeyword = ''; + List forumPosts = []; // Corrija o tipo da lista para ForumPost + + void removePost(ForumPost post) async { + await ForumPost.deletePost(post); + _loadPosts(); + } + + @override + void initState() { + super.initState(); + _loadPosts(); + } + + void _loadPosts() async { + List posts = await ForumPost.getPosts(); // Corrija o tipo da lista para ForumPost + setState(() { + forumPosts = posts; + }); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('Fórum - Juno'), + backgroundColor: Colors.red, + centerTitle: true, + ), + body: Container( + color: Color(0xFFFFFFFF), + child: Column( + children: [ + Padding( + padding: EdgeInsets.all(16), + child: Row( + children: [ + Expanded( + child: TextField( + decoration: InputDecoration( + hintText: 'Pesquisar', + prefixIcon: Icon(Icons.search), + ), + onChanged: (value) { + setState(() { + searchKeyword = value; + }); + }, + ), + ), + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => ProfileForum(), + ), + ); + }, + child: CircleAvatar( + radius: 25, + backgroundImage: AssetImage('assets/UserForum.png'), + ), + ), + ], + ), + ), + Expanded( + child: ListView.builder( + itemCount: forumPosts.length, + itemBuilder: (context, index) { + return PostCardForum( + post: forumPosts[index], + onDelete: () { + removePost(forumPosts[index]); + }, + ); + }, + ), + ), + ], + ), + ), + floatingActionButton: FloatingActionButton( + onPressed: () async { + // Navegue para a tela CreatePost e aguarde o resultado + final novaPostagem = await Navigator.push( + context, + MaterialPageRoute( + builder: (context) => CreatePost(userId: 1,), + ), + ); + + // Se houver uma nova postagem, adicione-a ao banco de dados e recarregue as postagens + if (novaPostagem != null) { + await ForumPost.insertPost(novaPostagem); // Corrija para ForumPost + _loadPosts(); + } + }, + child: Icon(Icons.add), + backgroundColor: Color(0xFF3A0751), + ), + ); + } +} \ No newline at end of file diff --git a/lib/src/screens/Forum/Post/ForumPost.dart b/lib/src/screens/Forum/Post/ForumPost.dart new file mode 100644 index 0000000..dc3eab7 --- /dev/null +++ b/lib/src/screens/Forum/Post/ForumPost.dart @@ -0,0 +1,85 @@ +import 'package:flutter/material.dart'; +import 'package:sqflite/sqflite.dart'; +import 'package:path/path.dart'; +import 'package:path_provider/path_provider.dart'; + +class ForumPost { + int? id; + final String author; + final String date; + final String content; + + ForumPost({ + this.id, + required this.author, + required this.date, + required this.content, + }); + + ForumPost.fromMap(Map map) + : id = map['id'], + author = map['author'], + date = map['date'], + content = map['content']; + + Map toMap() { + return { + 'id': id, + 'author': author, + 'date': date, + 'content': content, + }; + } + + static const String dbName = 'forum.db'; + static const String tableName = 'posts'; + + static Future insertPost(ForumPost post) async { + final Database db = await _initDatabase(); + await db.insert(tableName, post.toMap()); + + // Adicione a instrução de impressão + print('Inserido no banco de dados: ${post.toMap()}'); + } + + static Future> getPosts() async { + final Database db = await _initDatabase(); + final List> maps = await db.query(tableName); + + // Adicione a instrução de impressão + print('Recuperado do banco de dados: $maps'); + + return List.generate(maps.length, (index) { + return ForumPost( + id: maps[index]['id'], + author: maps[index]['author'], + date: maps[index]['date'], + content: maps[index]['content'], + ); + }); + } + + static Future deletePost(ForumPost post) async { + final db = await _initDatabase(); + await db.delete(tableName, where: 'id = ?', whereArgs: [post.id]); + } + + static Future _initDatabase() async { + final String path = join(await getDatabasesPath(), dbName); + + return await openDatabase( + path, + version: 1, + onCreate: (Database db, int version) async { + await db.execute(''' + CREATE TABLE $tableName( + id INTEGER PRIMARY KEY AUTOINCREMENT, + author TEXT, + date TEXT, + content TEXT + ) + '''); + }, + ); + } +} \ No newline at end of file diff --git a/lib/src/screens/Forum/PostCardForum.dart b/lib/src/screens/Forum/PostCardForum.dart new file mode 100644 index 0000000..0ce11a6 --- /dev/null +++ b/lib/src/screens/Forum/PostCardForum.dart @@ -0,0 +1,141 @@ +import 'package:flutter/material.dart'; + +import 'Post/ForumPost.dart'; + + +class PostCardForum extends StatefulWidget { + final ForumPost post; + final Function() onDelete; + + PostCardForum({required this.post, required this.onDelete}); + + @override + _PostCardForumState createState() => _PostCardForumState(); +} + +class _PostCardForumState extends State { + bool liked = false; + bool disliked = false; + + void showRemovePostDialog() { + showDialog( + context: context, + builder: (BuildContext context) { + return AlertDialog( + title: Text('Remover Post da Timeline'), + content: Text('Tem certeza que deseja remover esta postagem?'), + actions: [ + TextButton( + onPressed: () { + Navigator.of(context).pop(); // Fecha o diálogo + }, + child: Text('Cancelar'), + ), + TextButton( + onPressed: () { + widget.onDelete(); // Chama a função onDelete passada como parâmetro + Navigator.of(context).pop(); // Fecha o diálogo + }, + child: Text('Remover'), + ), + ], + ); + }, + ); + } + + @override + Widget build(BuildContext context) { + return Container( + margin: EdgeInsets.all(16), + decoration: BoxDecoration( + color: Color(0xFFFFEDED), + borderRadius: BorderRadius.circular(12), + ), + child: Column( + children: [ + Row( + children: [ + CircleAvatar( + radius: 20, + backgroundImage: AssetImage('assets/UserForum.png'), + ), + SizedBox(width: 8), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + widget.post.author, + style: TextStyle( + color: Color(0xFF3A0751), + ), + ), + Text( + widget.post.date, + style: TextStyle( + color: Color(0xFF3A0751), + ), + ), + ], + ), + Spacer(), + IconButton( + icon: Icon(Icons.close), + onPressed: showRemovePostDialog, + ), + ], + ), + Padding( + padding: EdgeInsets.all(16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + widget.post.content, + style: TextStyle( + color: Color(0xFF3A0751), + fontWeight: FontWeight.bold, + ), + ), + ], + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + IconButton( + icon: liked ? Icon(Icons.thumb_up) : Icon(Icons.thumb_up_alt_outlined), + onPressed: () { + setState(() { + liked = !liked; + if (liked) { + disliked = false; // Desativa a opção de descurtir + } + }); + }, + color: liked ? Colors.blue : Colors.red, + alignment: Alignment.centerLeft, + ), + Text(liked ? 'Descurtir' : 'Curtir'), + SizedBox(width: 16), + IconButton( + icon: disliked ? Icon(Icons.thumb_down) : Icon(Icons.thumb_down_alt_outlined), + onPressed: () { + setState(() { + disliked = !disliked; + if (disliked) { + liked = false; // Desativa a opção de curtir + } + }); + }, + color: disliked ? Colors.blue : Colors.red, + alignment: Alignment.centerLeft, + ), + Text(disliked ? '' : ''), + ], + ), + ], + ), + ); + } +} diff --git a/lib/src/screens/Forum/ProfileScreens/EditProfile.dart b/lib/src/screens/Forum/ProfileScreens/EditProfile.dart new file mode 100644 index 0000000..7b6db53 --- /dev/null +++ b/lib/src/screens/Forum/ProfileScreens/EditProfile.dart @@ -0,0 +1,181 @@ +import 'package:flutter/material.dart'; + +class EditProfile extends StatefulWidget { + final String nome; + final String email; + final String cep; + final String rua; + final String numero; + final String bairro; + final String cidade; + final String complemento; + + EditProfile({ + Key? key, + required this.nome, + required this.email, + required this.cep, + required this.rua, + required this.numero, + required this.bairro, + required this.cidade, + required this.complemento, + }) : super(key: key); + + @override + State createState() => _EditProfileState(); +} + +class _EditProfileState extends State { + final nomeController = TextEditingController(); + final emailController = TextEditingController(); + final cepController = TextEditingController(); + final ruaController = TextEditingController(); + final numeroController = TextEditingController(); + final bairroController = TextEditingController(); + final cidadeController = TextEditingController(); + final complementoController = TextEditingController(); + + @override + void initState() { + super.initState(); + nomeController.text = widget.nome; + emailController.text = widget.email; + cepController.text = widget.cep; + ruaController.text = widget.rua; + numeroController.text = widget.numero; + bairroController.text = widget.bairro; + cidadeController.text = widget.cidade; + complementoController.text = widget.complemento; + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('Editar Perfil'), + backgroundColor: Colors.red, + centerTitle: true, + ), + body: SingleChildScrollView( + child: Container( + color: Color(0xFFFFFFFF), + padding: EdgeInsets.all(16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + CircleAvatar( + radius: 80, + backgroundImage: AssetImage('assets/UserForum.png'), + ), + SizedBox(height: 16), + TextFormField( + controller: nomeController, + decoration: InputDecoration( + labelText: 'Nome do Usuário', + labelStyle: TextStyle( + color: Color(0xFF3A0751), + ), + ), + ), + TextFormField( + controller: emailController, + decoration: InputDecoration( + labelText: 'E-mail', + labelStyle: TextStyle( + color: Color(0xFF3A0751), + ), + ), + ), + TextFormField( + controller: cepController, + decoration: InputDecoration( + labelText: 'CEP', + labelStyle: TextStyle( + color: Color(0xFF3A0751), + ), + ), + ), + TextFormField( + controller: ruaController, + decoration: InputDecoration( + labelText: 'Rua', + labelStyle: TextStyle( + color: Color(0xFF3A0751), + ), + ), + ), + TextFormField( + controller: numeroController, + decoration: InputDecoration( + labelText: 'Número', + labelStyle: TextStyle( + color: Color(0xFF3A0751), + ), + ), + ), + TextFormField( + controller: bairroController, + decoration: InputDecoration( + labelText: 'Bairro', + labelStyle: TextStyle( + color: Color(0xFF3A0751), + ), + ), + ), + TextFormField( + controller: cidadeController, + decoration: InputDecoration( + labelText: 'Cidade', + labelStyle: TextStyle( + color: Color(0xFF3A0751), + ), + ), + ), + TextFormField( + controller: complementoController, + decoration: InputDecoration( + labelText: 'Complemento', + labelStyle: TextStyle( + color: Color(0xFF3A0751), + ), + ), + ), + SizedBox(height: 16), + ElevatedButton( + onPressed: () { + final novoNome = nomeController.text; + final novoEmail = emailController.text; + final novoCep = cepController.text; + final novaRua = ruaController.text; + final novoNumero = numeroController.text; + final novoBairro = bairroController.text; + final novaCidade = cidadeController.text; + final novoComplemento = complementoController.text; + + final novoPerfil = { + 'nome': novoNome, + 'email': novoEmail, + 'cep': novoCep, + 'rua': novaRua, + 'numero': novoNumero, + 'bairro': novoBairro, + 'cidade': novaCidade, + 'complemento': novoComplemento, + }; + + // Retorne as informações atualizadas para a tela anterior + Navigator.pop(context, novoPerfil); + }, + child: Text('Salvar Alterações'), + style: ElevatedButton.styleFrom( + primary: Color(0xFF3A0751), + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/src/screens/Forum/ProfileScreens/ProfileForum.dart b/lib/src/screens/Forum/ProfileScreens/ProfileForum.dart new file mode 100644 index 0000000..d2d2ede --- /dev/null +++ b/lib/src/screens/Forum/ProfileScreens/ProfileForum.dart @@ -0,0 +1,120 @@ +import 'package:flutter/material.dart'; +import 'package:juno/src/database/dao/user_dao.dart'; +import 'EditProfile.dart'; + +class ProfileForum extends StatefulWidget { + const ProfileForum({Key? key}) : super(key: key); + + @override + State createState() => _ProfileForumState(); +} + +class _ProfileForumState extends State { + late Map userProfile; + + @override + void initState() { + super.initState(); + _loadUserProfile(); + } + + Future _loadUserProfile() async { + final userDAO = UserDAO(); + final userId = 1; // Substitua pelo ID do usuário que você deseja carregar + final user = await UserDAO.getUserById(userId); + + setState(() { + userProfile = { + 'nome': user.nome, + 'email': user.email, + 'cep': '', // Adicione os outros campos aqui conforme necessário + 'rua': '', + 'numero': '', + 'bairro': '', + 'cidade': '', + 'complemento': '', + }; + }); + } + + @override + Widget build(BuildContext context) { + if (userProfile.isEmpty) { + // Adicione aqui qualquer indicador de carregamento, se necessário + return Scaffold(body: Center(child: CircularProgressIndicator())); + } + + return Scaffold( + appBar: AppBar( + title: Text('Perfil de Usuário'), + backgroundColor: Colors.red, + centerTitle: true, + ), + body: Container( + color: Color(0xFFFFEDED), + alignment: Alignment.topCenter, + padding: EdgeInsets.all(50), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + CircleAvatar( + radius: 75, + backgroundImage: AssetImage('assets/UserForum.png'), + ), + SizedBox(height: 16), + Text( + '${userProfile['nome'] ?? 'Nome não definido'}', + style: TextStyle( + fontSize: 20, + color: Color(0xFF3A0751), + ), + ), + Wrap( + spacing: 100, + runSpacing: 8, + children: [ + Text( + 'Email: ${userProfile['email'] ?? 'E-mail não definido'}', + style: TextStyle( + fontSize: 16, + color: Color(0xFF3A0751), + ), + ), + // Adicione os outros campos aqui conforme necessário + ], + ), + ElevatedButton( + onPressed: () async { + final novoPerfil = await Navigator.push( + context, + MaterialPageRoute( + builder: (context) => EditProfile( + nome: userProfile['nome'] ?? '', + email: userProfile['email'] ?? '', + cep: userProfile['cep'] ?? '', + rua: userProfile['rua'] ?? '', + numero: userProfile['numero'] ?? '', + bairro: userProfile['bairro'] ?? '', + cidade: userProfile['cidade'] ?? '', + complemento: userProfile['complemento'] ?? '', + ), + ), + ); + + if (novoPerfil != null) { + setState(() { + userProfile = novoPerfil; + }); + } + }, + style: ElevatedButton.styleFrom( + primary: Color(0xFF3A0751), + ), + child: Text('Editar Perfil'), + ), + ], + ), + ), + ); + } +} diff --git a/lib/src/screens/Mapa/Mapa.dart b/lib/src/screens/Mapa/Mapa.dart new file mode 100644 index 0000000..ccc3abf --- /dev/null +++ b/lib/src/screens/Mapa/Mapa.dart @@ -0,0 +1,235 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_map/flutter_map.dart'; +import 'package:latlong2/latlong.dart'; +import 'package:geocoding/geocoding.dart'; + +class MapaScreen extends StatefulWidget { + const MapaScreen({Key? key}) : super(key: key); + + @override + _MapaScreenState createState() => _MapaScreenState(); +} + +class _MapaScreenState extends State { + late MapController mapController; + TextEditingController _searchController1 = TextEditingController(); + TextEditingController _searchController2 = TextEditingController(); + List polylineCoordinates = []; + + @override + void initState() { + super.initState(); + mapController = MapController(); + } + + void _centerMap() { + mapController.move(LatLng(-8.0476, -34.8770), 13.0); + } + + void _showMapWithLine(LatLng destinationLatLng) { + // Calcula a rota entre a localização atual e o destino pesquisado + LatLng startLatLng = polylineCoordinates.isNotEmpty + ? polylineCoordinates.first + : LatLng(-8.0476, -34.8770); + + // Adiciona a linha entre a localização atual e o destino pesquisado + polylineCoordinates = [ + startLatLng, + destinationLatLng, + ]; + + setState(() {}); // Redesenha o mapa com a nova linha + } + + void _searchAndShowOnMap(String query, TextEditingController controller) async { + List locations = await locationFromAddress(query); + + if (locations.isNotEmpty) { + LatLng destinationLatLng = + LatLng(locations.first.latitude, locations.first.longitude); + + // Atualiza a linha e o marcador no mapa + _showMapWithLine(destinationLatLng); + + // Atualiza o marcador de saída no mapa + if (controller == _searchController1) { + _updateStartMarker(destinationLatLng, Colors.red); + } + + // Atualiza o marcador no final da linha + if (controller == _searchController2) { + _updateDestinationMarker(destinationLatLng, Colors.blue); + } + + // Atualiza a localização inicial para a nova posição + setState(() { + polylineCoordinates.clear(); + polylineCoordinates.add(destinationLatLng); + }); + } else { + print('Nenhum resultado encontrado'); + } + } + + void _updateStartMarker(LatLng startLatLng, Color color) { + setState(() { + _destinationMarkers.removeWhere((marker) => marker.point == polylineCoordinates.first); + _destinationMarkers.add( + Marker( + width: 80.0, + height: 80.0, + point: startLatLng, + builder: (ctx) => Container( + child: Icon( + Icons.location_on, + color: color, + size: 50.0, + ), + ), + ), + ); + }); + } + + void _updateDestinationMarker(LatLng destinationLatLng, Color color) { + // Atualiza o marcador no final da linha + setState(() { + polylineCoordinates.isNotEmpty + ? polylineCoordinates.last + : LatLng(-8.0420, -34.8730); + _destinationMarkers.add( + Marker( + width: 80.0, + height: 80.0, + point: polylineCoordinates.isNotEmpty + ? polylineCoordinates.last + : LatLng(-8.0420, -34.8730), + builder: (ctx) => Container( + child: Icon( + Icons.location_on, + color: color, + size: 50.0, + ), + ), + ), + ); + }); + } + + void _zoomIn() { + mapController.move(mapController.center, mapController.zoom + 1.0); + } + + void _zoomOut() { + mapController.move(mapController.center, mapController.zoom - 1.0); + } + + List _destinationMarkers = []; + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('Mapa'), + backgroundColor: Colors.red, + centerTitle: true, + ), + body: Column( + children: [ + TextField( + controller: _searchController1, + decoration: InputDecoration( + hintText: 'Endereço de Saída', + contentPadding: EdgeInsets.all(16), + suffixIcon: IconButton( + onPressed: () { + String query = _searchController1.text; + _searchAndShowOnMap(query, _searchController1); + }, + icon: Icon(Icons.search), + ), + ), + ), + TextField( + controller: _searchController2, + decoration: InputDecoration( + hintText: 'Endereço de Destino', + contentPadding: EdgeInsets.all(16), + suffixIcon: IconButton( + onPressed: () { + String query = _searchController2.text; + _searchAndShowOnMap(query, _searchController2); + }, + icon: Icon(Icons.search), + ), + ), + ), + Expanded( + child: FlutterMap( + mapController: mapController, + options: MapOptions( + center: polylineCoordinates.isNotEmpty + ? polylineCoordinates.first + : LatLng(-8.0476, -34.8770), + zoom: 13.0, + ), + layers: [ + TileLayerOptions( + urlTemplate: + 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', + subdomains: ['a', 'b', 'c'], + ), + MarkerLayerOptions( + markers: [ + ..._destinationMarkers, + ], + ), + PolylineLayerOptions( + polylines: [ + Polyline( + points: polylineCoordinates, + color: Colors.blue, + strokeWidth: 4.0, + ), + ], + ), + ], + ), + ), + ], + ), + floatingActionButton: Column( + mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + FloatingActionButton( + onPressed: _centerMap, + backgroundColor: Color(0xFF3A0751), + child: Icon( + Icons.gps_fixed, + color: Colors.white, + ), + ), + SizedBox(height: 16), + FloatingActionButton( + onPressed: _zoomIn, + backgroundColor: Color(0xFF3A0751), + child: Icon( + Icons.zoom_in, + color: Colors.white, + ), + ), + SizedBox(height: 16), + FloatingActionButton( + onPressed: _zoomOut, + backgroundColor: Color(0xFF3A0751), + child: Icon( + Icons.zoom_out, + color: Colors.white, + ), + ), + ], + ), + ); + } +} diff --git a/lib/src/screens/login/login.dart b/lib/src/screens/login/login.dart index 843d77f..d1e271e 100644 --- a/lib/src/screens/login/login.dart +++ b/lib/src/screens/login/login.dart @@ -3,11 +3,10 @@ import 'package:flutter/material.dart'; import 'package:juno/src/app/theme/colors.dart'; import 'package:juno/src/screens/navigation/ui/navigation_screen.dart'; import 'package:shared_preferences/shared_preferences.dart'; - import '../../database/dao/user_dao.dart'; class Login extends StatefulWidget { - const Login({super.key}); + const Login({Key? key}); @override State createState() => _LoginState(); @@ -15,9 +14,7 @@ class Login extends StatefulWidget { class _LoginState extends State { final TextEditingController _usernameController = TextEditingController(); - final TextEditingController _passwordController = TextEditingController(); - late bool _obscurePassword = true; void saveUserData(int userId) async { @@ -29,134 +26,125 @@ class _LoginState extends State { @override Widget build(BuildContext context) { return Scaffold( - body: Center( - child: Column( - children: [ - const Padding( - padding: EdgeInsets.only(top: 150.0, bottom: 50.0), - child: Column( - children: [ - Text( - 'Login', - style: TextStyle( - fontSize: 40.0, - fontWeight: FontWeight.bold, - color: AppColors.red, - ), - ), - Text( - 'Acesse sua conta', - style: TextStyle( - fontSize: 16.0, - fontWeight: FontWeight.bold, - color: AppColors.purple, - ), - ), - ], - ), - ), - Padding( - padding: const EdgeInsets.only(left: 20.0, right: 20.0), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - TextFormField( - inputFormatters: [TextInputMask(mask: '999.999.999-99')], - controller: _usernameController, - decoration: const InputDecoration( - labelText: 'CPF', - hintText: '000.000.000-00', - ), - ), - const SizedBox(height: 20.0), - TextFormField( - controller: _passwordController, - obscureText: _obscurePassword, // Define se a senha está oculta ou não - decoration: InputDecoration( - labelText: 'Senha', - hintText: '*********', - suffixIcon: IconButton( - icon: Icon( - _obscurePassword ? Icons.visibility_off : Icons.visibility, + body: SingleChildScrollView( + child: Center( + child: Padding( + padding: const EdgeInsets.all(20.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const Padding( + padding: EdgeInsets.only(bottom: 50.0), + child: Column( + children: [ + Text( + 'Login', + style: TextStyle( + fontSize: 40.0, + fontWeight: FontWeight.bold, + color: AppColors.red, ), - onPressed: () { - setState(() { - _obscurePassword = !_obscurePassword; - }); - }, ), - ), - ), - Align( - alignment: Alignment.centerRight, - child: TextButton( - onPressed: () {}, - child: const Text( - 'Esqueceu a senha?', + Text( + 'Acesse sua conta', style: TextStyle( - color: Colors.grey, // Cor predefinida do Flutter + fontSize: 16.0, + fontWeight: FontWeight.bold, + color: AppColors.purple, ), ), - ), - ) - ], - ), - ), - Expanded( - child: Align( - alignment: Alignment.bottomCenter, - child: Padding( - padding: const EdgeInsets.only(bottom: 20.0), - child: TextButton( - style: TextButton.styleFrom( - backgroundColor: AppColors.red, // Define a cor de fundo como vermelho - elevation: 0, // Remove a sombra + ], + ), + ), + TextFormField( + inputFormatters: [TextInputMask(mask: '999.999.999-99')], + controller: _usernameController, + decoration: const InputDecoration( + labelText: 'CPF', + hintText: '000.000.000-00', + ), + ), + const SizedBox(height: 20.0), + TextFormField( + controller: _passwordController, + obscureText: _obscurePassword, + decoration: InputDecoration( + labelText: 'Senha', + hintText: '*********', + suffixIcon: IconButton( + icon: Icon( + _obscurePassword ? Icons.visibility_off : Icons.visibility, ), - onPressed: () async { - String enteredUsername = _usernameController.text; - String enteredPassword = _passwordController.text; - var userExists = await UserDAO.verifyCpfAndPasswordExists(enteredUsername, enteredPassword); - if (userExists == true) { - int? userId = await UserDAO.getUserIdByCPF(enteredUsername); - if (userId != null) { - saveUserData(userId); - } - Navigator.pushReplacement( - context, - MaterialPageRoute(builder: (context) => const NavigationScreen()), - ); - } else { - // Mostrar mensagem de erro informando que o nome de usuário ou senha estão incorretos - showDialog( - context: context, - builder: (BuildContext context) { - return AlertDialog( - title: const Text('Erro'), - content: const Text('Nome de usuário ou senha incorretos.'), - actions: [ - TextButton( - child: const Text('OK'), - onPressed: () { - Navigator.of(context).pop(); - }, - ), - ], - ); - }, - ); - } + onPressed: () { + setState(() { + _obscurePassword = !_obscurePassword; + }); }, - child: const Padding( - padding: EdgeInsets.only(top: 8, bottom: 8, left: 35, right: 35), - child: Text( - 'Entrar', - style: TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.bold), // Define a cor do texto como branco - ), + ), + ), + ), + Align( + alignment: Alignment.centerRight, + child: TextButton( + onPressed: () {}, + child: const Text( + 'Esqueceu a senha?', + style: TextStyle( + color: Colors.grey, ), ), - )), + ), + ), + const SizedBox(height: 20.0), + ElevatedButton( + onPressed: () async { + String enteredUsername = _usernameController.text; + String enteredPassword = _passwordController.text; + var userExists = await UserDAO.verifyCpfAndPasswordExists(enteredUsername, enteredPassword); + if (userExists == true) { + int? userId = await UserDAO.getUserIdByCPF(enteredUsername); + if (userId != null) { + saveUserData(userId); + } + Navigator.pushReplacement( + context, + MaterialPageRoute(builder: (context) => const NavigationScreen()), + ); + } else { + showDialog( + context: context, + builder: (BuildContext context) { + return AlertDialog( + title: const Text('Erro'), + content: const Text('Nome de usuário ou senha incorretos.'), + actions: [ + TextButton( + child: const Text('OK'), + onPressed: () { + Navigator.of(context).pop(); + }, + ), + ], + ); + }, + ); + } + }, + child: const Padding( + padding: EdgeInsets.symmetric(vertical: 12, horizontal: 35), + child: Text( + 'Entrar', + style: TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.bold), + ), + + ), + style: ElevatedButton.styleFrom( + primary: AppColors.red, + ), + ), + ], ), - ], + ), ), ), ); diff --git a/lib/src/screens/navigation/ui/navigation_screen.dart b/lib/src/screens/navigation/ui/navigation_screen.dart index 715fcb4..58cb24d 100644 --- a/lib/src/screens/navigation/ui/navigation_screen.dart +++ b/lib/src/screens/navigation/ui/navigation_screen.dart @@ -1,10 +1,11 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:juno/src/screens/EmConstrucao/EmConstrucaoScreen.dart'; +import 'package:juno/src/screens/Forum/Forum.dart'; import 'package:juno/src/screens/rides_and_companies/ui/rides_and_companies_screen.dart'; import 'package:juno/src/utils/state_manager.dart'; import '../../../app/theme/colors.dart'; +import '../../Mapa/Mapa.dart'; import '../controllers/navigation_controller.dart'; import '../models/screen_model.dart'; @@ -27,13 +28,13 @@ class _NavigationScreenState extends State { icon: Icons.group_outlined, ), ScreenModel( - screen: const EmConstrucaoScreen(), + screen: const ForumScreen(), label: 'Fórum', activeIcon: Icons.forum, icon: Icons.forum_outlined, ), ScreenModel( - screen: const EmConstrucaoScreen(), + screen: const MapaScreen(), label: 'Mapa', activeIcon: Icons.location_on, icon: Icons.location_on_outlined, diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc index e71a16d..64a0ece 100644 --- a/linux/flutter/generated_plugin_registrant.cc +++ b/linux/flutter/generated_plugin_registrant.cc @@ -6,6 +6,10 @@ #include "generated_plugin_registrant.h" +#include void fl_register_plugins(FlPluginRegistry* registry) { + g_autoptr(FlPluginRegistrar) file_selector_linux_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin"); + file_selector_plugin_register_with_registrar(file_selector_linux_registrar); } diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake index 2e1de87..2db3c22 100644 --- a/linux/flutter/generated_plugins.cmake +++ b/linux/flutter/generated_plugins.cmake @@ -3,6 +3,7 @@ # list(APPEND FLUTTER_PLUGIN_LIST + file_selector_linux ) list(APPEND FLUTTER_FFI_PLUGIN_LIST diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index eefcc6d..5c427a5 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,11 +5,13 @@ import FlutterMacOS import Foundation +import file_selector_macos import path_provider_foundation import shared_preferences_foundation import sqflite func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) diff --git a/pubspec.lock b/pubspec.lock index d398d2b..2e96286 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -41,6 +41,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.17.1" + cross_file: + dependency: transitive + description: + name: cross_file + sha256: "445db18de832dba8d851e287aff8ccf169bed30d2e94243cb54c7d2f1ed2142c" + url: "https://pub.dev" + source: hosted + version: "0.3.3+6" crypto: dependency: transitive description: @@ -53,10 +61,10 @@ packages: dependency: "direct main" description: name: cupertino_icons - sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be + sha256: d57953e10f9f8327ce64a508a355f0b1ec902193f66288e8cb5070e7c47eeb2d url: "https://pub.dev" source: hosted - version: "1.0.5" + version: "1.0.6" easy_mask: dependency: "direct main" description: @@ -77,18 +85,50 @@ packages: dependency: transitive description: name: ffi - sha256: ed5337a5660c506388a9f012be0288fb38b49020ce2b45fe1f8b8323fe429f99 + sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878" url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "2.1.0" file: dependency: transitive description: name: file - sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + url: "https://pub.dev" + source: hosted + version: "7.0.0" + file_selector_linux: + dependency: transitive + description: + name: file_selector_linux + sha256: "045d372bf19b02aeb69cacf8b4009555fb5f6f0b7ad8016e5f46dd1387ddd492" + url: "https://pub.dev" + source: hosted + version: "0.9.2+1" + file_selector_macos: + dependency: transitive + description: + name: file_selector_macos + sha256: b15c3da8bd4908b9918111fa486903f5808e388b8d1c559949f584725a6594d6 + url: "https://pub.dev" + source: hosted + version: "0.9.3+3" + file_selector_platform_interface: + dependency: transitive + description: + name: file_selector_platform_interface + sha256: "0aa47a725c346825a2bd396343ce63ac00bda6eff2fbc43eabe99737dede8262" + url: "https://pub.dev" + source: hosted + version: "2.6.1" + file_selector_windows: + dependency: transitive + description: + name: file_selector_windows + sha256: d3547240c20cabf205c7c7f01a50ecdbc413755814d6677f3cb366f04abcead0 url: "https://pub.dev" source: hosted - version: "6.1.4" + version: "0.9.3+1" flutter: dependency: "direct main" description: flutter @@ -98,10 +138,34 @@ packages: dependency: "direct dev" description: name: flutter_lints - sha256: "2118df84ef0c3ca93f96123a616ae8540879991b8b57af2f81b76a7ada49b2a4" + sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04 url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "2.0.3" + flutter_map: + dependency: "direct main" + description: + name: flutter_map + sha256: "9401bcc83b1118ddd35c0b25efaa5af182572707f1887bbb7817c2337fcd8c97" + url: "https://pub.dev" + source: hosted + version: "0.13.1" + flutter_plugin_android_lifecycle: + dependency: transitive + description: + name: flutter_plugin_android_lifecycle + sha256: b068ffc46f82a55844acfa4fdbb61fad72fa2aef0905548419d97f0f95c456da + url: "https://pub.dev" + source: hosted + version: "2.0.17" + flutter_polyline_points: + dependency: "direct main" + description: + name: flutter_polyline_points + sha256: "02699e69142f51a248d784b6e3eec524194467fca5f7c4da19699ce2368b6980" + url: "https://pub.dev" + source: hosted + version: "1.0.0" flutter_svg: dependency: "direct main" description: @@ -120,6 +184,38 @@ packages: description: flutter source: sdk version: "0.0.0" + geocoding: + dependency: "direct main" + description: + name: geocoding + sha256: e1dc0ac56666d9ed1d5a9ae5543ce9eb5986db6209cc7600103487d09192059c + url: "https://pub.dev" + source: hosted + version: "2.1.1" + geocoding_android: + dependency: transitive + description: + name: geocoding_android + sha256: "609db1d71bc364dd9d0616f72a41c01e0c74f3a3807efb85e0d5a67e57baf50f" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + geocoding_ios: + dependency: transitive + description: + name: geocoding_ios + sha256: "8f79e380abb640ef4d88baee8bb65390058c802601158d0813dc990b36b189d2" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + geocoding_platform_interface: + dependency: transitive + description: + name: geocoding_platform_interface + sha256: "8848605d307d844d89937cdb4b8ad7dfa880552078f310fa24d8a460f6dddab4" + url: "https://pub.dev" + source: hosted + version: "2.0.1" google_fonts: dependency: "direct main" description: @@ -144,6 +240,78 @@ packages: url: "https://pub.dev" source: hosted version: "4.0.2" + image_picker: + dependency: "direct main" + description: + name: image_picker + sha256: b6951e25b795d053a6ba03af5f710069c99349de9341af95155d52665cb4607c + url: "https://pub.dev" + source: hosted + version: "0.8.9" + image_picker_android: + dependency: transitive + description: + name: image_picker_android + sha256: d6a6e78821086b0b737009b09363018309bbc6de3fd88cc5c26bc2bb44a4957f + url: "https://pub.dev" + source: hosted + version: "0.8.8+2" + image_picker_for_web: + dependency: transitive + description: + name: image_picker_for_web + sha256: "869fe8a64771b7afbc99fc433a5f7be2fea4d1cb3d7c11a48b6b579eb9c797f0" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + image_picker_ios: + dependency: transitive + description: + name: image_picker_ios + sha256: "76ec722aeea419d03aa915c2c96bf5b47214b053899088c9abb4086ceecf97a7" + url: "https://pub.dev" + source: hosted + version: "0.8.8+4" + image_picker_linux: + dependency: transitive + description: + name: image_picker_linux + sha256: "4ed1d9bb36f7cd60aa6e6cd479779cc56a4cb4e4de8f49d487b1aaad831300fa" + url: "https://pub.dev" + source: hosted + version: "0.2.1+1" + image_picker_macos: + dependency: transitive + description: + name: image_picker_macos + sha256: "3f5ad1e8112a9a6111c46d0b57a7be2286a9a07fc6e1976fdf5be2bd31d4ff62" + url: "https://pub.dev" + source: hosted + version: "0.2.1+1" + image_picker_platform_interface: + dependency: transitive + description: + name: image_picker_platform_interface + sha256: ed9b00e63977c93b0d2d2b343685bed9c324534ba5abafbb3dfbd6a780b1b514 + url: "https://pub.dev" + source: hosted + version: "2.9.1" + image_picker_windows: + dependency: transitive + description: + name: image_picker_windows + sha256: "6ad07afc4eb1bc25f3a01084d28520496c4a3bb0cb13685435838167c9dcedeb" + url: "https://pub.dev" + source: hosted + version: "0.2.1+1" + intl: + dependency: "direct main" + description: + name: intl + sha256: "910f85bce16fb5c6f614e117efa303e85a1731bb0081edf3604a2ae6e9a3cc91" + url: "https://pub.dev" + source: hosted + version: "0.17.0" js: dependency: transitive description: @@ -152,6 +320,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.6.7" + latlong2: + dependency: "direct main" + description: + name: latlong2 + sha256: "08ef7282ba9f76e8495e49e2dc4d653015ac929dce5f92b375a415d30b407ea0" + url: "https://pub.dev" + source: hosted + version: "0.8.2" lints: dependency: transitive description: @@ -160,6 +336,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.1" + lists: + dependency: transitive + description: + name: lists + sha256: "4ca5c19ae4350de036a7e996cdd1ee39c93ac0a2b840f4915459b7d0a7d4ab27" + url: "https://pub.dev" + source: hosted + version: "1.0.1" matcher: dependency: transitive description: @@ -184,6 +368,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.9.1" + mgrs_dart: + dependency: transitive + description: + name: mgrs_dart + sha256: fb89ae62f05fa0bb90f70c31fc870bcbcfd516c843fb554452ab3396f78586f7 + url: "https://pub.dev" + source: hosted + version: "2.0.0" + mime: + dependency: transitive + description: + name: mime + sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e + url: "https://pub.dev" + source: hosted + version: "1.0.4" path: dependency: transitive description: @@ -209,53 +409,53 @@ packages: source: hosted version: "0.2.1" path_provider: - dependency: transitive + dependency: "direct main" description: name: path_provider - sha256: "3087813781ab814e4157b172f1a11c46be20179fcc9bea043e0fba36bc0acaa2" + sha256: a1aa8aaa2542a6bc57e381f132af822420216c80d4781f7aa085ca3229208aaa url: "https://pub.dev" source: hosted - version: "2.0.15" + version: "2.1.1" path_provider_android: dependency: transitive description: name: path_provider_android - sha256: "2cec049d282c7f13c594b4a73976b0b4f2d7a1838a6dd5aaf7bd9719196bee86" + sha256: e595b98692943b4881b219f0a9e3945118d3c16bd7e2813f98ec6e532d905f72 url: "https://pub.dev" source: hosted - version: "2.0.27" + version: "2.2.1" path_provider_foundation: dependency: transitive description: name: path_provider_foundation - sha256: "1995d88ec2948dac43edf8fe58eb434d35d22a2940ecee1a9fefcd62beee6eb3" + sha256: "19314d595120f82aca0ba62787d58dde2cc6b5df7d2f0daf72489e38d1b57f2d" url: "https://pub.dev" source: hosted - version: "2.2.3" + version: "2.3.1" path_provider_linux: dependency: transitive description: name: path_provider_linux - sha256: ffbb8cc9ed2c9ec0e4b7a541e56fd79b138e8f47d2fb86815f15358a349b3b57 + sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 url: "https://pub.dev" source: hosted - version: "2.1.11" + version: "2.2.1" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface - sha256: "57585299a729335f1298b43245842678cb9f43a6310351b18fb577d6e33165ec" + sha256: "94b1e0dd80970c1ce43d5d4e050a9918fce4f4a775e6142424c30a29a363265c" url: "https://pub.dev" source: hosted - version: "2.0.6" + version: "2.1.1" path_provider_windows: dependency: transitive description: name: path_provider_windows - sha256: "1cb68ba4cd3a795033de62ba1b7b4564dace301f952de6bfb3cd91b202b6ee96" + sha256: "8bc9f22eee8690981c22aa7fc602f5c85b497a6fb2ceb35ee5a5e5ed85ad8170" url: "https://pub.dev" source: hosted - version: "2.1.7" + version: "2.2.1" petitparser: dependency: transitive description: @@ -268,82 +468,90 @@ packages: dependency: transitive description: name: platform - sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" + sha256: "0a279f0707af40c890e80b1e9df8bb761694c074ba7e1d4ab1bc4b728e200b59" url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "3.1.3" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - sha256: "6a2128648c854906c53fa8e33986fc0247a1116122f9534dd20e3ab9e16a32bc" + sha256: da3fdfeccc4d4ff2da8f8c556704c08f912542c5fb3cf2233ed75372384a034d url: "https://pub.dev" source: hosted - version: "2.1.4" - process: + version: "2.1.6" + positioned_tap_detector_2: + dependency: transitive + description: + name: positioned_tap_detector_2 + sha256: "52e06863ad3e1f82b058fd05054fc8c9caeeb3b47d5cea7a24bd9320746059c1" + url: "https://pub.dev" + source: hosted + version: "1.0.4" + proj4dart: dependency: transitive description: - name: process - sha256: "53fd8db9cec1d37b0574e12f07520d582019cb6c44abf5479a01505099a34a09" + name: proj4dart + sha256: c8a659ac9b6864aa47c171e78d41bbe6f5e1d7bd790a5814249e6b68bc44324e url: "https://pub.dev" source: hosted - version: "4.2.4" + version: "2.1.0" shared_preferences: dependency: "direct main" description: name: shared_preferences - sha256: "0344316c947ffeb3a529eac929e1978fcd37c26be4e8468628bac399365a3ca1" + sha256: "81429e4481e1ccfb51ede496e916348668fd0921627779233bd24cc3ff6abd02" url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "2.2.2" shared_preferences_android: dependency: transitive description: name: shared_preferences_android - sha256: fe8401ec5b6dcd739a0fe9588802069e608c3fdbfd3c3c93e546cf2f90438076 + sha256: "8568a389334b6e83415b6aae55378e158fbc2314e074983362d20c562780fb06" url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "2.2.1" shared_preferences_foundation: dependency: transitive description: name: shared_preferences_foundation - sha256: b046999bf0ff58f04c364491bb803dcfa8f42e47b19c75478f53d323684a8cc1 + sha256: "7bf53a9f2d007329ee6f3df7268fd498f8373602f943c975598bbb34649b62a7" url: "https://pub.dev" source: hosted - version: "2.3.1" + version: "2.3.4" shared_preferences_linux: dependency: transitive description: name: shared_preferences_linux - sha256: "71d6806d1449b0a9d4e85e0c7a917771e672a3d5dc61149cc9fac871115018e1" + sha256: "9f2cbcf46d4270ea8be39fa156d86379077c8a5228d9dfdb1164ae0bb93f1faa" url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "2.3.2" shared_preferences_platform_interface: dependency: transitive description: name: shared_preferences_platform_interface - sha256: "23b052f17a25b90ff2b61aad4cc962154da76fb62848a9ce088efe30d7c50ab1" + sha256: d4ec5fc9ebb2f2e056c617112aa75dcf92fc2e4faaf2ae999caa297473f75d8a url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "2.3.1" shared_preferences_web: dependency: transitive description: name: shared_preferences_web - sha256: "7347b194fb0bbeb4058e6a4e87ee70350b6b2b90f8ac5f8bd5b3a01548f6d33a" + sha256: d762709c2bbe80626ecc819143013cc820fa49ca5e363620ee20a8b15a3e3daf url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "2.2.1" shared_preferences_windows: dependency: transitive description: name: shared_preferences_windows - sha256: f95e6a43162bce43c9c3405f3eb6f39e5b5d11f65fab19196cf8225e2777624d + sha256: "841ad54f3c8381c480d0c9b508b89a34036f512482c407e6df7a9c4aa2ef8f59" url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "2.3.2" sky_engine: dependency: transitive description: flutter @@ -361,34 +569,34 @@ packages: dependency: "direct main" description: name: sqflite - sha256: b4d6710e1200e96845747e37338ea8a819a12b51689a3bcf31eff0003b37a0b9 + sha256: "591f1602816e9c31377d5f008c2d9ef7b8aca8941c3f89cc5fd9d84da0c38a9a" url: "https://pub.dev" source: hosted - version: "2.2.8+4" + version: "2.3.0" sqflite_common: dependency: transitive description: name: sqflite_common - sha256: "8f7603f3f8f126740bc55c4ca2d1027aab4b74a1267a3e31ce51fe40e3b65b8f" + sha256: "8ed044102f3135add97be8653662052838859f5400075ef227f8ad72ae320803" url: "https://pub.dev" source: hosted - version: "2.4.5+1" + version: "2.5.0+1" sqflite_common_ffi: dependency: "direct main" description: name: sqflite_common_ffi - sha256: f86de82d37403af491b21920a696b19f01465b596f545d1acd4d29a0a72418ad + sha256: "198b40b4a7ba58cca18d7837d0246859b7b4c8b007d2902634fc26dec57fa3f1" url: "https://pub.dev" source: hosted - version: "2.2.5" + version: "2.3.0+3" sqlite3: dependency: transitive description: name: sqlite3 - sha256: f7511ddd6a2dda8ded9d849f8a925bb6020e0faa59db2443debc18d484e59401 + sha256: db65233e6b99e99b2548932f55a987961bc06d82a31a0665451fa0b4fff4c3fb url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "2.1.0" stack_trace: dependency: transitive description: @@ -437,6 +645,22 @@ packages: url: "https://pub.dev" source: hosted version: "0.5.1" + transparent_image: + dependency: transitive + description: + name: transparent_image + sha256: e8991d955a2094e197ca24c645efec2faf4285772a4746126ca12875e54ca02f + url: "https://pub.dev" + source: hosted + version: "2.0.1" + tuple: + dependency: transitive + description: + name: tuple + sha256: a97ce2013f240b2f3807bcbaf218765b6f301c3eff91092bcfa23a039e7dd151 + url: "https://pub.dev" + source: hosted + version: "2.0.2" typed_data: dependency: transitive description: @@ -445,6 +669,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.2" + unicode: + dependency: transitive + description: + name: unicode + sha256: "0f69e46593d65245774d4f17125c6084d2c20b4e473a983f6e21b7d7762218f1" + url: "https://pub.dev" + source: hosted + version: "0.3.1" vector_math: dependency: transitive description: @@ -457,18 +689,26 @@ packages: dependency: transitive description: name: win32 - sha256: dfdf0136e0aa7a1b474ea133e67cb0154a0acd2599c4f3ada3b49d38d38793ee + sha256: "350a11abd2d1d97e0cc7a28a81b781c08002aa2864d9e3f192ca0ffa18b06ed3" url: "https://pub.dev" source: hosted - version: "5.0.5" + version: "5.0.9" + wkt_parser: + dependency: transitive + description: + name: wkt_parser + sha256: "8a555fc60de3116c00aad67891bcab20f81a958e4219cc106e3c037aa3937f13" + url: "https://pub.dev" + source: hosted + version: "2.0.0" xdg_directories: dependency: transitive description: name: xdg_directories - sha256: ee1505df1426458f7f60aac270645098d318a8b4766d85fde75f76f2e21807d1 + sha256: "589ada45ba9e39405c198fe34eb0f607cddb2108527e658136120892beac46d2" url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.0.3" xml: dependency: transitive description: @@ -479,4 +719,4 @@ packages: version: "5.4.1" sdks: dart: ">=3.0.0 <4.0.0" - flutter: ">=3.3.0" + flutter: ">=3.7.0" diff --git a/pubspec.yaml b/pubspec.yaml index 15cbac7..a87354a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -35,9 +35,15 @@ dependencies: sqflite: ^2.0.0+4 sqflite_common_ffi: ^2.0.0+2 shared_preferences: ^2.0.8 + flutter_map: ^0.13.1 + latlong2: ^0.8.0 + geocoding: ^2.0.0 + flutter_polyline_points: ^1.0.0 + path_provider: ^2.0.2 + image_picker: ^0.8.4+2 + intl: ^0.17.0 - - # The following adds the Cupertino Icons font to your application. + # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.2 google_fonts: ^4.0.4 @@ -78,6 +84,9 @@ flutter: - assets/CaronasImagem.svg - assets/undraw_order_ride.png - assets/undraw_social.png + - assets/UserForum.png + - assets/userPost.png + - assets/userPost2.png # - images/a_dot_burr.jpeg # - images/a_dot_ham.jpeg diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 8b6d468..77ab7a0 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -6,6 +6,9 @@ #include "generated_plugin_registrant.h" +#include void RegisterPlugins(flutter::PluginRegistry* registry) { + FileSelectorWindowsRegisterWithRegistrar( + registry->GetRegistrarForPlugin("FileSelectorWindows")); } diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index b93c4c3..a423a02 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -3,6 +3,7 @@ # list(APPEND FLUTTER_PLUGIN_LIST + file_selector_windows ) list(APPEND FLUTTER_FFI_PLUGIN_LIST