Skip to main content

Posts

Flutter refresh my screen while some value change in my model

 Problem: Flutter refresh my screen while some value change in my model or in my data.How to achieve that. Solution: In your widget add the below code. Widget build ( BuildContext context ) { return ChangeNotifierProvider ( create : ( _ ) => model , child : Scaffold ( body : Consumer < ViewModel >( builder : ( context , viewModel , child ) { In your viewmodel after change the data call this notifyListeners ();
Recent posts

Flutter common font file for my entire app

Problem:  I want to create one class file that would be useful for text style for my entire app.How to achieve that? Solution: First you have to create a class file that will be as like below. I had used the roboto font to my app.If you pass the color variable with data then it will show with that color. Otherwise it will show default white color. In largeBold i had used font to be roboto bold. class AppFonts { static TextStyle large ({ Color ? color }) { return TextStyle ( fontSize : Constants . largeFont , fontFamily : 'Roboto' , color : color ?? Colors . white , ); } static TextStyle largeBold ({ Color ? color }) { return TextStyle ( fontSize : Constants . largeFont , fontFamily : 'Roboto' , fontWeight : FontWeight . bold , color : color ?? Colors . white , ); } }

FlutterLoader.loadEntrypoint is deprecated. Use "FlutterLoader.load" instead. While run flutter for chrome

 Problem: "FlutterLoader.loadEntrypoint" is deprecated. Use "FlutterLoader.load" instead. The above error will show while run my flutter app in chrome. Solution: The error because entry point is not set in your flutter app. < script > window . addEventListener ( 'load' , function ( ev ) { // Download main.dart.js _flutter . loader . loadEntrypoint ({ serviceWorker : { serviceWorkerVersion : serviceWorkerVersion , }, Then replace with below code it will works. window . addEventListener ( 'load' , function ( ev ) { // Download main.dart.js _flutter . loader . load ({ serviceWorker : { serviceWorkerVersion : serviceWorkerVersion , },

Local variable for "serviceWorkerVersion" is deprecated in flutter

Problem:  Local variable for "serviceWorkerVersion" is deprecated. Use "{{flutter_service_worker_ version}}" template token instead. See  https://docs.flutter.dev/ platform-integration/web/ initialization  for more details. While try to run my flutter app in chrome it shows the above error. Solution: In script file it shows as like below < script > // The value below is injected by flutter build, do not touch. var serviceWorkerVersion = null ; </ script > Replace with below.It will works fine. < script > // The value below is injected by flutter build, do not touch. var serviceWorkerVersion = "{{flutter_service_worker_ version}}" ; </ script >

Print the file in chrome in android devices || Save the page as pdf in android devices

 Solution: If you are using android devices and opened one file from web and want to save in your device then follow the below steps. 1.In chrome app click the 3dots in top right corner 2.It shows one dropdown with share option also then select that 3.It will show popover below the screen with recent apps and drag the window from right to left.In the end it will show print option.Click that and it will open your default file manager with save as pdf option.Save the file wherever you want.Enjoy...

Share movies android phone to android phone without shareit app

 Solution: Use NearByshare app in your android phone to share movies.It will be share data within few mins. Steps: 1.Select the file to share  2.Goto share options and select nearby share -> open Nearbyshare in other phone -> tap the displayed user in the app.It will send quickly compare to share it. 3.If Nearby share not shown then goto top menu edit option add Nearbyshare and send it..