Flutter app background use of the compute function

491

You need to import the foundation package. Put this in the beginning of the file

import 'package:flutter/foundation.dart';
Share:
491
Aderbal Nunes
Author by

Aderbal Nunes

Updated on December 06, 2022

Comments

  • Aderbal Nunes
    Aderbal Nunes over 1 year

    I'm learning Flutter and in my first app I try to use http to fetch a list of users. When I try to parse json response data using 'compute' function, my code broken. "The function 'compute' ins't defined"

    Error

    I have no idea what's happening.

  • Aderbal Nunes
    Aderbal Nunes over 5 years
    I can not believe I forgot that. Thanks.