Creating Snackbar Using GetX Library

Issue

I try to use getX to make a snackbar, but it doesn’t work.

import 'package:get/get.dart';

onPressed: () {
  Get.snackbar(
    "GeeksforGeeks",
    "Hello everyone",
    icon: Icon(Icons.person, color: Colors.white),
    snackPosition: SnackPosition.TOP,
  );
},

This is my first expirience with this package.

Solution

Use GetMaterialApp instead of MaterialApp.

Answered By – Hazar Belge

Answer Checked By – Katrina (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *