Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when tapping on the attachment button. #1615

Closed
1 task done
duc-ios opened this issue Jun 16, 2023 · 4 comments · Fixed by #1618
Closed
1 task done

Crash when tapping on the attachment button. #1615

duc-ios opened this issue Jun 16, 2023 · 4 comments · Fixed by #1618
Labels
bug Something isn't working

Comments

@duc-ios
Copy link

duc-ios commented Jun 16, 2023

Which packages are you using?

stream_chat_flutter

On what platforms did you experience the issue?

iOS

What version are you using?

stream_chat_flutter - 6.3.0

What happened?

Crash when tapping on the attachment button.

Steps to reproduce

1. Open the example app in stream_chat_flutter folder
2. Open lib/main.dart
3. Wrap the MaterialApp with another MaterialApp
4. Run the app
5. Navigate into any chat
6. Tap the attachment button
7. App crashes

Supporting info to reproduce

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: MaterialApp(
        debugShowCheckedModeBanner: false,
        theme: ThemeData.light(),
        darkTheme: ThemeData.dark(),
        // themeMode: ThemeMode.dark,
        supportedLocales: const [
          Locale('en'),
          Locale('hi'),
          Locale('fr'),
          Locale('it'),
          Locale('es'),
        ],
        localizationsDelegates: GlobalStreamChatLocalizations.delegates,
        builder: (context, widget) => StreamChat(
          client: client,
          child: widget,
        ),
        home: StreamChannel(
          channel: channel,
          child: const ResponsiveChat(),
        ),
      ),
    );
  }

Relevant log output

════════ Exception caught by widgets library ═══════════════════════════════════
You must have a StreamChatTheme widget at the top of your widget tree
'package:stream_chat_flutter/src/theme/stream_chat_theme.dart':
stream_chat_theme.dart:1
Failed assertion: line 27 pos 7: 'streamChatTheme != null'

Flutter analyze output

No response

Flutter doctor output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@duc-ios duc-ios added the bug Something isn't working label Jun 16, 2023
@xsahil03x
Copy link
Contributor

Duplicate of #1429.

Hey @duc-ios, any particular reason you are using two MaterialApp ?

@duc-ios
Copy link
Author

duc-ios commented Jun 16, 2023

@xsahil03x I have a big main app with multiple modules which are also flutter projects from different developers. StreamChat is just a module in that app.

@xsahil03x
Copy link
Contributor

I am not able to reproduce the issue with the code sample you provided, can you also share the structure you have at your end?

@duc-ios
Copy link
Author

duc-ios commented Jun 16, 2023

image @xsahil03x please check the attached screenshot for the modification I made.

App structure:
Main App

  • routes:
    • Chat App
    • Support App
    • Feed App
    • ...

Each route is a sub flutter project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants