Posts

Showing posts from October, 2020

Flutter - Connectivity

Hey guys,  Have a good day. It's my 100th post. Hope I'll post more good contents in future.  Today we going to see the flutter connectivity. In mobile platform, internet connectivity is major role. Most of developers check and validate the internet all time.  In flutter, use connectivity library to achieve it. Use provider for more efficient. In pubspec.yaml connectivity: ^2.0.0 provider: ^4.3.2+2 For check the internet and attempt tasks, Create the class somewhere, write this method. Future<bool> check() async {    var connectivityResult = await (Connectivity().checkConnectivity());     if (connectivityResult == ConnectivityResult.mobile) {       return true;     } else if (connectivityResult == ConnectivityResult.wifi) {       return true;     }     return false; } ConnectivityService().check().then((value) {       if (value != null && value) {         // do task        } else {         // show the error message, internet not connected.      }     }); For bro

NewsApp Using MVVM and Provider

Hey guys, Have a good day. Still COVID-19 damage the world so rigorously. I hope it's end soon. We all pray for that. Today we going to see the NewsApp using the MVVM architecture and provider. First of all, If you're beginner or new to programming, don't panic. Get into the process. Most of peoples got panic initially and leave it.  I create the news application in flutter using MVVM architecture and Provider. It may be useful to understand how MVVM looks and how provider works.  So Kindly look up it and give your feedback. Click to view NewsApp . Please signup into news api  and get your api key. Save Trees, Save Nature