Skip to content

Compile time error: DialogThemeData and the method 'withValues' #18

Description

@Rajuavs

Hi friend, I got Error as bellow:

../../.pub-cache/hosted/pub.dev/ndialog-4.4.1+1/lib/src/progress_dialog.dart:287:11: Error: 'DialogThemeData' isn't a type.
final DialogThemeData dialogTheme = DialogTheme.of(context);
^^^^^^^^^^^^^^^
../../.pub-cache/hosted/pub.dev/ndialog-4.4.1+1/lib/src/utils.dart:4:47: Error: The method 'withValues' isn't defined for the class 'Color'.

  • 'Color' is from 'dart:ui'.
    Try correcting the name to the name of an existing method, or defining a method named 'withValues'.
    Color get generalBarrierColor => Colors.black.withValues(alpha: .5);

I Resolved as bellow:
1).
page: utils.dart
Color get generalBarrierColor => Colors.black.withValues(alpha: .5);
replaced with "withOpacity"
Color get generalBarrierColor => Colors.black.withOpacity(0.5);

2).
page: progress_dialog.dart
error line: 287 :
final DialogThemeData dialogTheme = DialogTheme.of(context);
removed "DialogThemeData"
final dialogTheme = DialogTheme.of(context);

Update your package, kindly, as it can cause problems for others.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions