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

Dev 0.12.3 #577

Merged
merged 30 commits into from
Feb 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
4e813ae
Fix issue #514
Jan 6, 2021
00b38fa
Flutter format
Jan 6, 2021
4f06302
refactor(bar_chart_painter): change list constructor to filled
albertms10 Jan 9, 2021
bd1c6c2
Update example app (add flutter web support)
shripal17 Jan 16, 2021
06c2005
Update example app with next and previous buttons (for web only)
shripal17 Jan 16, 2021
5aa24fa
Wrap GestureDetector in line_chart with MouseRegion
shripal17 Jan 16, 2021
c5ca631
Wrap GestureDetector in pie_chart with MouseRegion
shripal17 Jan 16, 2021
6fcf6b4
Fix next/previous buttons in example app causing issue in mobile
shripal17 Jan 16, 2021
e46d50b
Wrap GestureDetector in bar_chart with MouseRegion
shripal17 Jan 16, 2021
7a951d4
Format files according to project's specification
shripal17 Jan 16, 2021
2c5a3dc
Fix deprecated constructor warning in bar_chart_painter
shripal17 Jan 16, 2021
af51913
Correct typo in field name
4amVim Jan 18, 2021
e72a1aa
Add pedantic and resolve all analyze issues
imaNNeo Dec 24, 2020
5dbae54
Merge pull request #547 from mathmetal/patch-1
imaNNeo Jan 22, 2021
7e898b9
Add guide for switch to `dev` branch in CONTRIBUTING.md
imaNNeo Jan 22, 2021
e64de1f
Merge branch 'dev' into master
shripal17 Jan 23, 2021
c48d8dd
Format changed files
shripal17 Jan 23, 2021
f267194
Merge branch 'dev' into fix-list-constructor
albertms10 Jan 24, 2021
34d3fe6
Merge pull request #535 from xinoxapps/bugfix/piechart-resize
imaNNeo Jan 25, 2021
8f97298
Revert "bar_chart_painter.dart"
shripal17 Jan 25, 2021
4fda5a4
Merge branch 'dev' into master
shripal17 Jan 25, 2021
80ac1a5
Revert "bar_chart_painter" properly
shripal17 Jan 25, 2021
ac10774
Merge pull request #545 from shripal17/master
imaNNeo Jan 25, 2021
2629fdd
Merge pull request #540 from albertms10/fix-list-constructor
imaNNeo Jan 30, 2021
97f263d
Fixes 'Build function can not return null'
bdlukaa Feb 13, 2021
ee19025
Merge pull request #574 from bdlukaa/dev
imaNNeo Feb 17, 2021
a8feaf6
Update CHANGELOG.md
imaNNeo Feb 17, 2021
2af726e
Fixed Bug of drawing lines with strokeWidth zero, #558.
imaNNeo Feb 17, 2021
af68569
Update README.md
imaNNeo Feb 17, 2021
1e8d3c1
Bump version to 0.12.3
imaNNeo Feb 17, 2021
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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 0.12.3
* [Bugfix] Fixed PieChart exception bug on sections tap, #514.
* [Bugfix] Fixed PieChart badges problem, #538.
* [Bugfix] Fixed Bug of drawing lines with strokeWidth zero, #558.
* [Improvement] Updated example app to support web.
* [Improvement] Show tooltips on mouse hover on Web, and Desktop.

## 0.12.2
* [Bugfix] Fixed PieChart badges draw in first frame problem, #513.
* [Improvement] Use CanvasWrapper to proxy draw functions (It does not have any effect on the result, it makes the code testable)
Expand Down
7 changes: 7 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ an issue before starting writing your code. This helps us and the
community to discuss the issue and choose what is deemed to be the
best solution.

## Switch to `dev` branch

You should make your changes upon the `dev` branch (All development changes happen in the `dev` branch, then I publish a new version and merge them into the `master`)


## Drawing architecture
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.
Expand Down Expand Up @@ -49,6 +54,8 @@ 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
follow when creating a PR:

- Make sure you select `dev` branch as your target branch.

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

- Link to issues that this PR will fix (if any).
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Thank you all!

```yml
dependencies:
fl_chart: ^0.12.2
fl_chart: ^0.12.3
```


Expand Down Expand Up @@ -69,9 +69,9 @@ flutter packages get

#### :moneybag: Donation (bitcoin) :moneybag:
##### I work on this project in my free time because I have my personal life and job. You can push me to work more by donating.
<img src="https://github.com/imaNNeoFighT/fl_chart/raw/master/repo_files/images/bitcoin_public_key.png" width="180" >
<img src="https://github.com/imaNNeoFighT/fl_chart/raw/master/repo_files/images/bitcoin_public_key.jpg" width="180" >

`1BJt8apHJVreFyaPvseHcE17QQ3JwAdBcu`
`1L7ghKdcmgydmUJAnmYmMaiVjT1LoP4a45`

