Skip to content

fix(snackbar): preserve default borderWidth in Get.snackbar - #3466

Open
Sami0402 wants to merge 1 commit into
jonataslaw:masterfrom
Sami0402:fix-snackbar-borderwidth
Open

Sami0402 wants to merge 1 commit into
jonataslaw:masterfrom
Sami0402:fix-snackbar-borderwidth

Conversation

@Sami0402

Copy link
Copy Markdown

Description

This fixes a crash that occurs when Get.snackbar is called with borderColor but without borderWidth.

Reproduction

Get.snackbar(
  "Title",
  "Message",
  borderColor: Colors.grey,
);

Current behavior

A Null check operator used on a null value exception is thrown because Get.snackbar forwards a nullable borderWidth to GetSnackBar, overriding its constructor default (1.0).

Fix

Preserve the default borderWidth by forwarding borderWidth ?? 1.0 from the Get.snackbar wrapper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant