Skip to content

Error when writing tests for methods that contain EasyLoading. #172

Description

@yassinsameh

When writing a Unit Test for a method i have that has EasyLoading.showToast() being called in it.

I get the following error:
'package:flutter_easyloading/src/easy_loading.dart': Failed assertion: line 425 pos 7: 'overlayEntry != null': You should call EasyLoading.init() in your MaterialApp

I tried instantiating the MaterialApp in the test and calling EasyLoading.init() but that didn't work.

flutter_easyloading: ^3.0.5

Activity

  1. github-actions commented on May 31, 2022

    @github-actions

    Thanks for taking the time to open an issue. I will have a look and answer as soon as possible.

  2. OmarZakiAli commented on Nov 29, 2023

    @OmarZakiAli

    no solution yet?

  3. yassinsameh commented on Nov 29, 2023

    @yassinsameh
    Author

    @OmarZakiAli Dont think so, i think i changed my testable method to throw errors instead (As should be) and the UI simply catches and shows the appropriate toast.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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