Float is a single-precision 4 byte floating-point type with an approximate range of 1.2E-38 to 3.4E+38.
The default value of a Float is 0.0f. You can change the default value of the property by assigning a new value in an overridden method.
float is a single-precision 4 byte floating-point type with an approximate range of 1.2E-38 to 3.4E+38.
The default value of a float is 0.0f. You can change the default value of the property by assigning a new value in an overridden method.
The flutter class defers to the underlying platform (iOS) or (Android) subclass to read property values.
As Dart doesn't have a single-precision float data type, you should map to a double-precision double data type instead:
Dart property type
Swift property type
Objective-C property type
Kotlin property type
Java property type
double
Float
float
Float
float
Local properties
Slider UI
Allows a float property to be changed in Appfigurate using a slider between minimum and maximum values.
Swift prototype
@FloatPropertySlider(min, max, icon, description, restart)
var propertyName: Float
You can customize the minimum and maximum images using the parameter. If restart is true, then the app will be restarted if the property value changes.
import nz.co.electricbolt.appfiguratelibrary.Configuration;
import nz.co.electricbolt.appfiguratelibrary.annotations.FloatPropertySlider;
import nz.co.electricbolt.appfiguratelibrary.annotations.IconSlider;
public class AppConfiguration extends Configuration {
@FloatPropertySlider(minValue = 60.5f, max = 120.41f, sliderIcon = IconSlider.IconSliderVolume, description = "Clipping - decibels", restart = false)
public float maxDecibel;
@Override
public void reset() {
super.reset();
this.maxDecibel = 100.0f;
}
...
Dart prototype
double get propertyName => nativeDouble('propertyName');
Dart example
import 'package:appfigurateflutter/appfigurateflutter.dart';
public class Configuration extends APLNativeConfiguration {
double get maxDecibel => nativeDouble('maxDecibel');
...
JavaScript example
import {
NativeModules,
} from 'react-native';
const {Appfigurate} = NativeModules;
...
let maxDecibel = await Appfigurate.nativeValue("maxDecibel"); // Number
Editable UI
Allows a float property to be changed in Appfigurate using a text field between minimum and maximum values, and an optional regular expression validating input.
Swift prototype
@FloatPropertyEdit(min, max, regex, description, restart)
var propertyName: Float
If restart is true, then the app will be restarted if the property value changes.
If restart is true, then the app will be restarted if the property value changes.
Java example
import nz.co.electricbolt.appfiguratelibrary.Configuration;
import nz.co.electricbolt.appfiguratelibrary.annotations.FloatPropertyEdit;
public class AppConfiguration extends Configuration {
@FloatPropertyEdit(description = "Shot accuracy", minValue = -2.1f, maxValue = 4.1f, regularExpression = "", restart = false)
public float shotAccuracy;
@Override
public void reset() {
super.reset();
this.shotAccuracy = 3.241f;
}
...
Dart prototype
double get propertyName => nativeDouble('propertyName');
Dart example
import 'package:appfigurateflutter/appfigurateflutter.dart';
public class Configuration extends APLNativeConfiguration {
double get shotAccuracy => nativeDouble('shotAccuracy');
...
JavaScript example
import {
NativeModules,
} from 'react-native';
const {Appfigurate} = NativeModules;
...
let shotAccuracy = await Appfigurate.nativeValue("shotAccuracy"); // Number
List UI
Allows a float property to be changed in Appfigurate by allowing the user to select from a predefined list of valid choices.
Swift prototype
@FloatPropertyList(description, restart, values)
var propertyName: Float
If restart is true, then the app will be restarted if the property value changes.
double get propertyName => nativeDouble('propertyName');
Dart example
import 'package:appfigurateflutter/appfigurateflutter.dart';
public class Configuration extends APLNativeConfiguration {
double get rating => nativeDouble('rating');
...
JavaScript example
import {
NativeModules,
} from 'react-native';
const {Appfigurate} = NativeModules;
...
let rating = await Appfigurate.nativeValue("rating"); // Number
Editable List UI
Allows a float property to be changed in Appfigurate by allowing the user to select from a predefined list of valid choices. The user can customize the list adding by additional values using a text field between minimum and maximum values, and an optional regular expression validating input.
Swift prototype
@FloatPropertyListEdit(min, max, regex, description, restart, values)
var propertyName: Float
If restart is true, then the app will be restarted if the property value changes.
If restart is true, then the app will be restarted if the property value changes.
Java example
import nz.co.electricbolt.appfiguratelibrary.Configuration;
import nz.co.electricbolt.appfiguratelibrary.annotations.FloatPropertyListEdit;
public class AppConfiguration extends Configuration {
@FloatPropertyListEdit(description = "Forward server time (days)", minValue = 0.0f, maxValue = 366.0f, regularExpression = "^(0?[0-9]?[0-9]|[1-2][0-9][0-9]|3[0-5][0-9]|36[0-5])$", keys = {"7 days", "1 month", "1 Year"}, values = {7.0f, 30.0f, 365.0f}, restart = false)
public float forwardServerTime;
@Override
public void reset() {
super.reset();
this.forwardServerTime = 7.0f;
}
...
Dart prototype
double get propertyName => nativeDouble('propertyName');
Dart example
import 'package:appfigurateflutter/appfigurateflutter.dart';
public class Configuration extends APLNativeConfiguration {
double get forwardServerTime => nativeDouble('forwardServerTime');
...
JavaScript example
import {
NativeModules,
} from 'react-native';
const {Appfigurate} = NativeModules;
...
let forwardServerTime = await Appfigurate.nativeValue("forwardServerTime"); // Number
The React Native module AppfigurateModule class defers to the underlying platform (iOS) or (Android) subclass to read property values.
React Native always converts the underlying Float to a JavaScript Number - you should be aware of .
You can customize the minimum and maximum images using the parameter. If restart is true, then the app will be restarted if the property value changes.
You can customize the minimum and maximum images using the parameter. If restart is true, then the app will be restarted if the property value changes.