FlutterFlow testfunction returns value, Testmode returns infinity

35 views Asked by At

I keep getting infinite as a result when making flutterflow do basic math.

I am trying to get a scoring calculator to work. so far i got the layout and in the test enviroment for functions the script works and returns the values it should however when i try the app out in testmode the values return as infinite.

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';

double newCustomFunction(
  int alpha,
  int charlie,
  int delta,
  int metal,
  int breakable,
  int nonshoot,
  int mike,
  double time,
) {
  /// MODIFY CODE ONLY BELOW THIS LINE

  var alphatot = alpha * 5;
  var charlietot = charlie * 3;
  var deltatot = delta * 1;
  var metaltot = metal * 5;
  var breaktot = breakable * 5;

  var plus = alphatot + charlietot + deltatot + metaltot + breaktot;

  var nont = nonshoot * 10;
  var miket = mike * 10;

  var min = nont + miket;

  var score1 = plus - min;
  var score2 = score1 * 100;

  return score2 / time;

  /// MODIFY CODE ONLY ABOVE THIS LINE
}

is the code i made and i made it already far more complicated then it should have been.

I've tried switching from doubles to floats to integers. I also changed the buttons to textfields but nothing seems to be helping.

0

There are 0 answers