Codelessly / ResponsiveFramework

Easily make Flutter apps responsive. Automatically adapt UI to different screen sizes. Responsiveness made simple. Demo: https://gallery.codelessly.com/flutterwebsites/minimal/
https://codelessly.com
MIT License
1.28k stars 151 forks source link

Code structuring with Provider and GetIt packages #106

Closed remsysinc closed 1 year ago

remsysinc commented 2 years ago

Love the idea of this package! Coming from a Bootstrap environment on web to mobile, this concept is very appealing.

I'm using the Provider and GetIt packages and am having trouble configuring the main.dart code structure to integrate this package. My code is as follows and I'd like to see an example of how you'd add your package. I feel this inquiry could help a lot of people as Provider and GetIt seem to be extremely popular:

// This widget is the root of your application. // Where/how to inject/add the ResponsiveFramework? @override Widget build(BuildContext context) { return MultiProvider( providers: [ ChangeNotifierProvider(create: () => LoginViewModel()), ChangeNotifierProvider(create: () => HomeViewModel()), ChangeNotifierProvider(create: () => TestViewModel()), StreamProvider( initialData: InternetConnectionStatus.connected, create: () => InternetConnectionChecker().onStatusChange), ], builder: (context, child) { return GetMaterialApp( theme: ThemeData( brightness: Brightness.light, primaryColor: Colors.purple[800], secondaryHeaderColor: Colors.cyan[600], fontFamily: 'Verdana', textTheme: const TextTheme( headline1: TextStyle(fontSize: 50, fontWeight: FontWeight.bold), headline6: TextStyle(fontSize: 30.0, fontStyle: FontStyle.italic), bodyText2: TextStyle(fontSize: 18.0, fontFamily: 'Hind'), ), ), debugShowCheckedModeBanner: false, title: "My App", home: WelcomeView(), ); }, ); }

Any assistance is greatly appreciated! Thank you.

gOzaru commented 2 years ago

Dude, you should check on the closed issue here, before creating a new issue. It answered your question.