Custom Function doesn't work

I've created the custom function bellow:

import 'dart:convert';
import 'dart:math' as math;

import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:intl/intl.dart';
import 'package:timeago/timeago.dart' as timeago;
import '/flutter_flow/lat_lng.dart';
import '/flutter_flow/place.dart';
import '/flutter_flow/uploaded_file.dart';
import '/flutter_flow/custom_functions.dart';
import '/backend/supabase/supabase.dart';
import '/auth/supabase_auth/auth_util.dart';

String concatEndereco(
  String? logradouro,
  String? numero,
  String? complemento,
  String? bairro,
  String? municipio,
  String? estado,
  String? cep,
) {
  /// MODIFY CODE ONLY BELOW THIS LINE

  List<String> endereco = [
    logradouro ?? '',
    numero ?? '',
    complemento ?? '',
    bairro ?? '',
    municipio ?? '',
    estado ?? '',
    cep ?? '',
  ];
  return endereco.where((str) => str.isNotEmpty).join(', ');

  /// MODIFY CODE ONLY ABOVE THIS LINE
}

But i get the error:

Compilation error: Info: Compiling with sound null safety

lib/main.dart:1082:28:

Error: Undefined name 'SupaFlow'.

final response = await SupaFlow.client.auth

^^^^^^^^

lib/main.dart:1083:21:

Error: Method not found: 'UserAttributes'.

.updateUser(UserAttributes(password: newPassword));

^^^^^^^^^^^^^^

Error: Compilation failed.

But when i try to execute the function above on the dartpad.dev, it works fine..

1 reply