import_sorter 1.0.10
import_sorter: ^1.0.10 copied to clipboard
Dart package that automatically sort all your dart imports. Support for any dart project.
import_sorter
#
📱 Dart package that automatically sorts all your flutter and dart imports. Any dart project supported! Sorts imports and reorders them based off the following format:
- Dart imports
- Flutter imports
- Package imports
- Project imports
Below is an example:
Before #
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/physics.dart';
import 'package:flutter/painting.dart';
import 'package:intl/intl.dart';
import 'package:mdi/mdi.dart';
import 'package:provider/provider.dart';
import 'anotherFile.dart';
import 'package:example_app/anotherFile2.dart';
import 'dart:async';
import 'dart:io';
import 'dart:js';
After #
// Dart imports:
import 'dart:async';
import 'dart:io';
import 'dart:js';
// Flutter imports:
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/physics.dart';
import 'package:flutter/painting.dart';
// Package imports:
import 'package:intl/intl.dart';
import 'package:mdi/mdi.dart';
import 'package:provider/provider.dart';
// Project imports:
import 'anotherFile.dart';
import 'package:example_app/anotherFile2.dart';
🚀 Installing #
Simply add import_sorter: ^1.0.10
to your dev_dependencies
🏃♂️ Running #
Once you've installed it simply run flutter pub run import_sorter:main
(pub run import_sorter:main
if normal dart application) to format every file dart file in your lib, bin, test, and tests folder! Don't worry if these folders don't exist.
✨ Features #
- Add the
-e
flag to the run command and have emojis added to your imports 😄
🙋♀️🙋♂️ Contributing #
All contributions are welcome! Just make sure that its not an already existing issue or pull request