Skip to content

Instantly share code, notes, and snippets.

View AyeshaIftikhar's full-sized avatar
🎯
Focusing

Ayesha Iftikhar AyeshaIftikhar

🎯
Focusing
View GitHub Profile
@AyeshaIftikhar
AyeshaIftikhar / main.dart
Created January 5, 2023 05:38
exquisite-osmium-3856
main() {
print('First Date: ${findFirstDateOfTheWeek(DateTime.now())}');
print('Last Date: ${findLastDateOfTheWeek(DateTime.now())}');
print('First Date of Previous Week: ${findFirstDateOfPreviousWeek(DateTime.now())}');
}
/// Current Week
DateTime findFirstDateOfTheWeek(DateTime dateTime) {
return dateTime.subtract(Duration(days: dateTime.weekday - 1));
@AyeshaIftikhar
AyeshaIftikhar / CustomTextWidget.md
Created September 12, 2021 15:51
Reusable Text Widget in Flutter

Text Widget

class CustomText extends StatelessWidget {
  const CustomText({
    Key? key,
    required this.text,
    this.size = 14,
 this.font = 'Poppins',
@AyeshaIftikhar
AyeshaIftikhar / LoadingDialog.md
Last active September 12, 2021 15:52
Loading Dialog in Flutter

Loading Dialog

To show the user that application is working or not stuff at a particular functionality.

loadingDialog(BuildContext context, {required String text}) {
  return showDialog(
    context: context,
    barrierDismissible: false,
 builder: (context) {
@AyeshaIftikhar
AyeshaIftikhar / basics.md
Last active June 25, 2021 11:56
Implementing REST API's in Flutter

Accessing/Implementing REST API's

Fetching data from the internet is necessary for most apps. Luckily, Dart and Flutter provide tools, such as the http package, for this type of work. http is a Future-based library and uses await and async features. It provides many high level methods and simplifies the development of REST based mobile applications.

Basic Concepts

https provides a high level class and http to do web requests.

  • http class provides functionality to perform all types of HTTP requests.
  • http methods accept a url, and additional information through Dart Map (post data, additional headers, etc.,). It requests the server and collects the response back in async/await pattern. For example, the below code reads the data from the specified url and print it in the console.

Some core methods are:

@AyeshaIftikhar
AyeshaIftikhar / basics.md
Last active June 25, 2021 09:03
Object Oriented Programming(OOP) Concepts

Object Oriented Programming (OOP)

OOP usually combines a group of properties (variables) and methods (functions) into a single unit known as Object which are organized

into class where each individual object can be combined together as a group.

There are four main pillars of OOP as follows:

  • Encapsulation
  • Inheritance
  • Abstraction
  • Polymorphism
@AyeshaIftikhar
AyeshaIftikhar / SQL.md
Created June 24, 2021 08:21
Basic concepts of SQL (Structured Query Language)

Getting Started with SQL

What is SQL?

  • SQL stands for Structured Query Language
  • It is a database query language designed to retrieve and manage data in relational database.
  • SQL is a language to operate databases; it includes database creation, deletion, fetching rows, modifying rows, etc.
  • SQL is an ANSI (American National Standards Institute) standard language.
  • There are many different versions of the SQL language.

Why SQL

  • Computer Language used for sorting, manipulating and retireving data from relational databases.
@AyeshaIftikhar
AyeshaIftikhar / FlutterCodes.md
Last active September 11, 2021 07:36
This gist is about most commonly codes used in applications with flutter. This will include Authentication codes with firebase and other common code snippets.

FlutterEvo

Introduction

I am Ayesha Iftikhar and I am creating this gist to keep all the most commonly used codes in one place. This will have all common code snippets which are basic building blocks of any flutter application. Like, basic widgets and their commonly used properties. Setting up a project with Firebase and Firebase Authentications.

Note: Errors and Omissions are expected and your contributions will be appreciated.

UI Components

Container Widget