Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leandro Forte - Flutter Coding Test #75

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
2c3fce1
create flutter project
Feb 6, 2024
f80178a
remove unnecessary comments
Feb 6, 2024
480508e
Merge pull request #1 from leandromichelforte/merge-main/project/flut…
leandromichelforte Feb 6, 2024
61742cc
add core folder; home, qr_code and scan: added tests on presenter lay…
Feb 7, 2024
084b9d2
creating get qr code usecase, repository, datasource and its tests
Feb 7, 2024
64dcd2e
finishing qr code page, cubit and its tests
Feb 8, 2024
3afb43c
deal with permission on scan page, refactor widgets and strings and f…
Feb 8, 2024
144f12c
Merge pull request #2 from leandromichelforte/feature/qr_code_scan
leandromichelforte Feb 8, 2024
b30cb90
Merge pull request #3 from leandromichelforte/develop
leandromichelforte Feb 8, 2024
1fd723c
add node js backend to return the seed
Feb 8, 2024
3bfaa4a
Merge pull request #4 from leandromichelforte/feature/backend
leandromichelforte Feb 8, 2024
6b8e84d
refactor inject, add dio, retrieve from node backend and fix tests
Feb 8, 2024
dcf2bb6
rename from expireAt to expiresAt
Feb 8, 2024
b01cff4
change key value from returned value from expireAt to expiresAt
Feb 8, 2024
1074306
add generic and api exception, throws news exceptions in qr code data…
Feb 8, 2024
a4a3429
Merge pull request #5 from leandromichelforte/feature/connect_flutter…
leandromichelforte Feb 8, 2024
999e1ab
Merge pull request #6 from leandromichelforte/develop
leandromichelforte Feb 8, 2024
e1a5dd0
remove time zone offset from expires_at and add 1 minute from now
Feb 8, 2024
28bf721
Merge pull request #7 from leandromichelforte/bugfix/expires_at
leandromichelforte Feb 8, 2024
23e1235
Merge pull request #8 from leandromichelforte/master
leandromichelforte Feb 8, 2024
7efc17c
add app documentation
Feb 8, 2024
300b593
Merge pull request #9 from leandromichelforte/project/documentation
leandromichelforte Feb 8, 2024
687078d
Merge pull request #10 from leandromichelforte/develop
leandromichelforte Feb 8, 2024
1ec2ecc
adjust tab in app doc md file
Feb 8, 2024
56204d1
Merge pull request #11 from leandromichelforte/project/documentation
leandromichelforte Feb 8, 2024
4b5ce96
Merge pull request #12 from leandromichelforte/develop
leandromichelforte Feb 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
finishing qr code page, cubit and its tests
  • Loading branch information
