Skip to content

Instantly share code, notes, and snippets.

@dmslabsbr
Created February 21, 2024 20:16
Show Gist options
  • Save dmslabsbr/31b9fb957d7b815d338d6a622d5ffbc3 to your computer and use it in GitHub Desktop.
Save dmslabsbr/31b9fb957d7b815d338d6a622d5ffbc3 to your computer and use it in GitHub Desktop.
Useful Custom Action to help debug Flutterflow code.
// Automatic FlutterFlow imports
import '/backend/schema/structs/index.dart';
import '/backend/supabase/supabase.dart';
import '/flutter_flow/flutter_flow_theme.dart';
import '/flutter_flow/flutter_flow_util.dart';
import '/custom_code/actions/index.dart'; // Imports other custom actions
import '/flutter_flow/custom_functions.dart'; // Imports custom functions
import 'package:flutter/material.dart';
// Begin custom action code
// DO NOT REMOVE OR MODIFY THE CODE ABOVE!
/**
imprimime no console o valor de uma váriavel
*/
Future printVar(String? valor) async {
//TODO: Contar os prints e opção de timestamp
print(valor ?? "null");
}
// Automatic FlutterFlow imports
import '/backend/schema/structs/index.dart';
import '/backend/supabase/supabase.dart';
import '/flutter_flow/flutter_flow_theme.dart';
import '/flutter_flow/flutter_flow_util.dart';
import '/custom_code/actions/index.dart'; // Imports other custom actions
import '/flutter_flow/custom_functions.dart'; // Imports custom functions
import 'package:flutter/material.dart';
// Begin custom action code
// DO NOT REMOVE OR MODIFY THE CODE ABOVE!
Future printVar2(
String? tag,
String? varName,
String? valor,
) async {
// Add your function code here!
// necessario criar um appState printLogId - Int <====== Atenção
String nTag = tag ?? "";
String nVarName = varName ?? "";
String nVal = valor ?? "null";
int logId = FFAppState().printLogId;
logId++;
FFAppState().update(() {
FFAppState().printLogId = logId;
});
print('$logId : $nTag, $nVarName => $nVal');
}
@dmslabsbr
Copy link
Author

arg1

arg2

arg3

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