MPFlutterChart icon indicating copy to clipboard operation
MPFlutterChart copied to clipboard

There should be a single import for mp_chart instead of tens of files

Open absar opened this issue 5 years ago • 0 comments

First of all thanks a million for porting it to Flutter, it's a very rich library, it has a potential of becoming top Flutter charting library. I would like to add a suggestion to create either a single export file mp_chart which should export all mp chart files, or create separate files per chart type, e.g. mp_chart_pie, mp_chart_line. Currently we have to import tons of files just to create a simple chart, which is very verbose. For example I had to import all these files to create a simple pie chart:

import 'package:mp_chart/mp/chart/pie_chart.dart';
import 'package:mp_chart/mp/core/adapter_android_mp.dart';
import 'package:mp_chart/mp/core/animator.dart';
import 'package:mp_chart/mp/core/common_interfaces.dart';
import 'package:mp_chart/mp/core/data/pie_data.dart';
import 'package:mp_chart/mp/core/description.dart';
import 'package:mp_chart/mp/core/entry/entry.dart';
import 'package:mp_chart/mp/core/entry/pie_entry.dart';
import 'package:mp_chart/mp/core/utils/color_utils.dart';
import 'package:mp_chart/mp/core/highlight/highlight.dart';
import 'package:mp_chart/mp/core/enums/value_position.dart';
import 'package:mp_chart/mp/core/data_set/pie_data_set.dart';
import 'package:mp_chart/mp/core/enums/legend_orientation.dart';
import 'package:mp_chart/mp/core/render/pie_chart_renderer.dart';
import 'package:mp_chart/mp/controller/pie_chart_controller.dart';
import 'package:mp_chart/mp/core/enums/legend_horizontal_alignment.dart';
import 'package:mp_chart/mp/core/enums/legend_vertical_alignment.dart';
import 'package:mp_chart/mp/core/value_formatter/percent_formatter.dart';

Dart guideline for libraries: https://dart.dev/guides/libraries/create-library-packages

absar avatar Nov 06 '20 23:11 absar