Leandro Forte committed Feb 8, 2024
commit 64dcd2ee8de34d3049eb66b217108fa588220b54
246 changes: 168 additions & 78 deletions coverage/lcov.info
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
SF:lib/features/qr_code_scan/presenter/cubits/timer/timer_state.dart
DA:4,7
DA:6,0
DA:7,0
DA:11,6
DA:15,2
DA:4,15
DA:6,1
DA:7,1
DA:11,12
DA:15,3
DA:22,1
DA:23,3
DA:27,6
DA:27,13
LF:8
LH:6
LH:8
end_of_record
SF:lib/features/qr_code_scan/presenter/cubits/timer/timer_cubit.dart
DA:8,2
DA:8,4
DA:12,0
DA:13,0
DA:14,0
Expand All @@ -21,27 +21,33 @@ DA:17,0
DA:18,0
DA:19,0
DA:23,0
DA:28,1
DA:29,1
DA:30,1
DA:33,3
DA:36,1
DA:37,1
DA:28,2
DA:29,6
DA:30,2
DA:31,2
DA:34,6
DA:37,2
DA:38,2
DA:39,1
LF:18
LH:9
DA:39,4
DA:40,2
LF:19
LH:10
end_of_record
SF:lib/core/routes/routes.dart
DA:11,1
DA:14,1
DA:15,1
DA:16,2
DA:17,0
DA:20,2
DA:21,0
LF:7
LH:5
DA:17,1
DA:18,1
DA:19,2
DA:20,1
DA:21,1
DA:22,0
DA:24,1
DA:25,0
DA:26,0
DA:32,2
DA:33,0
LF:12
LH:8
end_of_record
SF:lib/features/qr_code_scan/presenter/cubits/scan/scan_cubit.dart
DA:8,4
Expand All @@ -55,19 +61,19 @@ LF:7
LH:7
end_of_record
SF:lib/features/qr_code_scan/presenter/cubits/scan/scan_state.dart
DA:4,8
DA:6,0
DA:7,0
DA:11,6
DA:15,6
DA:4,10
DA:6,1
DA:7,1
DA:11,8
DA:15,8
DA:19,3
DA:23,1
DA:24,2
LF:8
LH:6
LH:8
end_of_record
SF:lib/features/qr_code_scan/presenter/pages/home/home_page.dart
DA:7,6
DA:7,8
DA:9,1
DA:11,1
DA:12,1
Expand All @@ -82,32 +88,111 @@ DA:27,0
LF:12
LH:8
end_of_record
SF:lib/core/injections/instances/get_it_instance.dart
DA:3,0
LF:1
LH:0
end_of_record
SF:lib/features/qr_code_scan/presenter/cubits/qr_code/qr_code_cubit.dart
DA:9,2
DA:11,2
DA:15,2
DA:16,2
DA:17,4
DA:18,4
DA:19,6
DA:20,2
DA:21,4
LF:9
LH:9
end_of_record
SF:lib/features/qr_code_scan/presenter/cubits/qr_code/qr_code_state.dart
DA:4,15
DA:6,1
DA:7,1
DA:11,13
DA:15,13
DA:19,4
DA:21,1
DA:22,2
DA:26,2
DA:28,1
DA:29,2
LF:11
LH:11
end_of_record
SF:lib/features/qr_code_scan/presenter/pages/qr_code/qr_code_page.dart
DA:7,5
DA:9,0
DA:10,0
DA:16,0
DA:18,0
DA:19,0
DA:22,0
DA:24,0
DA:25,0
DA:28,0
DA:30,0
DA:31,0
DA:35,0
DA:36,0
DA:38,0
DA:41,0
DA:42,0
DA:43,0
DA:45,0
DA:46,0
LF:20
LH:1
DA:11,8
DA:13,1
DA:14,1
DA:21,1
DA:23,1
DA:24,4
DA:25,3
DA:28,1
DA:30,2
DA:31,1
DA:34,1
DA:36,1
DA:37,1
DA:38,1
DA:39,1
DA:40,1
DA:41,1
DA:42,1
DA:43,1
DA:44,1
DA:45,4
DA:49,1
DA:50,1
DA:51,1
DA:52,1
DA:53,0
DA:54,0
DA:55,0
DA:59,1
DA:60,1
DA:64,1
DA:66,1
DA:67,1
DA:68,1
DA:69,1
DA:70,1
DA:71,1
DA:72,1
DA:74,2
DA:75,1
DA:77,1
DA:78,1
DA:79,2
DA:83,1
DA:84,1
DA:85,1
DA:87,1
DA:88,3
DA:89,0
DA:97,2
DA:99,1
DA:100,1
DA:102,2
DA:106,2
DA:109,1
DA:110,1
DA:111,1
DA:113,1
DA:114,2
DA:115,1
DA:126,1
DA:127,1
DA:128,1
DA:130,2
DA:132,1
DA:133,2
LF:66
LH:62
end_of_record
SF:lib/features/qr_code_scan/presenter/pages/scan/scan_page.dart
DA:8,6
DA:8,8
DA:10,1
DA:11,1
DA:18,1
Expand Down Expand Up @@ -145,9 +230,18 @@ DA:8,2
LF:4
LH:4
end_of_record
SF:lib/features/qr_code_scan/domain/entities/qr_code_entity.dart
SF:lib/core/errors/failures/failure.dart
DA:2,5
DA:7,4
DA:5,2
DA:8,4
DA:11,0
DA:12,0
LF:5
LH:3
end_of_record
SF:lib/features/qr_code_scan/domain/entities/qr_code_entity.dart
DA:2,7
DA:7,5
DA:10,3
DA:11,9
DA:12,9
Expand All @@ -156,6 +250,16 @@ DA:15,5
LF:7
LH:7
end_of_record
SF:lib/core/errors/failures/qr_code_failure.dart
DA:4,5
LF:1
LH:1
end_of_record
SF:lib/core/extensions/screen_size_extension.dart
DA:4,4
LF:1
LH:1
end_of_record
SF:lib/core/errors/exceptions/qr_code_exception.dart
DA:2,1
LF:1
Expand All @@ -171,27 +275,6 @@ DA:21,3
LF:6
LH:6
end_of_record
SF:lib/core/errors/failures/failure.dart
DA:2,2
DA:5,2
DA:8,4
DA:11,0
DA:12,0
LF:5
LH:3
end_of_record
SF:lib/core/errors/failures/qr_code_failure.dart
DA:4,2
LF:1
LH:1
end_of_record
SF:lib/features/qr_code_scan/domain/usecases/get_qr_code/get_qr_code_usecase_impl.dart
DA:8,1
DA:11,1
DA:12,2
LF:3
LH:3
end_of_record
SF:lib/features/qr_code_scan/data/datasources/get_qr_code/get_qr_code_datasource_impl.dart
DA:6,1
DA:7,1
Expand All @@ -203,3 +286,10 @@ DA:17,0
LF:7
LH:6
end_of_record
SF:lib/features/qr_code_scan/domain/usecases/get_qr_code/get_qr_code_usecase_impl.dart
DA:8,1
DA:11,1
DA:12,2
LF:3
LH:3
end_of_record
5 changes: 5 additions & 0 deletions lib/core/extensions/screen_size_extension.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import 'package:flutter/material.dart';

