Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
bbc1a61
Add missing title for day 22
triallax May 3, 2020
47463ff
Fix some typos
triallax May 3, 2020
baebb16
Merge branch 'master' into fix-typos
triallax May 3, 2020
1609f51
Merge pull request #5 from mhmdanas/fix-typos
erluxman May 4, 2020
fd00d19
Simplify title
triallax May 4, 2020
d915cbe
Merge remote-tracking branch 'upstream/master' into add-day22-title
triallax May 4, 2020
0faa284
Merge pull request #4 from mhmdanas/add-day22-title
erluxman May 4, 2020
59f455b
added week 5 tips
erluxman May 10, 2020
f88aef8
Merge pull request #6 from erluxman/week_5
erluxman May 10, 2020
a2123c8
added week 6 tips
erluxman May 18, 2020
05af181
Merge branch 'master' of github.com:erluxman/awesomefluttertips into …
erluxman May 18, 2020
364e051
Merge pull request #7 from erluxman/week_6
erluxman May 18, 2020
7dde8d1
added week 7 tips
erluxman May 25, 2020
e171d2f
Merge pull request #9 from erluxman/week_7
erluxman May 25, 2020
dcab2d0
added 7 more tips
erluxman May 31, 2020
a11f362
Merge pull request #10 from erluxman/week_8
erluxman May 31, 2020
ed30f17
completed week9
erluxman Jun 7, 2020
a7ddac6
added flare and SVG sample app demo
erluxman Jun 7, 2020
be55a1c
Merge pull request #11 from erluxman/week_9
erluxman Jun 7, 2020
73bd6ba
added comparing gifs sideby side
erluxman Jun 7, 2020
f1de6e5
Merge pull request #12 from erluxman/week_9
erluxman Jun 7, 2020
8e66c67
started modularizing the tips
erluxman Jun 7, 2020
330f0ba
making links more distinct
erluxman Jun 7, 2020
f9da5c5
changed style for current page
erluxman Jun 7, 2020
4e075b8
separating previous and next tips
erluxman Jun 7, 2020
e663287
separating previous and next tips second page
erluxman Jun 7, 2020
8348567
Fix formatting
erluxman Jun 7, 2020
75b550f
applied formatting to all pages
erluxman Jun 7, 2020
5e72e2d
Merge pull request #13 from erluxman/modularization
erluxman Jun 7, 2020
2c745d2
fixed lint issues
erluxman Jun 7, 2020
ec25ad5
fixed lint issues
erluxman Jun 7, 2020
37e11de
added partial week 10 updates
erluxman Jun 12, 2020
73918b4
Improve adding build badge tip
erluxman Jun 12, 2020
12dd146
added codecoverage tips
erluxman Jun 13, 2020
3423de5
added video link
erluxman Jun 13, 2020
4df8d81
updated video url
erluxman Jun 13, 2020
99a0aca
uploaded week 10 tips
erluxman Jun 14, 2020
40a2e40
Updated Page number
erluxman Jun 14, 2020
dcbe781
Added week 11 tips
erluxman Jun 21, 2020
36b25c7
Update README.md
erluxman Jun 24, 2020
0cea085
Update README.md
erluxman Jun 24, 2020
38e62e3
Added week 12 tips
erluxman Jun 29, 2020
4c50237
Merge branch 'master' of github.com:erluxman/awesomefluttertips
erluxman Jun 29, 2020
609cbb5
Update README.md
erluxman Jul 4, 2020
ab2c351
Added week 13
erluxman Jul 5, 2020
4b0511a
Merge pull request #15 from erluxman/week_13
erluxman Jul 5, 2020
b8c9fef
added week 14
erluxman Jul 12, 2020
4bf25ba
Merge pull request #16 from erluxman/week_14
erluxman Jul 12, 2020
43e2b5c
completed 100th items
erluxman Jul 13, 2020
73071bb
Merge branch 'master' of github.com:erluxman/awesomefluttertips
erluxman Jul 13, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
completed week9
  • Loading branch information
erluxman committed Jun 7, 2020
commit ed30f17a479687ca313bc6cf90305e5476cb7b26
151 changes: 151 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1340,4 +1340,155 @@ From dart 2.8 onwards, the command `pub outdated` gives you the overview of your

🚨🚨Tip: use `flutter pub outdated` if `pub outdated` can't find Flutter SDK.

## #Day57 typedef

`typedef` is used when you want to give an alias to a **`Function signature`**. As it can be laborous and error prone to type the Function Signature in every field or return type. As a bonus, we do not lose Function's type info.

