Search code examples
flutterflutter-getx

You need to either use message[String], or messageText[Widget] or define a userInputForm[Form] in GetSnackbar


I am new to flutter and Getx. Stood before a problem, googled it and looked for reference in youtube too but couldn't find appropriate answer.

Here is the detailed error message

It's a runtime error.

Hoping someone has the answer. Thank you!


Solution

  • When you use a Get.snackbar() you have to declare two String values..

    The First one is the "Title", and the second one is the "Message".

    I will put an example for that, and wish that help you.

    Get.snackbar(
            'Alert!!',
            'You have to fill all fields',
            snackPosition: SnackPosition.BOTTOM,
            duration: const Duration(seconds: 2),
            borderRadius: 13,
            backgroundColor: Colors.greenAccent,
          );