extension ScreenSizeExtension on BuildContext {
double get screenHeight => MediaQuery.of(this).size.height;
}
25 changes: 25 additions & 0 deletions lib/core/injections/inject.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import 'package:get_it/get_it.dart';
import 'package:superformula_leandro/features/qr_code_scan/data/datasources/get_qr_code/get_qr_code_datasource.dart';
import 'package:superformula_leandro/features/qr_code_scan/data/datasources/get_qr_code/get_qr_code_datasource_impl.dart';
import 'package:superformula_leandro/features/qr_code_scan/data/repositories/get_qr_code_repository_impl.dart';
import 'package:superformula_leandro/features/qr_code_scan/domain/repositories/get_qr_code_repository.dart';
import 'package:superformula_leandro/features/qr_code_scan/domain/usecases/get_qr_code/get_qr_code_usecase.dart';
import 'package:superformula_leandro/features/qr_code_scan/domain/usecases/get_qr_code/get_qr_code_usecase_impl.dart';

sealed class Inject {
static void init(GetIt getIt) {
getIt.registerFactory<GetQrCodeDatasource>(
GetQrCodeDatasourceImpl.new,
);
getIt.registerFactory<GetQrCodeRepository>(
() => GetQrCodeRepositoryImpl(
getQrCodeDatasource: getIt.get<GetQrCodeDatasource>(),
),
);
getIt.registerFactory<GetQrCodeUsecase>(
() => GetQrCodeUsecaseImpl(
getQrCodeRepository: getIt.get<GetQrCodeRepository>(),
),
);
}
}
3 changes: 3 additions & 0 deletions lib/core/injections/instances/get_it_instance.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import 'package:get_it/get_it.dart';

final getIt = GetIt.instance;
16 changes: 14 additions & 2 deletions lib/core/routes/routes.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:superformula_leandro/core/injections/instances/get_it_instance.dart';
import 'package:superformula_leandro/core/routes/named_routes.dart';
import 'package:superformula_leandro/features/qr_code_scan/domain/usecases/get_qr_code/get_qr_code_usecase.dart';
import 'package:superformula_leandro/features/qr_code_scan/presenter/cubits/qr_code/qr_code_cubit.dart';
import 'package:superformula_leandro/features/qr_code_scan/presenter/cubits/scan/scan_cubit.dart';
import 'package:superformula_leandro/features/qr_code_scan/presenter/cubits/timer/timer_cubit.dart';
import 'package:superformula_leandro/features/qr_code_scan/presenter/pages/home/home_page.dart';
Expand All @@ -13,8 +16,17 @@ sealed class Routes {
) =>
{
NamedRoutes.home: (context) => const HomePage(),
NamedRoutes.qrCode: (context) => BlocProvider<TimerCubit>(
create: (context) => TimerCubit(),
NamedRoutes.qrCode: (context) => MultiBlocProvider(
providers: [
BlocProvider<TimerCubit>(
create: (context) => TimerCubit(),
),
BlocProvider(
create: (context) => QrCodeCubit(
getQrCodeUsecase: getIt.get<GetQrCodeUsecase>(),
),
),
],
child: const QrCodePage(),
),
NamedRoutes.scan: (context) => BlocProvider<ScanCubit>(
Expand Down
Loading