Skip to content

Instantly share code, notes, and snippets.

View mohammadkarbalaee's full-sized avatar

Mohammad Karbalaee Shabani mohammadkarbalaee

View GitHub Profile
@mohammadkarbalaee
mohammadkarbalaee / podforceupdate.sh
Created March 1, 2024 23:31 — forked from mbinna/podforceupdate.sh
Clear CocoaPods cache, re-download and re-install all pods
#!/usr/bin/env bash
rm -rf "${HOME}/Library/Caches/CocoaPods"
rm -rf "`pwd`/Pods/"
pod update
@mohammadkarbalaee
mohammadkarbalaee / 15_aug_2023.md
Created August 15, 2023 15:09
Whatever I find interesting in my iOS dev journey

Hiding the scrollbar for lists

On iOS 16+ use the code below:

.scrollIndicators(.hidden)

For example:

List {
@mohammadkarbalaee
mohammadkarbalaee / habits.md
Created July 11, 2023 12:19
The good habits that I formed in summer 2023 and I want to continue them from now on.

1st

Going to the study room and doing my work there with full focus and mind control

2nd

@mohammadkarbalaee
mohammadkarbalaee / countries.json
Created April 12, 2023 13:21 — forked from bensquire/countries.json
JSON Country List based on the ISO-3366-1 Alpha-3 Codes, with eu countries marked
[
{
"code": "AFG",
"name": "Afghanistan",
"eu": false
},
{
"code": "ALA",
"name": "Åland Islands",
"eu": false
@mohammadkarbalaee
mohammadkarbalaee / countries.json
Created April 12, 2023 10:33 — forked from keeguon/countries.json
A list of countries in JSON
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},
@mohammadkarbalaee
mohammadkarbalaee / main.dart
Created April 10, 2023 08:40
forlorn-eucalyptus-8793
void main() {
for (int i = 0; i < 5; i++) {
print('hello ${i + 1}');
}
}
@mohammadkarbalaee
mohammadkarbalaee / 2023.feb.23.md
Last active March 8, 2023 17:42
Daily Flutter experiences and tips and tricks which I learn along the way. I will store the tips of each day separately on a markdown file.

StateFulBuilder

the variable which the state inside StateFulBuilder is dependant on should be defined outside the builder method of StateFulBuilder. If it is defined inside, It will not have any affect.

Container Color

A container should have either its color specified or its decoration specified. They cannot be mixed up. If you want to use both of them, the trick is to define the color inside BoxDecoration and pass it through the decoration field of your Container.

@mohammadkarbalaee
mohammadkarbalaee / readme.md
Created February 22, 2023 16:23
The trick to make an circle image in Flutter

Circle image in Flutter

wrap your image inside a CliRRect and give the BorderRadius.circular("width") to this widget which "width" is the width of the image itself.

Here is an example:

ClipRRect(
  borderRadius: BorderRadius.circular(10),
 child: Image.network(
@mohammadkarbalaee
mohammadkarbalaee / tips.md
Last active February 18, 2023 00:16
The tips and tricks that I learn throughout the problems that I solve during my mobile development career

Builder with Getx

when you use the Builder widget, it has its own context, therefore the values inside it won't get updated as you expect. Because they are not part of the Getx's widget tree.

Flutter File Picker

As of the day that I am writing this tip, Feb 2023, Flutter File Dialog works flawlessly in both Android and iOS. If the file_picker package does not work for you then give this one a little try. You will not regret it.

@mohammadkarbalaee
mohammadkarbalaee / extension.md
Last active February 10, 2023 05:22
How to install gnome extensions.