← back to donspeedie__realdeal

Function bodies 338 total

All specs Real LLM only Function bodies
FlutterFlowModel class · dart · L37-L93 (57 LOC)
app/lib/flutter_flow/flutter_flow_model.dart
abstract class FlutterFlowModel<W extends Widget> {
  // Initialization methods
  bool _isInitialized = false;
  void initState(BuildContext context);
  void _init(BuildContext context) {
    if (!_isInitialized) {
      initState(context);
      _isInitialized = true;
    }
    if (context.widget is W) _widget = context.widget as W;
    _context = context;
  }

  // The widget associated with this model. This is useful for accessing the
  // parameters of the widget, for example.
  W? _widget;
  W? get widget => _widget;
  void set widget(W? newWidget) {
    _widget = newWidget;
  }

  // The context associated with this model.
  BuildContext? _context;
  BuildContext? get context => _context;

  // Dispose methods
  // Whether to dispose this model when the corresponding widget is
  // disposed. By default this is true for pages and false for components,
  // as page/component models handle the disposal of their children.
  bool disposeOnWidgetDisposal = true;
  void dispose();
  voi
FlutterFlowDynamicModels class · dart · L95-L155 (61 LOC)
app/lib/flutter_flow/flutter_flow_model.dart
class FlutterFlowDynamicModels<T extends FlutterFlowModel> {
  FlutterFlowDynamicModels(this.defaultBuilder);

  final T Function() defaultBuilder;
  final Map<String, T> _childrenModels = {};
  final Map<String, int> _childrenIndexes = {};
  Set<String>? _activeKeys;

  T getModel(String uniqueKey, int index) {
    _updateActiveKeys(uniqueKey);
    _childrenIndexes[uniqueKey] = index;
    return _childrenModels[uniqueKey] ??= defaultBuilder();
  }

