aloisdeniel / flutter_device_preview

Approximate how your app looks and performs on another device.
https://aloisdeniel.github.io/flutter_device_preview/
MIT License
2.21k stars 343 forks source link

DevicePreview Not Showing When Firebase is Initialized #253

Open redz09123 opened 1 month ago

redz09123 commented 1 month ago

I'm experiencing an issue with the device_preview package in my Flutter application. Whenever I include Firebase in my main.dart, the DevicePreview simulator does not show up. However, when I remove the Firebase initialization, the DevicePreview works as expected.

void main() async { WidgetsFlutterBinding.ensureInitialized(); await Firebase.initializeApp(); runApp( DevicePreview( enabled: !kReleaseMode, builder: (context) => const MonitoringApp(), // Wrap your app ), ); }

Steps to Reproduce:

Add Firebase initialization in the main() method as shown in the code snippet. Run the app. Observe that the DevicePreview simulator does not appear. Remove the Firebase initialization. Run the app again and observe that the DevicePreview simulator shows up. Expected Behavior: The DevicePreview simulator should display regardless of whether Firebase is initialized.

Environment:

Flutter : 3.24.3 Dart 3.5.3 Device Preview version: 1.2.0 Firebase 3.3.0 Additional Information: Please let me know if you need further details to help investigate this issue. Screenshot_21