Erro ao Compilar Aplicação: Método 'Sliderbutton' não encontrado

Custom Code

Olá, comunidade!

Estou enfrentando um problema ao tentar compilar minha aplicação no FlutterFlow. Recebo os seguintes erros:

87 packages have newer versions incompatible with dependency constraints. Try flutter pub outdated for more information. Launching lib/main.dart on Web Server in debug mode... Waiting for connection from debug service on Web Server... lib/teste/teste_widget.dart:213:41: Error: Method not found: 'Sliderbutton'. child: custom_widgets.Sliderbutton( ^^^^^^^^^^^^ Waiting for connection from debug service on Web Server... 51.0s Failed to compile application.

Código do Widget:

// Automatic FlutterFlow imports

import '/backend/backend.dart';

import '/backend/schema/structs/index.dart';

import '/backend/schema/enums/enums.dart';

import '/flutter_flow/flutter_flow_theme.dart';

import '/flutter_flow/flutter_flow_util.dart';

import '/custom_code/widgets/index.dart'; // Imports other custom widgets

import '/flutter_flow/custom_functions.dart'; // Imports custom functions

import 'package:flutter/material.dart';

// Begin custom widget code

// DO NOT REMOVE OR MODIFY THE CODE ABOVE!

// DO NOT REMOVE OR MODIFY THE CODE ABOVE

class CustomSliderButton extends StatefulWidget {

const CustomSliderButton({

Key? key,

this.width,

this.height,

required this.sliderText,

required this.icon,

required this.btnColor,

required this.backgroundColor,

required this.onSlideAction,

}) : super(key: key);

final double? width;

final double? height;

final String sliderText;

final Widget icon;

final Color btnColor;

final Color backgroundColor;

final Future<dynamic> Function() onSlideAction;

@override

CustomSliderButtonState createState() => CustomSliderButtonState();

}

class _CustomSliderButtonState extends State<CustomSliderButton> {

double _sliderValue = 0.0;

void _onSliderChange(double value) {

setState(() {

_sliderValue = value;

});

// Trigger the slide action when the slider is at its maximum value

if (value >= 1.0) {

widget.onSlideAction(); // Chama a função de ação passada

setState(() {

_sliderValue = 0.0; // Reset slider after action

});

}

}

@override

Widget build(BuildContext context) {

return Column(

children: [

Slider(

value: _sliderValue,

min: 0,

max: 1,

divisions: 100,

label: (100 * _sliderValue).round().toString() + '%',

onChanged: _onSliderChange,

activeColor: widget.btnColor,

inactiveColor: widget.backgroundColor,

),

SizedBox(height: 10),

Text(

widget.sliderText,

style: FlutterFlowTheme.of(context).bodyText1.override(

fontFamily: 'Poppins',

color: Color(0xff4a4a4a),

fontWeight: FontWeight.w500,

fontSize: 17,

),

),

SizedBox(height: 10),

widget.icon,

],

);

}

}

Se alguém puder me ajudar a resolver esse erro ou me orientar sobre como verificar a compatibilidade de pacotes, eu ficaria muito agradecido!

What have you tried so far?
  • Verifiquei se o pacote slider_button estava corretamente importado, mas ao tentar usar um widget customizado, recebo o erro de que o método não foi encontrado.

  • Analisei as dependências do projeto para incompatibilidades e fiz o possível para atualizá-las.

  • Testei diferentes abordagens no código do widget, mas o problema persiste.

Did you check FlutterFlow's Documentation for this topic?
Yes