In your plugin, you have a lib
folder. Create a lib/src
sub-folder and move the bulk of your implementation files there. It's typical to be left with just one file in lib
e.g. someplugin.dart
.
In there you can have any top level classes or functions but this is where you include the implementation source files using the export
directive.
Here's an example from the google_sign_in plugin, from google_sign_in.dart
:
import 'dart:async';
import 'dart:ui' show hashValues;
import 'package:flutter/services.dart' show MethodChannel;
import 'package:meta/meta.dart' show visibleForTesting;
import 'src/common.dart'; // this import is only required if used by some top level
// class lower down this file
export 'src/common.dart'; // this export means that your plugin's users don't need
// to import it themselves