conditional_uri_does_not_exist

Group: style

Maturity: stable

Linter v1.16.0

Since info is static, may be stale

View all Lint Rules

Using the Linter

DON'T reference files that do not exist in conditional imports.

Code may fail at runtime if the condition evaluates such that the missing file needs to be imported.

BAD:

import 'file_that_does_exist.dart'
  if (condition) 'file_that_does_not_exist.dart';

GOOD:

import 'file_that_does_exist.dart'
  if (condition) 'file_that_also_does_exist.dart';