Skip to content

Instantly share code, notes, and snippets.

View tareq3's full-sized avatar
🎯
Focusing

Tareq Islam tareq3

🎯
Focusing
View GitHub Profile

Mediaquery in flutter

Mediaquery.of(context).size. :This provider device screen size

Mediaquery.of(context).padding.:This provider device notch and navigation key size

Mediaquery.of(context).viewInsets.:This provider the size of anything that overlap display like SoftKeyboard size

Material Theme has some Common properties

primary swatch : This is alternative of primary color but it still more superior than primary color cause it dynamically change its shade along with position of the appp

Extending theme from other concrete theme:

  ThemeData _lightTheme = ThemeData.light().copyWith(
    primaryColor: Colors.white,
    primaryColorDark: Color(0xFFF5F5F5),
 );
# Provider Package in Flutter (Google supported)
### Has Three part:
#### 1. Model or Subject or Bloc or Provider (sometimes extended from ChangeNotifier ):
Where State dependent model or variables will be stored
and will be changed
and notify the observers/Consumers/Listeners with changeListener()
#### 2. Provider(obj) / ChangeNotifierProvider :
- ![#DCE1E8](https://placehold.it/15/#DCE1E8/000000?text=+) `#DCE1E8`
- ![#c5f015](https://placehold.it/15/c5f015/000000?text=+) `#c5f015`
- ![#1589F0](https://placehold.it/15/1589F0/000000?text=+) `#1589F0`
@tareq3
tareq3 / Stream
Last active February 16, 2020 15:55
# Basic Stream:
## Stream is same as Observable in Rx
### create a new stream
#### never forgot to close a stream in dispose
```
var mStream = new StreamController();
```
with fixed type:
## Flutter Cli:
### Flutter Create a project:
```
Flutter create project-name
```
### Flutter create a project with package-name defined:
```
flutter create --org com.domain project_name
```
### Search Item from List:
#### Script:
```
private List<OutletItem> mOutletList;
Observable.fromIterable(mOutletList)
.filter((OutletItem item) -> {
return item.getNAME().toLowerCase().contains(String.valueOf(s).toLowerCase());
})
@tareq3
tareq3 / Vuex
Last active February 7, 2021 10:30
### Vue Cheat Sheet
## Vue Create new Project
```
vue create hello-world
```
## There is an easy way to create and customize a Vue project using Vue UI
```
vue ui
@tareq3
tareq3 / Jquery
Last active October 14, 2019 16:59
# Jquery Cheat Sheet
### collected from
https://htmlcheatsheet.com/jquery/
## Include:
### Minified version:
```
<script
src="https://code.jquery.com/jquery-3.4.1.min.js"
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo="
@tareq3
tareq3 / thymeleaf
Last active October 19, 2019 08:28
## Themeleaf
### initializaion:
```
xmlns:th="http://www.thymeleaf.org"
```
## Quick Summary:
```