by @kodeazy

flutter how to check array is empty or not in dart file?

Home » flutter » flutter how to check array is empty or not in dart file?
  • We use isEmpty function to check array is empty or not.
  • If output is true then array does not have elements else if output is false array has elements.

    void main() {
    var numbers = [1, 2, 3, 4];
    print(numbers.isEmpty);
    }

    Output

    false