class CustomText extends StatelessWidget {
const CustomText({
Key? key,
required this.text,
this.size = 14,
this.font = 'Poppins',
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)); |
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.
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:
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
- 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.
- Computer Language used for sorting, manipulating and retireving data from relational databases.
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.