Skip to content

x_Icon null safety compile warnings #26

@asdef

Description

@asdef

When x_icon ^0.0.5 is included in a project, when that project is compiled (discovered during unit test execution) it throws two warnings in icon.dart:

/home/asdef/.pub-cache/hosted/pub.dartlang.org/x_icon-0.0.5/lib/src/icon.dart:51:24: Warning: Operand of null-aware operation '!' has type 'ThemeData' which excludes null.
 - 'ThemeData' is from 'package:flutter/src/material/theme_data.dart' ('/flutter/flutter/packages/flutter/lib/src/material/theme_data.dart').
          style: Theme.of(context)!
                       ^
/home/asdef/.pub-cache/hosted/pub.dartlang.org/x_icon-0.0.5/lib/src/icon.dart:52:16: Warning: Operand of null-aware operation '!' has type 'TextTheme' which excludes null.
 - 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('/flutter/flutter/packages/flutter/lib/src/material/text_theme.dart').
              .textTheme!
               ^

To Reproduce

  1. add x_icon to any flutter project
  2. compile any code in the project, it doesn't even need to use x_icon
  3. receive compile warnings

Expected behavior
no compile warnings.

Additional context
Flutter version: 2.2.3
dart version: 2.13.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions