Skip to content

Meu app novo#2391

Closed
Maicon967 wants to merge 13 commits into
flutter:mainfrom
Maicon967:codespace-potential-eureka-xjq6xv7q76qhvwpx
Closed

Meu app novo#2391
Maicon967 wants to merge 13 commits into
flutter:mainfrom
Maicon967:codespace-potential-eureka-xjq6xv7q76qhvwpx

Conversation

@Maicon967
Copy link
Copy Markdown

Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.

List which issues are fixed by this PR. For larger changes, raising an issue first helps
reduce redundant work.

Pre-launch Checklist

  • I read the Effective Dart: Style recently, and have followed its advice.
  • I signed the CLA.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-devrel channel on Discord.

@google-cla
Copy link
Copy Markdown

google-cla Bot commented May 28, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request bootstraps a new Flutter project named app_novo with platform-specific runner configurations, a GitHub Actions build workflow, and initial business logic for user authentication and clock-in processing. However, several critical compilation and test issues were identified in the Dart code. These include incorrect import schemes (using app_novo: instead of package:), incorrect relative paths for auth_repository.dart, a duplicate class definition of AuthRepository in auth_repository.dart, a missing views/login_view.dart file, and a widget test that incorrectly attempts to instantiate MyApp instead of the newly defined Gestor360App.

Comment on lines +1 to +3
import 'app_novo:flutter/material.dart';
import 'app_novo:geolocator/geolocator.dart';
import 'app_novo:device_info_plus/device_info_plus.dart';
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The import package name is incorrectly specified with the package prefix as the package scheme. It should be using the package: scheme instead of app_novo: to refer to external dependencies.

Suggested change
import 'app_novo:flutter/material.dart';
import 'app_novo:geolocator/geolocator.dart';
import 'app_novo:device_info_plus/device_info_plus.dart';
import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart';
import 'package:device_info_plus/device_info_plus.dart';

import 'app_novo:geolocator/geolocator.dart';
import 'app_novo:device_info_plus/device_info_plus.dart';
import 'dart:io';
import '../repositories/auth_repository.dart';
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The relative path to auth_repository.dart is incorrect. The repository is located in lib/data/auth_repository.dart, not lib/repositories/auth_repository.dart.

Suggested change
import '../repositories/auth_repository.dart';
import '../data/auth_repository.dart';

Comment on lines +2 to +4
import 'app_novo:flutter/material.dart';
import 'app_novo:device_info_plus/device_info_plus.dart';
import '../repositories/auth_repository.dart'; // Ajuste o caminho se necessário
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The import package names are incorrectly specified with the package prefix as the package scheme. It should be using the package: scheme instead of app_novo:. Also, the relative path to auth_repository.dart is incorrect because it is located in lib/data/auth_repository.dart.

Suggested change
import 'app_novo:flutter/material.dart';
import 'app_novo:device_info_plus/device_info_plus.dart';
import '../repositories/auth_repository.dart'; // Ajuste o caminho se necessário
import 'package:flutter/material.dart';
import 'package:device_info_plus/device_info_plus.dart';
import '../data/auth_repository.dart';

@@ -0,0 +1,179 @@
import 'app_novo:dio/dio.dart';
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The import package name is incorrectly specified with the package prefix as the package scheme. It should be using the package: scheme instead of app_novo:.

Suggested change
import 'app_novo:dio/dio.dart';
import 'package:dio/dio.dart';

Comment on lines +100 to +179
class AuthRepository {
final Dio _dio = Dio();

// 1. CONFIGURE SUA URL AQUI (Centralizado)
static const String _baseUrl = 'https://api.meusite.com/v1';

// 1. Endpoint de Login
Future<LoginResponse> tentarAutenticacao(String identificacao, String senha, String deviceId) async {
try {
// CHAMADA HTTP REAL: Substituindo a simulação pelo Dio
final response = await _dio.post(
'$_baseUrl/login', // Monta: https://api.meusite.com/v1/login
data: {
'identificacao': identificacao,
'senha': senha,
'device_id': deviceId,
},
);

if (response.statusCode == 200) {
final dados = response.data; // Resposta que veio do seu servidor

// Aqui você trata as regras que a IA simulou, mas usando os dados da sua API:
return LoginResponse(
sucesso: dados['sucesso'] ?? false,
dispositivoAutorizado: dados['dispositivo_autorizado'] ?? false,
deviceId: dados['device_id'],
dadosUsuario: dados['dados_usuario'],
);
}

return LoginResponse(sucesso: false, dispositivoAutorizado: false);
} catch (e) {
print("Erro no login: $e");
return LoginResponse(sucesso: false, dispositivoAutorizado: false);
}
}

// 2. Endpoint de Envio de Ponto (Multipart / Blob Binário)
Future<bool> registrarPontoComBlob({
required int idBanco,
required String matricula,
required String deviceId,
required double latitude,
required double longitude,
required String timestamp,
String? caminhoFotoLocal,
}) async {
try {
Map<String, dynamic> mapaFormulario = {
"id_banco": idBanco,
"matricula": matricula,
"device_id": deviceId,
"latitude": latitude,
"longitude": longitude,
"timestamp": timestamp,
};

if (caminhoFotoLocal != null) {
mapaFormulario["foto"] = await MultipartFile.fromFile(
caminhoFotoLocal,
filename: "ponto_${idBanco}_$timestamp.jpg",
);
}

FormData formData = FormData.fromMap(mapaFormulario);

// CHAMADA HTTP REAL ATIVADA AQUI:
final response = await _dio.post(
"$_baseUrl/bater-ponto", // Usa a nossa variável lá de cima
data: formData,
);

return response.statusCode == 200;
} catch (e) {
print("Erro ao transmitir ponto via Multipart: $e");
return false;
}
}
} No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The class AuthRepository is defined twice in this file. The second definition starting on line 100 duplicates the class name and will cause a compilation error. Please merge or remove the duplicate class definition.

Comment thread app_novo/lib/main.dart
@@ -0,0 +1,25 @@
import 'package:flutter/material.dart';
import 'views/login_view.dart';
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The file views/login_view.dart is imported but does not exist in the repository or in this pull request. This will cause a compilation error.

void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(const MyApp());
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The test is trying to instantiate MyApp, but the main application class defined in lib/main.dart is named Gestor360App. This will cause a compilation error in the tests.

Suggested change
await tester.pumpWidget(const MyApp());
await tester.pumpWidget(const Gestor360App());

@Maicon967 Maicon967 closed this by deleting the head repository May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant