Skip to content

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
# Conflicts:
#	lib/src/chart/radar_chart/radar_chart_data.dart
  • Loading branch information
frybitsinc committed Nov 5, 2024
2 parents d09b88b + 2f3e6ee commit fd4ade0
Show file tree
Hide file tree
Showing 27 changed files with 807 additions and 936 deletions.
20 changes: 10 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ Don't forget that `open-source` makes no sense without contributors. No matter h

This file is intended to be a guide for those who are interested in contributing to the FL Chart.

#### Below are the people who has contributed to the FL Chart. We hope we have your picture here soon.
#### Below are the people who have contributed to the FL Chart. We hope we have your picture here soon.
[![](https://opencollective.com/fl_chart/contributors.svg?width=890&button=false)](https://github.com/imaNNeo/fl_chart/graphs/contributors)

## Let's get Started

Make sure you have Flutter installed and on your path (follow [installation guide](https://docs.flutter.dev/get-started/install)).
Make sure you have Flutter installed and on your path (follow the [installation guide](https://docs.flutter.dev/get-started/install)).

Follow these steps to clone FL Chart and set up the development environment:

Expand All @@ -27,7 +27,7 @@ Follow these steps to clone FL Chart and set up the development environment:
## Before Modifying the Code

If the work you intend to do is non-trivial, it is necessary to open
an issue before starting writing your code. This helps us and the
an issue before starting to write your code. This helps us and the
community to discuss the issue and choose what is deemed to be the
best solution.

Expand All @@ -39,7 +39,7 @@ In case you couldn't find any issue, it's better to create an issue to explain w
We have a *_chart_painter.dart class per each chart type. It draws elements into the Canvas.
We made the CanvasWrapper class, because we wanted to test draw functions.
CanvasWrapper class holds a canvas and all draw functions proxies through it.
You should use it for drawing on the canvas, Instead of direct accessing to canvas.
You should use it for drawing on the canvas, Instead of directly accessing the canvas.
It makes draw functions testable.

<img src="https://github.com/imaNNeo/fl_chart/raw/main/repo_files/images/architecture/fl_chart_architecture.jpg" />
Expand All @@ -50,7 +50,7 @@ It makes draw functions testable.
While you are developing your branch, It is common that your branch gets outdated and you need to update your branch with the `master` branch.
To do that, please use `rebase` instead of `merge`. Because when you finish the PR, we must `rebase` your branch and merge it with the master.
The reason that we prefer `rebase` over `merge` is the simplicity of the commit history. It allows us to have sequential commits in the `master`
[This article](https://www.atlassian.com/git/tutorials/merging-vs-rebasing) might help to understand it better.
[This article](https://www.atlassian.com/git/tutorials/merging-vs-rebasing) might help you understand it better.

## Checking Your Code's Quality

Expand All @@ -60,7 +60,7 @@ correctly and meets our guidelines. Our guidelines are:
You can simply run `make checkstyle`, and if you faced any formatting problem, run `make format`.

##### Run `make checkstyle` to ensure that your code is formatted correctly
- It runs `flutter analyze` to verify that there is no any warning or error.
- It runs `flutter analyze` to verify that there are no warnings or errors.
- It runs `dart format --set-exit-if-changed --dry-run .` to verify that code has formatted correctly.

#### Run `make format` to reformat the code
Expand All @@ -74,9 +74,9 @@ You can simply run `make checkstyle`, and if you faced any formatting problem, r
- It runs both `make runTests` and then `make checkstyle` sequentially with a single command.

## Test coverage (unit tests)
We should write unit-test for our written code. If you are not familiar with unit-tests, please start from [here](https://docs.flutter.dev/cookbook/testing/unit/introduction).
We should write unit tests for our written code. If you are not familiar with unit-tests, please start from [here](https://docs.flutter.dev/cookbook/testing/unit/introduction).

[Mockito](https://pub.dev/packages/mockito) is the library that we use to mock our classes, please read more about it from their docs [here](https://github.com/dart-lang/mockito#lets-create-mocks).
[Mockito](https://pub.dev/packages/mockito) is the library that we use to mock our classes. Please read more about it in their docs [here](https://github.com/dart-lang/mockito#lets-create-mocks).

Our code coverage is calculated by [Codecov](https://app.codecov.io/gh/imaNNeo/fl_chart) (Our coverage is [![codecov](https://codecov.io/gh/imaNNeo/fl_chart/branch/main/graph/badge.svg?token=XBhsIZBbZG)](https://codecov.io/gh/imaNNeo/fl_chart)
at the moment)
Expand All @@ -88,12 +88,12 @@ Please make sure that your code is **not decreasing** the coverage.
## Creating a Pull Request

Congratulations! Your code meets all of our guidelines :100:. Now you have to
submit a pull request (or PR for short) to us. These are the steps you should
submit a pull request (PR for short) to us. These are the steps you should
follow when creating a PR:

- Make a descriptive title that summarizes what changes were in the PR.

- Mention the issues that you are fixing (if doesn't exist, try to make one and explain the issue clearly)
- Mention the issues that you are fixing (if they don't exist, try to make one and explain the issue clearly)

- Change your code according to feedback (if any).

Expand Down
4 changes: 2 additions & 2 deletions example/lib/presentation/menu/app_menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ class AppMenu extends StatefulWidget {
final VoidCallback? onBannerClicked;

const AppMenu({
Key? key,
super.key,
required this.menuItems,
required this.currentSelectedIndex,
required this.onItemSelected,
required this.onBannerClicked,
}) : super(key: key);
});

@override
AppMenuState createState() => AppMenuState();
Expand Down
2 changes: 1 addition & 1 deletion example/lib/presentation/menu/fl_chart_banner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';

class FlChartBanner extends StatelessWidget {
const FlChartBanner({Key? key}) : super(key: key);
const FlChartBanner({super.key});

@override
Widget build(BuildContext context) {
Expand Down
7 changes: 3 additions & 4 deletions example/lib/presentation/menu/menu_row.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ class MenuRow extends StatefulWidget {
final VoidCallback onDocumentsTap;

const MenuRow({
Key? key,
super.key,
required this.text,
required this.svgPath,
required this.isSelected,
required this.onTap,
required this.onDocumentsTap,
}) : super(key: key);
});

@override
State<MenuRow> createState() => _MenuRowState();
Expand Down Expand Up @@ -77,9 +77,8 @@ class _MenuRowState extends State<MenuRow> {

class _DocumentationIcon extends StatelessWidget {
const _DocumentationIcon({
Key? key,
required this.onTap,
}) : super(key: key);
});
final VoidCallback onTap;

@override
Expand Down
4 changes: 2 additions & 2 deletions example/lib/presentation/pages/chart_samples_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ class ChartSamplesPage extends StatelessWidget {
final samples = ChartSamples.samples;

ChartSamplesPage({
Key? key,
super.key,
required this.chartType,
}) : super(key: key);
});

@override
Widget build(BuildContext context) {
Expand Down
4 changes: 2 additions & 2 deletions example/lib/presentation/pages/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import 'chart_samples_page.dart';

class HomePage extends StatelessWidget {
HomePage({
Key? key,
super.key,
required this.showingChartType,
}) : super(key: key) {
}) {
_initMenuItems();
}

Expand Down
26 changes: 12 additions & 14 deletions example/lib/presentation/router/app_router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,18 @@ final appRouterConfig = GoRouter(
return '/${ChartType.values.first.name}';
},
),
...ChartType.values
.map(
(ChartType chartType) => GoRoute(
path: '/${chartType.name}',
pageBuilder: (BuildContext context, GoRouterState state) =>
MaterialPage<void>(
/// We set a key for HomePage to prevent recreate it
/// when user choose a new chart type to show
key: const ValueKey('home_page'),
child: HomePage(showingChartType: chartType),
),
),
)
.toList(),
...ChartType.values.map(
(ChartType chartType) => GoRoute(
path: '/${chartType.name}',
pageBuilder: (BuildContext context, GoRouterState state) =>
MaterialPage<void>(
/// We set a key for HomePage to prevent recreate it
/// when user choose a new chart type to show
key: const ValueKey('home_page'),
child: HomePage(showingChartType: chartType),
),
),
),
GoRoute(
path: '/:any',
builder: (context, state) => Container(color: AppColors.pageBackground),
Expand Down
4 changes: 2 additions & 2 deletions example/lib/presentation/widgets/chart_holder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ class ChartHolder extends StatelessWidget {
final ChartSample chartSample;

const ChartHolder({
Key? key,
super.key,
required this.chartSample,
}) : super(key: key);
});

@override
Widget build(BuildContext context) {
Expand Down
Loading

0 comments on commit fd4ade0

Please sign in to comment.