Skip to main content

Posts

  Flutter FutureBuilder Widget - API call using FutureBuilder | Flutter Tutorial Video Tutorial : https://youtu.be/2XCM878cZJc Source Code: import 'dart:convert' ; import 'package:flutter/material.dart' ; import 'package:http/http.dart' as http; void main () {   runApp ( const MyApp ()); } class MyApp extends StatefulWidget {   const MyApp ({ Key ? key }) : super ( key : key );   @ override   State < MyApp > createState () => _MyAppState (); } class _MyAppState extends State < MyApp > {   Future < int > getData () async {     final data = await http. get ( Uri . parse (         "http://www.randomnumberapi.com/api/v1.0/random?min=100&max=1000&count=1" ));     final body = json. decode (data.body);     int number = (body as List ).first;     return number;   }   @ override   Widget build ( BuildContext context ) {     return MaterialApp (       debugShowCheckedModeBanner : false ,       home :
Recent posts

Matplotlib Basic Functions

 Learn Some Basic Functions of Matplotlib Importing the packages: import matplotlib.pyplot as plt import numpy as np Plotting the points: x = np. array ([ 20 , 60 ]) y = np. array ([ 30 , 32 ]) print (x) plt. plot (x,y) Scatter Points: #plot 1 x = [ 1 , 2 , 3 , 4 , 5 ] y = [ 2 , 5 , 7 , 8 , 9 ] plt. scatter (x,y) #plot 2 x = [ 1 , 5 , 3 , 8 , 5 ] y = [ 2 , 3 , 7 , 6 , 9 ] plt. scatter (x,y) Bar Function: class1 = [ " a " , " b " , " c " , " d " ] x = [ 3 , 5 , 10 , 8 ] Pie Chart: values = [ 15 , 25 , 30 , 30 ] plt. pie (values)

Request Storage Permission in Flutter

 How to Request Storage Permission in Flutter Storage permission is needed when we want the user's device to access the media or files and to perform required actions or work efficiently. In Flutter we can implement this using Storage Permission and asking user to enable the storage permission at run time. Flutter Packages required is: Permission Handler You can find these packages on pub.dev site.  Source Code: import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:permission_handler/permission_handler.dart'; void main() => runApp(MyApp()); class MyApp extends StatefulWidget {   @override   _MyAppState createState() => _MyAppState(); } class _MyAppState extends State<MyApp> {   Future<int> storagePermissionChecker;   Future<int> checkStoragePermission() async {     final result = await PermissionHandler()         .checkPermissionStatus(PermissionGroup.storage);     setState(() {});     if (re

How to Request Location permission in Flutter | Latest Version | Android Location Enable 2022

How to Request Location permission in Flutter | Latest Version | Android Location Enable 2022 Location permission is needed when we want our device to fetch the location of user's device to know the location and perform the required actions or work efficiently. In Flutter we can implement this using Location Permission and asking user to enable the location permission at run time. Flutter Packages required are: 1. Geolocator 2. Geocoding You can find these packages on pub.dev site.  Source code: import 'package:flutter/material.dart'; import 'package:geolocator/geolocator.dart'; import 'package:geocoding/geocoding.dart'; void main() {   runApp(MyApp()); } class MyApp extends StatefulWidget {   @override   _MyAppState createState() => _MyAppState(); } class _MyAppState extends State<MyApp> {   final geolocator =       Geolocator.getCurrentPosition(forceAndroidLocationManager: true);   Position _currentPosition;   String currentAddress = "";

3D Printing Technology Nowadays

More durable prosthetics and medical devices for patients and stronger parts for airplanes and automobiles are just some of the products that could be created through a new 3D printing technology invented by a UMass Lowell researcher. Substances such as plastics, metals and wax are used in 3D printers to make products and parts for larger items, as the practice has disrupted the prototyping and manufacturing fields. Products created through the 3D printing of plastics include everything from toys to drones. While the global market for 3D plastics printers is estimated at $4 billion and growing, challenges remain in ensuring the printers create objects that are produced quickly, retain their strength and accurately reflect the shape desired, according to UMass Lowell's David Kazmer, a plastics engineering professor who led the research project. Called injection printing, the technology Kazmer pioneered is featured in the academic journal Additive Manufacturing posted online la

Should You Cancel Your Credit Card After You Pay it Off?

Are you Cancelling your credit card...? Would it be a good option to cancel credit card after paying it off ? CNN an American news-based pay television channel  underscored reviews financial products such as credit cards and bank accounts based on their overall value. With the Covid-19 pandemic still wreaking havoc on the nation’s Financial economy, many people are making the wise decision to reduce their household expenses. Credit card annual fees are an obvious place to look at for cuts, especially if you have one or more expensive premium cards with travel perks that you can’t currently utilize. But hold on! Closing your credit card to avoid an annual fee is a little like deciding to reduce your manicure costs by cutting off your fingers. There are many less drastic measures you can take in order to reduce how much you’re paying for your cards. “Keeping a credit card open, even if you don’t use it, helps build credit,” explained Jill Gonzalez, an analyst at the personal fi