Skip to content

Commit

Permalink
Some README updates
Browse files Browse the repository at this point in the history
  • Loading branch information
MaironLucas committed Jun 15, 2024
1 parent 8aef755 commit 9fb7e6b
Show file tree
Hide file tree
Showing 14 changed files with 31 additions and 18 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,21 @@ To run, put this additional arg to you flutter run:
```
--dart-define-from-file=.env
```

## Architecture and used packages
Lets take a look on how the app is structured and what features/packages are used.

### App Theme
The app Theme was created using the [Material Design](https://material.io/design) guidelines and the
[Material Design Builder](https://material-foundation.github.io/material-theme-builder/) to generate
files accordingly to the selected params (colors and fonts). The generated files are located in the
'lib/common/theme' folder.

### Routing
The app uses [go_router](https://pub.dev/packages/go_router) to handle the routing.
The routes are defined in the 'lib/common/routing' folder.

## Dependency Injection
The app uses [get_it](https://pub.dev/packages/get_it) to handle the dependency injection. All the
classes registered in the 'lib/common/di' folder are available to be injected in the app. In general,
I choose to inject Data Sources, Repositories, Use Cases and some resources like Dio.
2 changes: 1 addition & 1 deletion lib/common/theme.dart → lib/common/theme/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ class MaterialTheme {
bodyColor: colorScheme.onSurface,
displayColor: colorScheme.onSurface,
),
scaffoldBackgroundColor: colorScheme.background,
scaffoldBackgroundColor: colorScheme.surface,
canvasColor: colorScheme.surface,
);

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/data/remote/model/arena_rm.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:json_annotation/json_annotation.dart';

part 'arena_rm.g.dart';

@JsonSerializable()
@JsonSerializable(createToJson: false)
class ArenaRM {
ArenaRM(
this.city,
Expand Down
2 changes: 1 addition & 1 deletion lib/data/remote/model/date_rm.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:json_annotation/json_annotation.dart';

part 'date_rm.g.dart';

@JsonSerializable()
@JsonSerializable(createToJson: false)
class DateRM {
DateRM(
this.start,
Expand Down
2 changes: 1 addition & 1 deletion lib/data/remote/model/game_status_rm.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:json_annotation/json_annotation.dart';

part 'game_status_rm.g.dart';

@JsonSerializable()
@JsonSerializable(createToJson: false)
class GameStatusRM {
GameStatusRM(
this.clock,
Expand Down
2 changes: 1 addition & 1 deletion lib/data/remote/model/game_summary_rm.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import 'package:nbapp/data/remote/model/teams_rm.dart';

part 'game_summary_rm.g.dart';

@JsonSerializable()
@JsonSerializable(createToJson: false)
class GameSummaryRM {
GameSummaryRM(
this.id,
Expand Down
2 changes: 1 addition & 1 deletion lib/data/remote/model/periods_rm.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:json_annotation/json_annotation.dart';

part 'periods_rm.g.dart';

@JsonSerializable()
@JsonSerializable(createToJson: false)
class PeriodsRM {
PeriodsRM(
this.current,
Expand Down
2 changes: 1 addition & 1 deletion lib/data/remote/model/scores_rm.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:nbapp/data/remote/model/team_score_rm.dart';

part 'scores_rm.g.dart';

@JsonSerializable()
@JsonSerializable(createToJson: false)
class ScoresRM {
ScoresRM(
this.visitors,
Expand Down
2 changes: 1 addition & 1 deletion lib/data/remote/model/team_rm.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:json_annotation/json_annotation.dart';

part 'team_rm.g.dart';

@JsonSerializable()
@JsonSerializable(createToJson: false)
class TeamRM {
TeamRM(
this.id,
Expand Down
2 changes: 1 addition & 1 deletion lib/data/remote/model/team_score_rm.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:json_annotation/json_annotation.dart';

part 'team_score_rm.g.dart';

@JsonSerializable()
@JsonSerializable(createToJson: false)
class TeamScoreRM {
TeamScoreRM(
this.win,
Expand Down
2 changes: 1 addition & 1 deletion lib/data/remote/model/teams_rm.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:nbapp/data/remote/model/team_rm.dart';

part 'teams_rm.g.dart';

@JsonSerializable()
@JsonSerializable(createToJson: false)
class TeamsRM {
TeamsRM(
this.visitors,
Expand Down
10 changes: 3 additions & 7 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import 'dart:async';

import 'package:flutter/material.dart';
import 'package:get_it/get_it.dart';
import 'package:go_router/go_router.dart';
import 'package:logger/logger.dart';
import 'package:nbapp/common/di.dart';
import 'package:nbapp/common/routing/routing.dart';
import 'package:nbapp/common/theme.dart';
import 'package:nbapp/common/util.dart';
import 'package:nbapp/common/theme/theme.dart';
import 'package:nbapp/common/theme/util.dart';

class Log {
Logger logger = Logger(printer: PrettyPrinter());
Expand Down Expand Up @@ -39,9 +37,7 @@ void main() async {
}

class _MyApp extends StatelessWidget {
const _MyApp({
super.key,
});
const _MyApp();

@override
Widget build(BuildContext context) {
Expand Down
1 change: 0 additions & 1 deletion test/widget_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

import 'package:nbapp/main.dart';

void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
Expand Down

0 comments on commit 9fb7e6b

Please sign in to comment.