### Contributing

Expand Down
139 changes: 2 additions & 137 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include: package:pedantic/analysis_options.1.9.0.yaml
analyzer:
strong-mode:
implicit-dynamic: false
Expand All @@ -19,140 +20,4 @@ analyzer:
- 'lib/i18n/stock_messages_*.dart'
- 'lib/src/http/**'
- 'example/**'

linter:
rules:
# these rules are documented on and in the same order as
# the Dart Lint rules page to make maintenance easier
# https://github.com/dart-lang/linter/blob/master/example/all.yaml
- always_declare_return_types
- always_put_control_body_on_new_line
# - always_put_required_named_parameters_first # we prefer having parameters in the same order as fields https://github.com/flutter/flutter/issues/10219
- always_require_non_null_named_parameters
- annotate_overrides
# - avoid_annotating_with_dynamic # conflicts with always_specify_types
- avoid_as
# - avoid_bool_literals_in_conditional_expressions # not yet tested
# - avoid_catches_without_on_clauses # we do this commonly
# - avoid_catching_errors # we do this commonly
- avoid_classes_with_only_static_members
# - avoid_double_and_int_checks # only useful when targeting JS runtime
- avoid_empty_else
- avoid_field_initializers_in_const_classes
- avoid_function_literals_in_foreach_calls
# - avoid_implementing_value_types # not yet tested
- avoid_init_to_null
# - avoid_js_rounded_ints # only useful when targeting JS runtime
- avoid_null_checks_in_equality_operators
# - avoid_positional_boolean_parameters # not yet tested
# - avoid_private_typedef_functions # we prefer having typedef (discussion in https://github.com/flutter/flutter/pull/16356)
- avoid_relative_lib_imports
- avoid_renaming_method_parameters
- avoid_return_types_on_setters
# - avoid_returning_null # there are plenty of valid reasons to return null
# - avoid_returning_null_for_future # not yet tested
- avoid_returning_null_for_void
# - avoid_returning_this # there are plenty of valid reasons to return this
# - avoid_setters_without_getters # not yet tested
# - avoid_shadowing_type_parameters # not yet tested
# - avoid_single_cascade_in_expression_statements # not yet tested
- avoid_slow_async_io
- avoid_types_as_parameter_names
# - avoid_types_on_closure_parameters # conflicts with always_specify_types
- avoid_unused_constructor_parameters
- avoid_void_async
- await_only_futures
- camel_case_types
- cancel_subscriptions
# - cascade_invocations # not yet tested
# - close_sinks # not reliable enough
# - comment_references # blocked on https://github.com/flutter/flutter/issues/20765
# - constant_identifier_names # needs an opt-out https://github.com/dart-lang/linter/issues/204
- control_flow_in_finally
# - curly_braces_in_flow_control_structures # not yet tested
# - directives_ordering
- empty_catches
- empty_constructor_bodies
- empty_statements
# - file_names # not yet tested
- flutter_style_todos
- hash_and_equals
- implementation_imports
# - invariant_booleans # too many false positives: https://github.com/dart-lang/linter/issues/811
- iterable_contains_unrelated_type
# - join_return_with_assignment # not yet tested
- library_names
- library_prefixes
# - lines_longer_than_80_chars # not yet tested
- list_remove_unrelated_type
# - literal_only_boolean_expressions # too many false positives: https://github.com/dart-lang/sdk/issues/34181
- no_adjacent_strings_in_list
- no_duplicate_case_values
- non_constant_identifier_names
# - null_closures # not yet tested
# - omit_local_variable_types # opposite of always_specify_types
# - one_member_abstracts # too many false positives
# - only_throw_errors # https://github.com/flutter/flutter/issues/5792
- overridden_fields
- package_api_docs
- package_names
- package_prefixed_library_names
# - parameter_assignments # we do this commonly
- prefer_adjacent_string_concatenation
- prefer_asserts_in_initializer_lists
- prefer_collection_literals
- prefer_conditional_assignment
- prefer_const_constructors
- prefer_const_constructors_in_immutables
- prefer_const_declarations
- prefer_const_literals_to_create_immutables
# - prefer_constructors_over_static_methods # not yet tested
- prefer_contains
- prefer_equal_for_default_values
# - prefer_expression_function_bodies # conflicts with https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#consider-using--for-short-functions-and-methods
- prefer_final_fields
- prefer_final_locals
- prefer_foreach
# - prefer_function_declarations_over_variables # not yet tested
- prefer_generic_function_type_aliases
# - prefer_initializing_formals # Fucked up with Equatable, because it's added props field, then we couldn't have const constructor.
# - prefer_int_literals # not yet tested
# - prefer_interpolation_to_compose_strings # not yet tested
- prefer_is_empty
- prefer_is_not_empty
- prefer_iterable_whereType
# - prefer_mixin # https://github.com/dart-lang/language/issues/32
# - prefer_null_aware_operators # disable until NNBD, see https://github.com/flutter/flutter/pull/32711#issuecomment-492930932
- prefer_single_quotes
- prefer_typing_uninitialized_variables
- prefer_void_to_null
# - public_member_api_docs # enabled on a case-by-case basis; see e.g. packages/analysis_options.yaml
- recursive_getters
- slash_for_doc_comments
- sort_pub_dependencies
# - super_goes_last # no longer needed w/ Dart 2
- test_types_in_equals
- throw_in_finally
# - type_annotate_public_apis # subset of always_specify_types
- type_init_formals
# - unawaited_futures # too many false positives
# - unnecessary_await_in_return # not yet tested
- unnecessary_brace_in_string_interps
- unnecessary_const
- unnecessary_getters_setters
# - unnecessary_lambdas # has false positives: https://github.com/dart-lang/linter/issues/498
- unnecessary_new
- unnecessary_null_aware_assignments
- unnecessary_null_in_if_null_operators
- unnecessary_overrides
- unnecessary_parenthesis
- unnecessary_statements
- unnecessary_this
- unrelated_type_equality_checks
# - use_function_type_syntax_for_parameters # not yet tested
- use_rethrow_when_possible
# - use_setters_to_change_properties # not yet tested
# - use_string_buffers # has false positives: https://github.com/dart-lang/sdk/issues/34182
# - use_to_and_as_if_applicable # has false positives, so we prefer to catch this by code-review
- valid_regexps
# - void_checks # not yet tested
- 'test/**'
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="?android:colorBackground" />

