Posts

Working with Geolocation in Flutter

GEO LOCATION EXAMPLE GPS(Global Positioning System) has become a standard feature on modern smartphones. It's usually used by applications to get the device location. This blog shows you how to access device location in Flutter using GPS, including how to get permissions, get current location and continuous location update. Dependencies dependencies{            geolocator: ^3.0.1 } A Flutter package  geolocator  provides geolocation functionalities. Add it in your  pubspec.yaml  file and run Get Packages. Permissions You need to add permissions to each platform. For Android, you need   ACCESS_COARSE_LOCATION. Add the following in  AndroidManifest.xml . < uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> For iOS, you need  NSLocationWhenInUseUsageDescription  permission. Add it in the  Info.plist  file. <key>NSLocationWhenInUseUsageDescription</key> Code We need to create an instance of  Geoloca

Fetch data from the Soap Webservice

Fetch data from the Soap Webservice F etching data from the Web service is necessary for most apps. Thankfully, Dart and Flutter provide tools, such as the  http  package, for this type of work Add the Packages   as a dependency and make necessary imports respectively dependencies : flutter : sdk : flutter cupertino_icons : ^0.1.2 http : xml : html_unescape : Run  flutter packages get  to download the package  2.  Add import statements to import necessary packages in your dart file. import 'package:flutter/material.dart' ; import 'package:flutter/services.dart' ; import 'package:http/http.dart' as http; import 'dart:convert' ; import 'package:async/async.dart' ; import 'package:xml/xml.dart' as xml; 3. Make a network request Put this function in your dart file  Future<int> _isGetdata(String number, String Number) async { String url = "url/method_name?Parameter1= "1" &Paramet

Create splash screen in Flutter

Create splash screen in Flutter   I mport the  image file  We need to import the image files into the project. It is common practice to put image files in a  images  or  assets  folder at the root of a Flutter project. Declare the Image in the  pubspec.yaml pubspec.yaml - flutter: uses-material-design: true assets: - images/flutterwithlogo.png main.dart File import 'package:flutter/material.dart' ; import 'package:flutter/services.dart' ; import 'SplashPage.dart' ; import 'HomePage.dart' ; void main() => runApp( MyApp ()); class MyApp extends StatelessWidget { // This widget is the root of your application. @override Widget build(BuildContext context) { // Fixing App Orientation. SystemChrome. setPreferredOrientations ( [DeviceOrientation. portraitUp , DeviceOrientation. portraitDown ]); return new MaterialApp ( debugShowCheckedModeBanner: false , title: 'Flutter De

An Introduction to Flutter: The Basics

Image
An Introduction to Flutter: The Basics Welcome to my first tutorial on Flutter. I have never written any post on cross-platform or hybrid app framework but Flutter has changed my mindset. I’ve been hearing about how amazing Flutter is and I’ve decided to try it out to learn something new.  It started by watching, then reading, and then I started coding. It was a good experience. Apps were running, and everything that was written wasn’t hard to understand. I decided that reading the documentation on Dart, Flutter and all of its widgets wouldn’t be a good idea as it would be too time consuming. Also, I didn’t have a lot of time as the purpose was to get to know the new thing, and not to become an expert in the field. I thought at that moment that it would be amazing if there was a short guide on Flutter, that would describe all the necessary concepts to understand the framework and be able to write simple apps, but no more! Now I just started  I’ll keep it short, to save your tim