Posts

Showing posts from November, 2022

Unlocking the Power of OOP: A Beginner's Guide to Objects, Encapsulation, Inheritance, Abstraction, and Polymorphism

Image
 OOPs (Object-Oriented Programming System) This article explains the fundamental concepts of OOP and its most significant advantages What is OOPs (Object Oriented Programming System)? Object-oriented programming System (OOPs) is defined as a programming paradigm (and not a specific language) built on the concept of objects, i.e., a set of data contained in fields, and code, indicating procedures – instead of the usual logic-based system. Key Concepts of OOP To understand and use object-oriented programming, it is necessary to know the following key concepts : 1. Class A class is a blueprint or template of an object. It is a user-defined data type. We define variables, constants, member functions, and other functionality inside a class. it binds data and functions together in a single unit. It does not consume memory at run time. Note that classes are not considered as a data structure. It is a logical entity. It is the best example of data binding. Note that a class can exist without a

Search ListView In flutter

  Hello friends, today we will teach you how to search in list and listview. Array List List<Invoices> historyList = [] ; if (response.statusCode == 200 ) { var responseData = json.decode(response.body) ; var orderHistory = responseData[ 'invoices' ] ; for ( var coinJSON in orderHistory) { historyList .add(Invoices.fromJson(coinJSON)) ; items .add(Invoices.fromJson(coinJSON)) ; } print( '----------------> ${ historyList . length } ' ) ; print(responseData) ; setState(() {}) ; } var items = <Invoices>[] ; void filterSearchResults(String query) { List<Invoices> dummySearchList = <Invoices>[] ; dummySearchList.addAll(historyList) ; if (query.isNotEmpty) { List<Invoices> dummyListData = <Invoices>[] ; dummySearchList.forEach((item) { if (item.swiggyOrderId!.contains(query)) { dummyListData.add(item) ; print( "yes" ) ; } }) ; setState(() { items.clea

Google Authentication in flutter (firebase)

Image
                  In this article, I will show how to set up a  Flutter app  and implement  Google Sign-In  using  Firebase authentication . Come, today we learn to sign in from Google, so first of all we have complete setup of Firebase, read from there in the blog . After that enable google authentication in firebase console After this, the library has to be imported in your project dependencies : flutter : sdk : flutter # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons : ^1.0.2 firebase_auth : ^4.1.2 firebase_core : ^2.2.0 google_sign_in : ^5.4.2 flutter_signin_button : ^2.0.0 Do all this code in your main file import 'package:firebase_auth/firebase_auth.dart' ; import 'package:firebase_core/firebase_core.dart' ; import 'package:flutter/material.dart' ; import 'package:flutter_signin_button/button_list.dart' ; import 'package:flutter_signin