diff --git a/test/material_async_button_theme_test.dart b/test/material_async_button_theme_test.dart index 036b383..5f2b08a 100644 --- a/test/material_async_button_theme_test.dart +++ b/test/material_async_button_theme_test.dart @@ -114,5 +114,16 @@ void main() { check(a).equals(b); check(a.hashCode).equals(b.hashCode); }); + + test('empty leaves every field at its default', () { + // `empty` is itself `const AsyncButtonTheme()`, so the equality below is + // satisfied by const canonicalization alone. The field checks are what + // actually pin the invariant: `empty` must never grow a set field. + // ignore: use_named_constants + const b = AsyncButtonTheme(); + check(AsyncButtonTheme.empty).equals(b); + check(AsyncButtonTheme.empty.loadingBuilder).isNull(); + check(AsyncButtonTheme.empty.transitionBuilder).isNull(); + }); }); }