__`Steps to use typedef:`__

Step 1 : Define a `typedef` with Function Signature __`outside a class`__.

typedef UserSelector = User Function(String, String);

Step 2 : Replace the Function Signature with typedef to declare members or return type.

class A{
//Use this ✅
UserSelector userSelector;

// Not this ❌
User Function(String, String) userSelector;

A ({this.userSelector});
}

Step: Simply pass function/ lambda like you did before.

//Pass lambda
var a = A(userSelector: (id, authKey) {
return User(id, "User name");
});


//Pass Method
var a = A(userSelector: getUser)

User getUser(String id, String key) {
return User(id, "User name");
}

## #Day58 Easy Flutter installation

Still confused installing flutter in mac/linux easily?

1. Download Flutter zip.
2. Decompress it in desired directory.
3. `cd` to that desired directory from terminal.
[🚨⚠️ flutter should be inside desired directory]
4. Run the following command

If you are using zsh:
echo "\nexport PATH="\$PATH:`pwd`/flutter/bin"">>~/.zshrc ; source ~/.zshrc

If you are using bash:
echo "\nexport PATH="\$PATH:`pwd`/flutter/bin"">>~/.bashrc ; source ~/.bashrc

![a](assets/58flutterinstall.png)

## #Day59 #BlackLifeMatter

Black lives matter ✊🏿& Racial Equality should be the norm.

This is a tip not just for Flutter developers but to all humans.

This is my tip number #59.

![a](assets/59blacklifematter.jpeg)

## #Day60 Using SVG

Even though flutter doesn't support any vector graphics out of the box, the package `flutter_svg` can render `svg` into Flutter app.

1. Add dependency :
`flutter_svg: ^version`

2. Start using it like Flutter `Image` Widget.

//load SVG from network
SvgPicture.network("https://image.flaticon.com/icons/svg/124/124555.svg", height: 200)

//load SVG from assets folder
SvgPicture.asset("assets/ufo.svg", height: 200)

[visit flutter_svg](https://pub.dev/packages/flutter_svg#-readme-tab-)

![a](assets/60svg.png)

## #Day61 Using Flare Animations

Similar to vector graphics, Flutter doesn't support vector animation natively. [Rive (rive.app)](https://rive.app/explore) helps with amazing vector animations in Flutter.

1. Add flare in `pubspec.yaml`:

flare_flutter: ^version

2. Download flare files from [rive.app](https://rive.app/explore) & put those `.flr` files into `assets/` folder:

assets:
- assets/

3. Start using `FlareActor` widget.

FlareActor(
"assets/world.flr",

//🚨Caution🚨, you can find 👉 #animation name in
//left bottom 👈👇 of rive.app designer tool when
//Animation tab is selected

animation: "world")

![a](assets/61flare.gif)

## #Day62 pubspec autocomplete

When we want to add a dependency only way is either going to github document or pub.dev.

We can directly add dependencies from our IDEs using extensions/plugins.

### __`For VS code`__ : [Pubspec Assist](https://marketplace.visualstudio.com/items?itemName=jeroen-meijer.pubspec-assist)

![pubspectAssit](assets/62pubspectassist.gif)

### __`For Android Studio`__ : [Flutter Enhancement Suite](https://plugins.jetbrains.com/plugin/12693-flutter-enhancement-suite)

![Flutter Enhancement Suite](assets/62FlutterEnhancement.gif)

P.S. Flutter Enhancement Suite comes with a lot of other great features.

## #Day63 cached_network_image

`cached_network_image` helps to __`show`__ and __`cache`__ image from Internet.

It shows image from cache if it's already cached instead of downloading.

It will make app feel faster and save network bandwidth.

1. Add cached_network_image in pubspec.yaml

dependencies:
cached_network_image: ^version

2. Start using `CachedNetworkImage`.

CachedNetworkImage(
imageUrl: imageUrl,
placeholder: (context, url) => CircularProgressIndicator(),
errorWidget: (context, url, error) => Icon(Icons.error),
)

[get cached_network_image](https://pub.dev/packages/cached_network_image#-readme-tab-)

Image.network | CachedNetworkImage
:-------------------------:|:-------------------------:
![a](assets/63imagenetwork.gif) | ![a](assets/63cachednetworkimage.gif)
Binary file added assets/58flutterinstall.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/59blacklifematter.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/60svg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/61flare.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/62FlutterEnhancement.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/62pubspectassist.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/63cachednetworkimage.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/63code.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/63imagenetwork.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.