  List<S> getValues<S>(S? Function(T) getValue) {
    return _childrenIndexes.entries
        // Sort keys by index.
        .sorted((a, b) => a.value.compareTo(b.value))
        .where((e) => _childrenModels[e.key] != null)
        // Map each model to the desired value and return as list. In order
        // to preserve index order, rather than removing null values we provide
        // default values (for types with reasonable defaults).
        .map((e) => getValue(_childrenModels[e.key]!) ?? _getDefaultValue<S>()!)
        .toList();
 
FlutterFlowTheme class · dart · L12-L124 (113 LOC)
app/lib/flutter_flow/flutter_flow_theme.dart
abstract class FlutterFlowTheme {
  static DeviceSize deviceSize = DeviceSize.mobile;

  static FlutterFlowTheme of(BuildContext context) {
    deviceSize = getDeviceSize(context);
    return LightModeTheme();
  }

  @Deprecated('Use primary instead')
  Color get primaryColor => primary;
  @Deprecated('Use secondary instead')
  Color get secondaryColor => secondary;
  @Deprecated('Use tertiary instead')
  Color get tertiaryColor => tertiary;

  late Color primary;
  late Color secondary;
  late Color tertiary;
  late Color alternate;
  late Color primaryText;
  late Color secondaryText;
  late Color primaryBackground;
  late Color secondaryBackground;
  late Color accent1;
  late Color accent2;
  late Color accent3;
  late Color accent4;
  late Color success;
  late Color warning;
  late Color error;
  late Color info;

  @Deprecated('Use displaySmallFamily instead')
  String get title1Family => displaySmallFamily;
  @Deprecated('Use displaySmall instead')
  TextStyle get title1 => typ
LightModeTheme class · dart · L137-L161 (25 LOC)
app/lib/flutter_flow/flutter_flow_theme.dart
class LightModeTheme extends FlutterFlowTheme {
  @Deprecated('Use primary instead')
  Color get primaryColor => primary;
  @Deprecated('Use secondary instead')
  Color get secondaryColor => secondary;
  @Deprecated('Use tertiary instead')
  Color get tertiaryColor => tertiary;

  late Color primary = const Color(0xFF007FFF);
  late Color secondary = const Color(0xFF1D4F7D);
  late Color tertiary = const Color(0xFFACC420);
  late Color alternate = const Color(0xFFE0E3E7);
  late Color primaryText = const Color(0xFF161C24);
  late Color secondaryText = const Color(0xFF636F81);
  late Color primaryBackground = const Color(0xFFF0F5F9);
  late Color secondaryBackground = const Color(0xFFFFFFFF);
  late Color accent1 = const Color(0x4C007FFF);
  late Color accent2 = const Color(0x4C0B67BC);
  late Color accent3 = const Color(0x4DACC420);
  late Color accent4 = const Color(0xFFEEEEEE);
  late Color success = const Color(0xFF27AE52);
  late Color warning = const Color(0xFFFC964D);
  late Colo
Typography class · dart · L163-L209 (47 LOC)
app/lib/flutter_flow/flutter_flow_theme.dart
abstract class Typography {
  String get displayLargeFamily;
  bool get displayLargeIsCustom;
  TextStyle get displayLarge;
  String get displayMediumFamily;
  bool get displayMediumIsCustom;
  TextStyle get displayMedium;
  String get displaySmallFamily;
  bool get displaySmallIsCustom;
  TextStyle get displaySmall;
  String get headlineLargeFamily;
  bool get headlineLargeIsCustom;
  TextStyle get headlineLarge;
  String get headlineMediumFamily;
  bool get headlineMediumIsCustom;
  TextStyle get headlineMedium;
  String get headlineSmallFamily;
  bool get headlineSmallIsCustom;
  TextStyle get headlineSmall;
  String get titleLargeFamily;
  bool get titleLargeIsCustom;
  TextStyle get titleLarge;
  String get titleMediumFamily;
  bool get titleMediumIsCustom;
  TextStyle get titleMedium;
  String get titleSmallFamily;
  bool get titleSmallIsCustom;
  TextStyle get titleSmall;
  String get labelLargeFamily;
  bool get labelLargeIsCustom;
  TextStyle get labelLarge;
  String get label
MobileTypography class · dart · L211-L322 (112 LOC)
app/lib/flutter_flow/flutter_flow_theme.dart
class MobileTypography extends Typography {
  MobileTypography(this.theme);

  final FlutterFlowTheme theme;

  String get displayLargeFamily => 'Inter';
  bool get displayLargeIsCustom => false;
  TextStyle get displayLarge => GoogleFonts.inter(
        color: theme.primaryText,
        fontWeight: FontWeight.normal,
        fontSize: 57.0,
      );
  String get displayMediumFamily => 'Inter';
  bool get displayMediumIsCustom => false;
  TextStyle get displayMedium => GoogleFonts.inter(
        color: theme.primaryText,
        fontWeight: FontWeight.normal,
        fontSize: 45.0,
      );
  String get displaySmallFamily => 'Inter';
  bool get displaySmallIsCustom => false;
  TextStyle get displaySmall => GoogleFonts.inter(
        color: theme.primaryText,
        fontWeight: FontWeight.w600,
        fontSize: 36.0,
      );
  String get headlineLargeFamily => 'Inter';
  bool get headlineLargeIsCustom => false;
  TextStyle get headlineLarge => GoogleFonts.inter(
        color: theme
TabletTypography class · dart · L324-L435 (112 LOC)
app/lib/flutter_flow/flutter_flow_theme.dart
class TabletTypography extends Typography {
  TabletTypography(this.theme);

  final FlutterFlowTheme theme;

  String get displayLargeFamily => 'Roboto';
  bool get displayLargeIsCustom => false;
  TextStyle get displayLarge => GoogleFonts.roboto(
        color: theme.primaryText,
        fontWeight: FontWeight.normal,
        fontSize: 57.0,
      );
  String get displayMediumFamily => 'Inter';
  bool get displayMediumIsCustom => false;
  TextStyle get displayMedium => GoogleFonts.inter(
        color: theme.primaryText,
        fontWeight: FontWeight.normal,
        fontSize: 45.0,
      );
  String get displaySmallFamily => 'Inter';
  bool get displaySmallIsCustom => false;
  TextStyle get displaySmall => GoogleFonts.inter(
        color: theme.primaryText,
        fontWeight: FontWeight.w600,
        fontSize: 36.0,
      );
  String get headlineLargeFamily => 'Inter';
  bool get headlineLargeIsCustom => false;
  TextStyle get headlineLarge => GoogleFonts.inter(
        color: the
Repobility · code-quality intelligence platform · https://repobility.com
DesktopTypography class · dart · L437-L548 (112 LOC)
app/lib/flutter_flow/flutter_flow_theme.dart
class DesktopTypography extends Typography {
  DesktopTypography(this.theme);

  final FlutterFlowTheme theme;

  String get displayLargeFamily => 'Inter';
  bool get displayLargeIsCustom => false;
  TextStyle get displayLarge => GoogleFonts.inter(
        color: theme.primaryText,
        fontWeight: FontWeight.normal,
        fontSize: 57.0,
      );
  String get displayMediumFamily => 'Inter';
  bool get displayMediumIsCustom => false;
  TextStyle get displayMedium => GoogleFonts.inter(
        color: theme.primaryText,
        fontWeight: FontWeight.normal,
        fontSize: 45.0,
      );
  String get displaySmallFamily => 'Inter';
  bool get displaySmallIsCustom => false;
  TextStyle get displaySmall => GoogleFonts.inter(
        color: theme.primaryText,
        fontWeight: FontWeight.w600,
        fontSize: 36.0,
      );
  String get headlineLargeFamily => 'Inter';
  bool get headlineLargeIsCustom => false;
  TextStyle get headlineLarge => GoogleFonts.inter(
        color: the
ToggleIcon class · dart · L3-L46 (44 LOC)
app/lib/flutter_flow/flutter_flow_toggle_icon.dart
class ToggleIcon extends StatelessWidget {
  const ToggleIcon({
    super.key,
    required this.value,
    required this.onPressed,
    required this.onIcon,
    required this.offIcon,
    this.focusBorderSide,
    this.focusBorderRadius,
  });

  final bool value;
  final Function() onPressed;
  final Widget onIcon;
  final Widget offIcon;
  final BorderSide? focusBorderSide;
  final BorderRadius? focusBorderRadius;

  @override
  Widget build(BuildContext context) => Theme(
        data: ThemeData.from(
          colorScheme: Theme.of(context).colorScheme,
          useMaterial3: true,
        ),
        child: IconButton(
          onPressed: onPressed,
          icon: value ? onIcon : offIcon,
          style: ButtonStyle(
            backgroundColor: WidgetStateProperty.all(Colors.transparent),
            shape: WidgetStateProperty.resolveWith<OutlinedBorder>((states) {
              if (states.contains(WidgetState.focused)) {
                return RoundedRectangleBorder(
     
FFButtonOptions class · dart · L5-L55 (51 LOC)
app/lib/flutter_flow/flutter_flow_widgets.dart
class FFButtonOptions {
  const FFButtonOptions({
    this.textAlign,
    this.textStyle,
    this.elevation,
    this.height,
    this.width,
    this.padding,
    this.color,
    this.disabledColor,
    this.disabledTextColor,
    this.splashColor,
    this.iconSize,
    this.iconColor,
    this.iconAlignment,
    this.iconPadding,
    this.borderRadius,
    this.borderSide,
    this.hoverColor,
    this.hoverBorderSide,
    this.hoverTextColor,
    this.hoverElevation,
    this.maxLines,
    this.focusBorderSide,
    this.focusBorderRadius,
  });

  final TextAlign? textAlign;
  final TextStyle? textStyle;
  final double? elevation;
  final double? height;
  final double? width;
  final EdgeInsetsGeometry? padding;
  final Color? color;
  final Color? disabledColor;
  final Color? disabledTextColor;
  final int? maxLines;
  final Color? splashColor;
  final double? iconSize;
  final Color? iconColor;
  final IconAlignment? iconAlignment;
  final EdgeInsetsGeometry? iconPadding;
  fi
FFButtonWidget class · dart · L57-L77 (21 LOC)
app/lib/flutter_flow/flutter_flow_widgets.dart
class FFButtonWidget extends StatefulWidget {
  const FFButtonWidget({
    super.key,
    required this.text,
    required this.onPressed,
    this.icon,
    this.iconData,
    required this.options,
    this.showLoadingIndicator = true,
  });

  final String text;
  final Widget? icon;
  final IconData? iconData;
  final Function()? onPressed;
  final FFButtonOptions options;
  final bool showLoadingIndicator;

  @override
  State<FFButtonWidget> createState() => _FFButtonWidgetState();
}
_FFButtonWidgetState class · dart · L79-L264 (186 LOC)
app/lib/flutter_flow/flutter_flow_widgets.dart
class _FFButtonWidgetState extends State<FFButtonWidget> {
  bool loading = false;

  int get maxLines => widget.options.maxLines ?? 1;
  String? get text =>
      widget.options.textStyle?.fontSize == 0 ? null : widget.text;

  @override
  Widget build(BuildContext context) {
    Widget textWidget = loading
        ? SizedBox(
            width: widget.options.width == null
                ? _getTextWidth(text, widget.options.textStyle, maxLines)
                : null,
            child: Center(
              child: SizedBox(
                width: 23,
                height: 23,
                child: CircularProgressIndicator(
                  valueColor: AlwaysStoppedAnimation<Color>(
                    widget.options.textStyle?.color ?? Colors.white,
                  ),
                ),
              ),
            ),
          )
        : AutoSizeText(
            text ?? '',
            style:
                text == null ? null : widget.options.textStyle?.withoutColor(),
FFFocusIndicator class · dart · L310-L332 (23 LOC)
app/lib/flutter_flow/flutter_flow_widgets.dart
class FFFocusIndicator extends StatefulWidget {
  final Widget child;
  final Border? border;
  final BorderRadius? borderRadius;
  final EdgeInsetsGeometry? padding;
  final void Function()? onTap;
  final void Function()? onLongPress;
  final void Function()? onDoubleTap;

  const FFFocusIndicator({
    Key? key,
    required this.child,
    this.border,
    this.borderRadius,
    this.padding,
    this.onTap,
    this.onLongPress,
    this.onDoubleTap,
  }) : super(key: key);

  @override
  State<FFFocusIndicator> createState() => _FFFocusIndicatorState();
}
_FFFocusIndicatorState class · dart · L334-L381 (48 LOC)
app/lib/flutter_flow/flutter_flow_widgets.dart
class _FFFocusIndicatorState extends State<FFFocusIndicator> {
  late FocusNode _focusNode;
  bool _hasFocus = false;

  @override
  void initState() {
    super.initState();
    _focusNode = FocusNode();
    _focusNode.addListener(_onFocusChange);
  }

  @override
  void dispose() {
    _focusNode.removeListener(_onFocusChange);
    _focusNode.dispose();
    super.dispose();
  }

  void _onFocusChange() {
    if (mounted) {
      setState(() {
        _hasFocus = _focusNode.hasFocus;
      });
    }
  }

  @override
  Widget build(BuildContext context) {
    return AnimatedContainer(
      duration: const Duration(milliseconds: 200),
      padding: widget.padding,
      decoration: BoxDecoration(
        border: _hasFocus ? widget.border : null,
        borderRadius: widget.borderRadius ?? BorderRadius.circular(4),
      ),
      child: InkWell(
        splashColor: Colors.transparent,
        hoverColor: Colors.transparent,
        highlightColor: Colors.transparent,
        focusNod
FormFieldController class · dart · L3-L10 (8 LOC)
app/lib/flutter_flow/form_field_controller.dart
class FormFieldController<T> extends ValueNotifier<T?> {
  FormFieldController(this.initialValue) : super(initialValue);

  final T? initialValue;

  void reset() => value = initialValue;
  void update() => notifyListeners();
}
Repobility's GitHub App fixes findings like these · https://github.com/apps/repobility-bot
FormListFieldController class · dart · L15-L23 (9 LOC)
app/lib/flutter_flow/form_field_controller.dart
class FormListFieldController<T> extends FormFieldController<List<T>> {
  final List<T>? _initialListValue;

  FormListFieldController(super.initialValue)
      : _initialListValue = List<T>.from(initialValue ?? []);

  @override
  void reset() => value = List<T>.from(_initialListValue ?? []);
}
KeepAliveWidgetWrapper class · dart · L3-L13 (11 LOC)
app/lib/flutter_flow/keep_alive_wrapper.dart
class KeepAliveWidgetWrapper extends StatefulWidget {
  const KeepAliveWidgetWrapper({
    Key? key,
    required this.builder,
  }) : super(key: key);

  final WidgetBuilder builder;

  @override
  State<KeepAliveWidgetWrapper> createState() => _KeepAliveWidgetWrapperState();
}
LatLng class · dart · L1-L19 (19 LOC)
app/lib/flutter_flow/lat_lng.dart
class LatLng {
  const LatLng(this.latitude, this.longitude);
  final double latitude;
  final double longitude;

  @override
  String toString() => 'LatLng(lat: $latitude, lng: $longitude)';

  String serialize() => '$latitude,$longitude';

  @override
  int get hashCode => latitude.hashCode + longitude.hashCode;

  @override
  bool operator ==(other) =>
      other is LatLng &&
      latitude == other.latitude &&
      longitude == other.longitude;
}
AppStateNotifier class · dart · L22-L73 (52 LOC)
app/lib/flutter_flow/nav/nav.dart
class AppStateNotifier extends ChangeNotifier {
  AppStateNotifier._();

  static AppStateNotifier? _instance;
  static AppStateNotifier get instance => _instance ??= AppStateNotifier._();

  BaseAuthUser? initialUser;
  BaseAuthUser? user;
  bool showSplashImage = true;
  String? _redirectLocation;

  /// Determines whether the app will refresh and build again when a sign
  /// in or sign out happens. This is useful when the app is launched or
  /// on an unexpected logout. However, this must be turned off when we
  /// intend to sign in/out and then navigate or perform any actions after.
  /// Otherwise, this will trigger a refresh and interrupt the action(s).
  bool notifyOnAuthChange = true;

  bool get loading => showSplashImage;
  bool get loggedIn => user?.loggedIn ?? false;
  bool get initiallyLoggedIn => initialUser?.loggedIn ?? false;
  bool get shouldRedirect => loggedIn && _redirectLocation != null;

  String getRedirectLocation() => _redirectLocation!;
  bool hasRedirect()
FFParameters class · dart · L190-L248 (59 LOC)
app/lib/flutter_flow/nav/nav.dart
class FFParameters {
  FFParameters(this.state, [this.asyncParams = const {}]);

  final GoRouterState state;
  final Map<String, Future<dynamic> Function(String)> asyncParams;

  Map<String, dynamic> futureParamValues = {};

  // Parameters are empty if the params map is empty or if the only parameter
  // present is the special extra parameter reserved for the transition info.
  bool get isEmpty =>
      state.allParams.isEmpty ||
      (state.allParams.length == 1 &&
          state.extraMap.containsKey(kTransitionInfoKey));
  bool isAsyncParam(MapEntry<String, dynamic> param) =>
      asyncParams.containsKey(param.key) && param.value is String;
  bool get hasFutures => state.allParams.entries.any(isAsyncParam);
  Future<bool> completeFutures() => Future.wait(
        state.allParams.entries.where(isAsyncParam).map(
          (param) async {
            final doc = await asyncParams[param.key]!(param.value)
                .onError((_, __) => null);
            if (doc != null) {
  
FFRoute class · dart · L250-L331 (82 LOC)
app/lib/flutter_flow/nav/nav.dart
class FFRoute {
  const FFRoute({
    required this.name,
    required this.path,
    required this.builder,
    this.requireAuth = false,
    this.asyncParams = const {},
    this.routes = const [],
  });

  final String name;
  final String path;
  final bool requireAuth;
  final Map<String, Future<dynamic> Function(String)> asyncParams;
  final Widget Function(BuildContext, FFParameters) builder;
  final List<GoRoute> routes;

  GoRoute toRoute(AppStateNotifier appStateNotifier) => GoRoute(
        name: name,
        path: path,
        redirect: (context, state) {
          if (appStateNotifier.shouldRedirect) {
            final redirectLocation = appStateNotifier.getRedirectLocation();
            appStateNotifier.clearRedirectLocation();
            return redirectLocation;
          }

          if (requireAuth && !appStateNotifier.loggedIn) {
            appStateNotifier.setRedirectLocationIfUnset(state.uri.toString());
            return '/searchPpty';
          }
          
TransitionInfo class · dart · L333-L347 (15 LOC)
app/lib/flutter_flow/nav/nav.dart
class TransitionInfo {
  const TransitionInfo({
    required this.hasTransition,
    this.transitionType = PageTransitionType.fade,
    this.duration = const Duration(milliseconds: 300),
    this.alignment,
  });

  final bool hasTransition;
  final PageTransitionType transitionType;
  final Duration duration;
  final Alignment? alignment;

  static TransitionInfo appDefault() => TransitionInfo(hasTransition: false);
}
RootPageContext class · dart · L349-L367 (19 LOC)
app/lib/flutter_flow/nav/nav.dart
class RootPageContext {
  const RootPageContext(this.isRootPage, [this.errorRoute]);
  final bool isRootPage;
  final String? errorRoute;

  static bool isInactiveRootPage(BuildContext context) {
    final rootPageContext = context.read<RootPageContext?>();
    final isRootPage = rootPageContext?.isRootPage ?? false;
    final location = GoRouterState.of(context).uri.toString();
    return isRootPage &&
        location != '/' &&
        location != rootPageContext?.errorRoute;
  }

  static Widget wrap(Widget child, {String? errorRoute}) => Provider.value(
        value: RootPageContext(true, errorRoute),
        child: child,
      );
}
Same scanner, your repo: https://repobility.com — Repobility
FFPlace class · dart · L3-L46 (44 LOC)
app/lib/flutter_flow/place.dart
class FFPlace {
  const FFPlace({
    this.latLng = const LatLng(0.0, 0.0),
    this.name = '',
    this.address = '',
    this.city = '',
    this.state = '',
    this.country = '',
    this.zipCode = '',
  });

  final LatLng latLng;
  final String name;
  final String address;
  final String city;
  final String state;
  final String country;
  final String zipCode;

  @override
  String toString() => '''FFPlace(
        latLng: $latLng,
        name: $name,
        address: $address,
        city: $city,
        state: $state,
        country: $country,
        zipCode: $zipCode,
      )''';

  @override
  int get hashCode => latLng.hashCode;

  @override
  bool operator ==(other) =>
      other is FFPlace &&
      latLng == other.latLng &&
      name == other.name &&
      address == other.address &&
      city == other.city &&
      state == other.state &&
      country == other.country &&
      zipCode == other.zipCode;
}
FFUploadedFile class · dart · L4-L68 (65 LOC)
app/lib/flutter_flow/uploaded_file.dart
class FFUploadedFile {
  const FFUploadedFile({
    this.name,
    this.bytes,
    this.height,
    this.width,
    this.blurHash,
  });

  final String? name;
  final Uint8List? bytes;
  final double? height;
  final double? width;
  final String? blurHash;

  @override
  String toString() =>
      'FFUploadedFile(name: $name, bytes: ${bytes?.length ?? 0}, height: $height, width: $width, blurHash: $blurHash,)';

  String serialize() => jsonEncode(
        {
          'name': name,
          'bytes': bytes,
          'height': height,
          'width': width,
          'blurHash': blurHash,
        },
      );

  static FFUploadedFile deserialize(String val) {
    final serializedData = jsonDecode(val) as Map<String, dynamic>;
    final data = {
      'name': serializedData['name'] ?? '',
      'bytes': serializedData['bytes'] ?? Uint8List.fromList([]),
      'height': serializedData['height'],
      'width': serializedData['width'],
      'blurHash': serializedData['blurHash'],
    }
MyApp class · dart · L32-L39 (8 LOC)
app/lib/main.dart
class MyApp extends StatefulWidget {
  // This widget is the root of your application.
  @override
  State<MyApp> createState() => _MyAppState();

  static _MyAppState of(BuildContext context) =>
      context.findAncestorStateOfType<_MyAppState>()!;
}
MyAppScrollBehavior class · dart · L41-L47 (7 LOC)
app/lib/main.dart
class MyAppScrollBehavior extends MaterialScrollBehavior {
  @override
  Set<PointerDeviceKind> get dragDevices => {
        PointerDeviceKind.touch,
        PointerDeviceKind.mouse,
      };
}
_MyAppState class · dart · L49-L119 (71 LOC)
app/lib/main.dart
class _MyAppState extends State<MyApp> {
  ThemeMode _themeMode = ThemeMode.system;

  late AppStateNotifier _appStateNotifier;
  late GoRouter _router;
  String getRoute([RouteMatch? routeMatch]) {
    final RouteMatch lastMatch =
        routeMatch ?? _router.routerDelegate.currentConfiguration.last;
    final RouteMatchList matchList = lastMatch is ImperativeRouteMatch
        ? lastMatch.matches
        : _router.routerDelegate.currentConfiguration;
    return matchList.uri.toString();
  }

  List<String> getRouteStack() =>
      _router.routerDelegate.currentConfiguration.matches
          .map((e) => getRoute(e))
          .toList();
  late Stream<BaseAuthUser> userStream;

  final authUserSub = authenticatedUserStream.listen((_) {});

  @override
  void initState() {
    super.initState();

    _appStateNotifier = AppStateNotifier.instance;
    _router = createRouter(_appStateNotifier);
    userStream = habuFirebaseUserStream()
      ..listen((user) {
        _appStateNotifier.u
OnPaymentSuccessModel class · dart · L6-L12 (7 LOC)
app/lib/on_payment_success/on_payment_success_model.dart
class OnPaymentSuccessModel extends FlutterFlowModel<OnPaymentSuccessWidget> {
  @override
  void initState(BuildContext context) {}

  @override
  void dispose() {}
}
OnPaymentSuccessWidget class · dart · L10-L25 (16 LOC)
app/lib/on_payment_success/on_payment_success_widget.dart
class OnPaymentSuccessWidget extends StatefulWidget {
  const OnPaymentSuccessWidget({
    super.key,
    required this.coins,
    required this.checkoutId,
  });

  final int? coins;
  final String? checkoutId;

  static String routeName = 'OnPaymentSuccess';
  static String routePath = '/onPaymentSuccess';

  @override
  State<OnPaymentSuccessWidget> createState() => _OnPaymentSuccessWidgetState();
}
_OnPaymentSuccessWidgetState class · dart · L27-L129 (103 LOC)
app/lib/on_payment_success/on_payment_success_widget.dart
class _OnPaymentSuccessWidgetState extends State<OnPaymentSuccessWidget> {
  late OnPaymentSuccessModel _model;

  final scaffoldKey = GlobalKey<ScaffoldState>();

  @override
  void initState() {
    super.initState();
    _model = createModel(context, () => OnPaymentSuccessModel());

    logFirebaseEvent('screen_view',
        parameters: {'screen_name': 'OnPaymentSuccess'});
    // On page load action.
    SchedulerBinding.instance.addPostFrameCallback((_) async {
      logFirebaseEvent('ON_PAYMENT_SUCCESS_OnPaymentSuccess_ON_I');
      logFirebaseEvent('OnPaymentSuccess_wait__delay');
      await Future.delayed(
        Duration(
          milliseconds: 3000,
        ),
      );
      logFirebaseEvent('OnPaymentSuccess_navigate_to');

      context.pushNamed(SearchWidget.routeName);
    });

    WidgetsBinding.instance.addPostFrameCallback((_) => safeSetState(() {}));
  }

  @override
  void dispose() {
    _model.dispose();

    super.dispose();
  }

  @override
  Widget build(Bui
All rows scored by the Repobility analyzer (https://repobility.com)
createStripeAPIsGroup function · javascript · L6-L15 (10 LOC)
functions/api_manager.js
function createStripeAPIsGroup() {
  const stripeKey = process.env.STRIPE_SECRET_KEY;
  if (!stripeKey) {
    throw new Error('STRIPE_SECRET_KEY environment variable is required');
  }
  return {
    baseUrl: `https://api.stripe.com/v1`,
    headers: {"Authorization": `Bearer ${stripeKey}`,"Content-Type": `application/x-www-form-urlencoded`,},
  };
}
_listAllProductsCall function · javascript · L17-L37 (21 LOC)
functions/api_manager.js
async function _listAllProductsCall(context, ffVariables) {
  if (!context.auth) {
    return _unauthenticatedResponse;
  }

  const stripeAPIsGroup = createStripeAPIsGroup()

  var url = `${stripeAPIsGroup.baseUrl}/products`;
  var headers = stripeAPIsGroup.headers;
  var params = {};
  var ffApiRequestBody = undefined;

  return makeApiRequest({
    method: "get",
    url,
    headers,
    params,
    returnBody: true,
    isStreamingApi: false,
  });
}
_getPriceCall function · javascript · L39-L59 (21 LOC)
functions/api_manager.js
async function _getPriceCall(context, ffVariables) {
  if (!context.auth) {
    return _unauthenticatedResponse;
  }
  var priceId = ffVariables["priceId"];
  const stripeAPIsGroup = createStripeAPIsGroup()

  var url = `${stripeAPIsGroup.baseUrl}/prices/${priceId}`;
  var headers = stripeAPIsGroup.headers;
  var params = {};
  var ffApiRequestBody = undefined;

  return makeApiRequest({
    method: "post",
    url,
    headers,
    params,
    returnBody: true,
    isStreamingApi: false,
  });
}
_createCheckoutSessionCall function · javascript · L61-L85 (25 LOC)
functions/api_manager.js
async function _createCheckoutSessionCall(context, ffVariables) {
  if (!context.auth) {
    return _unauthenticatedResponse;
  }
  var successUrl = ffVariables["successUrl"];
  var lineItems0PriceId = ffVariables["lineItems0PriceId"];
  var lineItems0Quantity = ffVariables["lineItems0Quantity"];
  var customer = ffVariables["customer"];
  var token = ffVariables["token"];
  const stripeAPIsGroup = createStripeAPIsGroup()

  var url = `${stripeAPIsGroup.baseUrl}/checkout/sessions`;
  var headers = stripeAPIsGroup.headers;
  var params = {'success_url': successUrl,'line_items[0][price]': lineItems0PriceId,'line_items[0][quantity]': lineItems0Quantity,'mode': `payment`,'customer': customer,'metadata[token]': token,};
  var ffApiRequestBody = undefined;

  return makeApiRequest({
    method: "post",
    url,
    headers,
    body: createBody({ headers, params, body: ffApiRequestBody, bodyType: "X_WWW_FORM_URL_ENCODED" }),
    returnBody: true,
    isStreamingApi: false,
  });
}
_getCheckoutSessionCall function · javascript · L87-L107 (21 LOC)
functions/api_manager.js
async function _getCheckoutSessionCall(context, ffVariables) {
  if (!context.auth) {
    return _unauthenticatedResponse;
  }

  const stripeAPIsGroup = createStripeAPIsGroup()

  var url = `${stripeAPIsGroup.baseUrl}/checkout/sessions`;
  var headers = stripeAPIsGroup.headers;
  var params = {};
  var ffApiRequestBody = undefined;

  return makeApiRequest({
    method: "get",
    url,
    headers,
    params,
    returnBody: true,
    isStreamingApi: false,
  });
}
_createCustomerCall function · javascript · L109-L129 (21 LOC)
functions/api_manager.js
async function _createCustomerCall(context, ffVariables) {
  if (!context.auth) {
    return _unauthenticatedResponse;
  }
  var email = ffVariables["email"];
  const stripeAPIsGroup = createStripeAPIsGroup()

  var url = `${stripeAPIsGroup.baseUrl}/customers`;
  var headers = stripeAPIsGroup.headers;
  var params = {'email': email,};
  var ffApiRequestBody = undefined;

  return makeApiRequest({
    method: "post",
    url,
    headers,
    body: createBody({ headers, params, body: ffApiRequestBody, bodyType: "X_WWW_FORM_URL_ENCODED" }),
    returnBody: true,
    isStreamingApi: false,
  });
}
makeApiCall function · javascript · L138-L160 (23 LOC)
functions/api_manager.js
async function makeApiCall(context, data) {
  var callName = data["callName"] || "";
  var variables = data["variables"] || {};

  const callMap = {
    "ListAllProductsCall": _listAllProductsCall,
    "GetPriceCall": _getPriceCall,
    "CreateCheckoutSessionCall": _createCheckoutSessionCall,
    "GetCheckoutSessionCall": _getCheckoutSessionCall,
    "CreateCustomerCall": _createCustomerCall,
  };

  if (!(callName in callMap)) {
    return {
      statusCode: 400,
      error: `API Call "${callName}" not defined as private API.`,
    };
  }

  var apiCall = callMap[callName];
  var response = await apiCall(context, variables);
  return response;
}
makeApiRequest function · javascript · L162-L196 (35 LOC)
functions/api_manager.js
async function makeApiRequest({
  method,
  url,
  headers,
  params,
  body,
  returnBody,
  isStreamingApi,
}) {
  return axios
    .request({
      method: method,
      url: url,
      headers: headers,
      params: params,
      responseType: (isStreamingApi ? 'stream' : 'json'),
      ...(body && { data: body }),
    })
    .then((response) => {
      return {
        statusCode: response.status,
        headers: response.headers,
        ...(returnBody && { body: response.data }),
        isStreamingApi: isStreamingApi,
      };
    })
    .catch(function (error) {
      return {
        statusCode: error.response.status,
        headers: error.response.headers,
        ...(returnBody && { body: error.response.data }),
        error: error.message,
      };
    });
}
Repobility · code-quality intelligence platform · https://repobility.com
createBody function · javascript · L204-L216 (13 LOC)
functions/api_manager.js
function createBody({ headers, params, body, bodyType }) {
  switch (bodyType) {
    case "JSON":
      headers["Content-Type"] = "application/json";
      return body;
    case "TEXT":
      headers["Content-Type"] = "text/plain";
      return body;
    case "X_WWW_FORM_URL_ENCODED":
      headers["Content-Type"] = "application/x-www-form-urlencoded";
      return qs.stringify(params);
  }
}
escapeStringForJson function · javascript · L217-L226 (10 LOC)
functions/api_manager.js
function escapeStringForJson(val) {
  if (typeof val !== "string") {
    return val;
  }
  return val
    .replace(/[\\]/g, '\\\\')
    .replace(/["]/g, '\\"')
    .replace(/[\n]/g, '\\n')
    .replace(/[\t]/g, '\\t');
}
getCachedOrFetch function · javascript · L8-L36 (29 LOC)
functions/cacheUtils.js
async function getCachedOrFetch(collection, docId, fetchFunc) {
  const docRef = db.collection(collection).doc(docId);
  const docSnap = await docRef.get();

  if (docSnap.exists) {
    const {cacheData, createdAt} = docSnap.data();
    if (createdAt && createdAt.toMillis && (Date.now() - createdAt.toMillis() < CACHE_EXPIRY_MS)) {
      // Cache is still fresh
      return cacheData;
    }
    // Cache expired, fall through to fetch new data
  }

  // Fetch from API if not cached or expired
  const result = await fetchFunc();

  // Firestore cannot store undefined, functions, non-plain objects, etc.
  const cacheData = typeof result === "object" && result !== null && !Array.isArray(result) ?
    JSON.parse(JSON.stringify(result)) : // removes non-serializable values
    result;

  // Cache result with a new timestamp
  await docRef.set({
    cacheData,
    createdAt: admin.firestore.FieldValue.serverTimestamp(),
  });

  return result;
}
createTestEntry function · javascript · L5-L42 (38 LOC)
functions/create_test_entry.js
async function createTestEntry() {
  try {
    console.log('🧪 Creating test entry in HubSpot...\n');

    const testData = {
      email: '[email protected]',
      firstName: 'Testy',
      lastName: 'McTesterson',
      phone: '+1-555-TEST-123',
      address: '123 Test Street, Los Angeles, CA 90001',
      method: 'Fix&Flip'
    };

    console.log('📋 Test data:');
    console.log(JSON.stringify(testData, null, 2));
    console.log();

    const result = await trackPropertyCalculation(testData);

    console.log('\n✅ Test entry created successfully!\n');
    console.log('📊 Results:');
    console.log('├─ Contact ID:', result.contact.id);
    console.log('├─ Contact Email:', result.contact.properties.email);
    console.log('├─ Contact Name:',
      `${result.contact.properties.firstname || 'N/A'} ${result.contact.properties.lastname || 'N/A'}`);
    console.log('└─ Note ID:', result.note.id);
    console.log();
    console.log('🎉 Check your HubSpot portal at:');
    console.log(`   
tierScore function · javascript · L98-L110 (13 LOC)
functions/dealScoringEngine.js
function tierScore(value, tiers, lowerIsBetter = true) {
  if (lowerIsBetter) {
    for (const [threshold, score] of tiers) {
      if (value < threshold) return score;
    }
    return tiers[tiers.length - 1][1];
  } else {
    for (const [threshold, score] of tiers) {
      if (value >= threshold) return score;
    }
    return tiers[tiers.length - 1][1];
  }
}
classifyPattern function · javascript · L117-L137 (21 LOC)
functions/dealScoringEngine.js
function classifyPattern(deal) {
  const constructionRatio = deal.acquisitionCost > 0
    ? deal.constructionCost / deal.acquisitionCost
    : 0;

  let winnerSignals = 0;
  let loserSignals = 0;

  if (deal.acquisitionCost < 300000) winnerSignals++;
  else if (deal.acquisitionCost > 380000) loserSignals++;

  if (constructionRatio > 0.50) winnerSignals++;
  else if (constructionRatio < 0.25) loserSignals++;

  if (deal.constructionCost > 100000) winnerSignals++;
  else if (deal.constructionCost < 75000) loserSignals++;

  if (winnerSignals >= 2 && loserSignals === 0) return "WINNER_PATTERN";
  if (loserSignals >= 2 && winnerSignals === 0) return "LOSER_PATTERN";
  return "MIXED";
}
scoreDeal function · javascript · L155-L282 (128 LOC)
functions/dealScoringEngine.js
function scoreDeal(deal, bias = null) {
  const b = bias || DEFAULT_BIAS;
  const durationMonths = deal.durationMonths || 6;
  const marketSignal = deal.marketSignal || "yellow";
  const monthlyHoldingCost = deal.monthlyHoldingCost || 2500;
  const sellingCostsPct = deal.sellingCostsPct || 0.08;

  // Bias-adjusted values
  const adjConstruction = deal.constructionCost * (1 + b.constructionContingency);
  const arvHaircut = {
    green: b.arvHaircutGreen,
    yellow: b.arvHaircutYellow,
    red: b.arvHaircutRed,
  }[marketSignal] || b.arvHaircutYellow;
  const adjArv = deal.arv * (1 - arvHaircut);
  const adjDuration = durationMonths * (1 + b.timelineBuffer);
  const adjHolding = monthlyHoldingCost * (adjDuration + b.holdingCostExtraMonths);

  // Conservative (bias-adjusted) financials
  const sellingCostsAdj = adjArv * sellingCostsPct;
  const totalCostAdj = deal.acquisitionCost + adjConstruction + adjHolding + sellingCostsAdj;
  const projectedProfitAdj = adjArv - totalCostAdj;
  co
mapStrategyResultToDeal function · javascript · L292-L306 (15 LOC)
functions/dealScoringEngine.js
function mapStrategyResultToDeal(prop, result, marketSignal = "yellow") {
  return {
    name: prop.address || prop.zpid || "Unknown",
    acquisitionCost: prop.price || 0,
    constructionCost: result.impValue || 0,
    arv: result.futureValue || 0,
    cashRequired: result.cashNeeded || 0,
    durationMonths: result.duration || 6,
    marketSignal: marketSignal,
    monthlyHoldingCost: result.monthlyPayment || 2500,
    sellingCostsPct: result.futureValue > 0
      ? (result.sellingCosts || 0) / result.futureValue
      : 0.08,
  };
}
Repobility's GitHub App fixes findings like these · https://github.com/apps/repobility-bot
analyzeARVDiscrepancy function · javascript · L4-L86 (83 LOC)
functions/demo/analyze-arv-discrepancy.js
function analyzeARVDiscrepancy() {
  console.log("📊 FROM SCREENSHOT:");
  console.log("After Repair Value (ARV): $588,821");
  console.log("Average $/Comp: $461,245");
  console.log("Discrepancy: $127,576 (27.7% higher)");
  console.log();

  console.log("🔍 POSSIBLE CAUSES OF HIGHER ARV:");
  console.log("━".repeat(50));

  console.log("\n1️⃣ IMPROVEMENT FACTOR APPLIED:");
  console.log("• Fix & Flip uses 1.03 improvement factor (3% premium)");
  console.log("• Formula: ARV = Living Area × Price Per SqFt × 1.03");
  console.log("• This adds a renovation premium above raw comps");

  console.log("\n2️⃣ PRICE PER SQFT vs TOTAL PRICE:");
  console.log("• ARV uses: Price Per SqFt × Subject Property Size");
  console.log("• Comps average: Total comp prices (different sizes)");
  console.log("• If subject is LARGER than average comp, ARV will be higher");

  console.log("\n3️⃣ WEIGHTED CALCULATION:");
  console.log("• Price per sqft is weighted by similarity to subject");
  console.log("• Mo
demonstrateCompsProcess function · javascript · L4-L118 (115 LOC)
functions/demo/demo-comps-analysis.js
function demonstrateCompsProcess() {
  console.log("📍 STEP 1: LOCATION-BASED COMP SEARCH");
  console.log("━".repeat(50));
  console.log("• Extract ZIP CODE from subject property address");
  console.log("• Search Redfin for recently SOLD properties in same ZIP");
  console.log("• No specific date filter (gets 'recent' sales from Redfin)");
  console.log("• Example: '123 Main St, Sacramento, CA 95835' → Search ZIP 95835");

  console.log("\n📊 STEP 2: DATA QUALITY FILTERING");
  console.log("━".repeat(50));
  console.log("Filters applied to raw comp data:");
  console.log("✓ Has valid price (> $0)");
  console.log("✓ Has valid square footage (> $0)");
  console.log("✓ Price per sqft: $50 - $1,000 (removes outliers)");
  console.log("✓ Size: 400 - 8,000 sqft (realistic range)");
  console.log("✓ Price: $50k - $5M (market reasonable)");
  console.log("✓ Bedrooms: 1 - 10 (valid bedroom count)");

  console.log("\n🎯 STEP 3: STATISTICAL OUTLIER DETECTION");
  console.log("━".repeat(50));
  c
demonstrateFixFlipValuation function · javascript · L6-L95 (90 LOC)
functions/demo/demo-fixflip-valuation.js
function demonstrateFixFlipValuation() {
  console.log("📋 FIX & FLIP VALUATION METHOD:");
  console.log("Formula: Future Value = Living Area × Price Per SqFt × Improvement Factor");
  console.log("Where Improvement Factor = 1.05 (5% improvement premium)\n");

  // Example 1: From Screenshot #3
  console.log("🏠 EXAMPLE 1 - Sacramento Property:");
  const example1 = {
    livingArea: 1522,          // sqft
    pricePerSqFt: 269,        // $/sqft from comps
    impFactor: 1.05           // 5% improvement factor
  };

  const futureValue1 = Math.round(example1.livingArea * example1.pricePerSqFt * example1.impFactor);

  console.log(`Living Area: ${example1.livingArea.toLocaleString()} sqft`);
  console.log(`Market Price/SqFt: $${example1.pricePerSqFt}/sqft`);
  console.log(`Improvement Factor: ${example1.impFactor} (5% premium)`);
  console.log(`\nCalculation:`);
  console.log(`${example1.livingArea.toLocaleString()} × $${example1.pricePerSqFt} × ${example1.impFactor} = $${futureValue1.toL
‹ prevpage 4 / 7next ›