Skip to main content

avoid-duplicate-exports

added in: 1.6.0
🛠
Pro+
preset: recommended

Warns when a file has multiple exports declarations with the same URI.

Example

❌ Bad:

import "package:flutter/material.dart";
import "package:flutter_bloc/flutter_bloc.dart";

export 'package:my_app/good_folder/something.dart';
// LINT: Avoid declaring duplicate exports.
export 'package:my_app/good_folder/something.dart';

✅ Good:

import "package:flutter/material.dart";
import "package:flutter_bloc/flutter_bloc.dart";

// Correct, no duplicate exports
export 'package:my_app/good_folder/something.dart';

Additional Resources