<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>
18 changes: 18 additions & 0 deletions example/android/app/src/main/res/values-night/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.

This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreviewsEnabled</key>
<false/>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreviewsEnabled</key>
<false/>
</dict>
</plist>
65 changes: 55 additions & 10 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';

import 'bar_chart/bar_chart_page.dart';
Expand Down Expand Up @@ -36,23 +37,67 @@ class MyHomePage extends StatefulWidget {
}

class _MyHomePageState extends State<MyHomePage> {
int _currentPage = 0;

final _controller = PageController(initialPage: 0);
final _duration = Duration(milliseconds: 300);
final _curve = Curves.easeInOutCubic;
final _pages = [
LineChartPage(),
BarChartPage(),
BarChartPage2(),
PieChartPage(),
LineChartPage2(),
LineChartPage3(),
LineChartPage4(),
ScatterChartPage(),
];

@override
void initState() {
_controller.addListener(() {
setState(() {
_currentPage = _controller.page.round();
});
});
}

@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: PageView(
children: <Widget>[
LineChartPage(),
BarChartPage(),
BarChartPage2(),
PieChartPage(),
LineChartPage2(),
LineChartPage3(),
LineChartPage4(),
ScatterChartPage(),
],
physics: kIsWeb ? NeverScrollableScrollPhysics() : AlwaysScrollableScrollPhysics(),
controller: _controller,
children: _pages,
),
),
bottomNavigationBar: kIsWeb
? Container(
padding: EdgeInsets.all(16),
color: Colors.transparent,
child: Row(
mainAxisSize: MainAxisSize.max,
children: [
Visibility(
visible: _currentPage != 0,
child: FloatingActionButton(
onPressed: () => _controller.previousPage(duration: _duration, curve: _curve),
child: Icon(Icons.chevron_left_rounded),
),
),
Spacer(),
Visibility(
visible: _currentPage != _pages.length - 1,
child: FloatingActionButton(
onPressed: () => _controller.nextPage(duration: _duration, curve: _curve),
child: Icon(Icons.chevron_right_rounded),
),
),
],
),
)
: null,
);
}
}
2 changes: 1 addition & 1 deletion example/lib/pie_chart/samples/pie_chart_sample1.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class PieChartSample1State extends State {
borderData: FlBorderData(
show: false,
),
sectionsSpace: 12,
sectionsSpace: 1,
centerSpaceRadius: 0,
sections: showingSections()),
),
Expand Down
14 changes: 8 additions & 6 deletions example/lib/pie_chart/samples/pie_chart_sample3.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';

import 'package:fl_chart/fl_chart.dart';

/// Icons by svgrepo.com (https://www.svgrepo.com/collection/job-and-professions-3/)
class PieChartSample3 extends StatefulWidget {
@override
Expand Down Expand Up @@ -154,10 +154,12 @@ class _Badge extends StatelessWidget {
),
padding: EdgeInsets.all(size * .15),
child: Center(
child: SvgPicture.asset(
svgAsset,
fit: BoxFit.contain,
),
child: kIsWeb
? Image.network(svgAsset, fit: BoxFit.contain)
: SvgPicture.asset(
svgAsset,
fit: BoxFit.contain,
),
),
);
}
Expand Down
Binary file added example/web/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example/web/icons/Icon-192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example/web/icons/Icon-512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading