ionicfirebaseapp / getwidget

Most popular and easy to use open source UI library with 1000+ Widgets to build flutter app.
https://www.getwidget.dev
MIT License
4.52k stars 602 forks source link

GFSocialButton: Unable to load asset: "icons/facebook.png". #313

Closed lukehutch closed 1 year ago

lukehutch commented 1 year ago

Describe the bug

The following code

class SignInPage extends StatelessWidget {
  const SignInPage({super.key});

  @override
  Widget build(BuildContext context) {
    return SafeArea(
        child: Container(
      padding: const EdgeInsets.all(25.0),
      child: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        crossAxisAlignment: CrossAxisAlignment.center,
        children: [
          GFSocialButton(
            type: GFSocialType.facebook,
            buttonType: GFSocialButtonType.solid,
            onPressed: () {
              signInWithFacebook();
            },
          ),
          GFSocialButton(
            type: GFSocialType.google,
            buttonType: GFSocialButtonType.solid,
            onPressed: () {
              signInWithGoogle();
            },
          ),
        ],
      ),
    ));
  }
}

produces the following error:

Restarted application in 990ms.

════════ Exception caught by image resource service ════════════════════════════
The following assertion was thrown resolving an image codec:
Unable to load asset: "icons/facebook.png".

Exception: Asset not found
When the exception was thrown, this was the stack
#0      PlatformAssetBundle.loadBuffer
#1      AssetBundleImageProvider._loadAsync
#2      AssetBundleImageProvider.loadBuffer
#3      ImageProvider.resolveStreamForKey.<anonymous closure>
#4      ImageCache.putIfAbsent
#5      ImageProvider.resolveStreamForKey
#6      ScrollAwareImageProvider.resolveStreamForKey
#7      ImageProvider.resolve.<anonymous closure>
#8      ImageProvider._createErrorHandlerAndKey.<anonymous closure>
<asynchronous suspension>
Image provider: AssetImage(bundle: null, name: "icons/facebook.png")
Image key: AssetBundleImageKey(bundle: PlatformAssetBundle#fc06d(), name: "icons/facebook.png", scale: 1.0)
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by image resource service ════════════════════════════
Unable to load asset: "icons/google.png".
════════════════════════════════════════════════════════════════════════════════
D/EGL_emulation( 6586): app_time_stats: avg=631.67ms min=13.07ms max=33210.80ms count=54

To Reproduce Steps to reproduce the behavior: Try the code above.

Desktop (please complete the following information):

kcibdev commented 1 year ago

Am currently having this issue right now Have you fixed it

lukehutch commented 1 year ago

I just switched to using a different plugin (sign_button) for generating social login buttons.

gantanikhilraj commented 1 year ago

is it fixed? if not can assign to me

atul-vashisht commented 1 year ago

@gantanikhilraj our team is fixing it.

chafzaalahmad commented 1 year ago

I found solution which work for me

Step 1: Create "icons" directory in the root folder and Add required icons to "icons" directory

Step 2: Update pubspec.yaml file assets section

assets:

atul-vashisht commented 1 year ago

Hi, we have fixed this issue, we have merged the changes for now you can use this package like below until we update the version number.

image
gsmcdonald commented 1 year ago

Is the issue with icons not loading in the docs related to this?