Alexey Inkin | Flutter GDE
687 subscribers
29 photos
1 video
69 links
Download Telegram
My 24th Dart package:
https://pub.dev/packages/wif_workaround

A workaround to use Workload Identity Federation with googleapis_auth, calls gcloud CLI to get the access token.

You normally use googleapis_auth package to connect to Google Cloud services. It works with service account keys and metadata server, but not with local keys obtained with Workload Identity Federation.

This package allows you to use Workload Identity Federation if you have locally installed gcloud CLI.
πŸ‘4πŸ”₯3❀1
Part 2. Earlier we made a simple container and deployed it manually. Time to automate things and take it to the production level:

https://medium.com/@alexey.inkin/making-github-workflows-to-deploy-to-gke-with-terraform-and-workload-identity-federation-074ac83b899c

This tutorial:
- Creates persistent environments.
- Uses Terraform for declarative management of cloud resources.
- Uses GitHub Workflows to automate deployment.
- Creates transient copies of the system to run tests on them.
- Uses Workload Identity Federation to avoid any use of service account keys.

DevOps is surprisingly hard, and it took me 1.5 months to learn and write this. These GitHub workflows failed 108 times for me while debugging, so this should save you tons of try and errors.
πŸ‘4πŸ”₯2
❓ What would be the best way to implement CI/CD for flutter apps?

πŸ…°οΈ The most tricky part in CI/CD is automated testing. Otherwise, just building and deploying is relatively easy. Then, testing on the Flutter's part isn't hard. In most apps, all you need is click through some use cases. Much harder is the backend to which your app talks. You typically need a copy of the system with its storage, message queues, and all the rest. What of that you can isolate or mock varies widely. So start your CI/CD with the backend. When it's done, its specific architecture usually will hint a straightforward way to add Flutter or any other client on top of it.

See the recent article for the example for the backend.
πŸ‘6
I made a tiny package to dump the last HTTP request. It helps a lot in debugging failed requests.
https://pub.dev/packages/http_log
πŸ”₯5πŸ‘4
Playing with Dart 3.5 macros already? I made a CLI tool to show augmentation for a given source file if your IDE is buggy or does not yet support macros:

https://pub.dev/packages/show_augmentation
πŸ”₯2
I have re-written enum_map package with macros. This package takes an enum and creates a map class that gives you a compile-time guarantee that the map has an entry for each of the enum constants. No more bangs after getting a value from a map.

The most straightforward use of the package is to make sure your Flutter tabs never fall out of sync with the tab controller and tab headers. I use it in every Flutter project in the last ~2 years. The highest it made to is Apache Beam with 7.7k stars. More in my article "Compile-time safety for Flutter tabs" from before.

With macros, you no longer need code generation with build_runner. You just add an annotation to an enum and instantly get the map class ready to use.

Check out the pre-release version.
πŸ‘11πŸ”₯1
Every time I think something is too trivial to go with classes I end up rewriting it with classes. Tomorrow I will lose 1 hour changing List<double> into TimeSeries because it "suddenly" needed to be aware of timestamps.

There is "Domain-Driven Development" (DDD) principle. It says to create a classes for logically distinguished things. For instance, you should have classes Password, Url, Username, etc. and not use just String for them. If I followed it and created TimeSeries from the beginning since I was dealing with a time series, I would have saved 1 hour of my life.

Don't neglect DDD.
πŸ‘7❀5
Β‘DΓ­a once, mis cien palabras en espaΓ±ol!
πŸ”₯ if you speak Spanish.
πŸ‘4πŸ”₯3😁2😒1
What do you think is the world's single most fundamental problem that all others are induced by? The one you can't ask "why?" to get closer to the root.

If you have Twitter, please reply there. Otherwise, here in a comment.

https://x.com/alexeyinkin/status/1820797300588884114?s=46
πŸ€”2
The Responsibility of the Tech Community over Telegram Prosecution

Telegram & Pavel Durov are under attack over South Korea deep fake crisis. A tech community has an obligation to the public to protect the freedoms by explaining this case.

Any official calling to stop the deep fake crisis is either incompetent or double-playing. The generation is done with dual-purpose open-source software that can be installed on any computer. Once open-source is out there, it can’t be unwritten. It’s omnipresent. And it’s also used on every phone in the world for legitimate purposes like hiding your wrinkles. It’s like campaigning against Photoshop because someone does naughty stuff with it.

Moreover, with hardware getting better, in 10 years anyone will be able to deep-fake anything in a split-second without any restrictions. It’s just the new world we have to learn to live in where anyone can be in porn, and it’s up to a beholder to ignore it, like today you ignore photoshopped horns on your head.

In 10 years we will adapt, but until then the authorities are free to manipulate us into agreeing to ban everything they point the public to blame.

With the French case, Telegram was a mean of communication for some crimes, but with deep fake generation it’s just an entry point for a purchase, and the generation is done on 3rd party backends. That purchase is otherwise trivial with disposable domain names, and has been for decades for other black market info like private data & card numbers.

If an official desn’t know that, they must be fired for incompetence. If they do, they must be jailed for abusing their power to prosecute and for conspiracy to push you into using other software that spies on you and gives them access.

I have a set of questions in my mental toolkit I find most rewarding to ask. One of them is:

If this battle is staged, then what is it staged to hide?

Recursively ask it until you see the obvious.

In Tech, we understand that. It's our responsibility to educate others on this to retain our freedoms.
πŸ‘5πŸ‘2
I made a trivial package multi_animated_builder. It's like the standard AnimatedBuilder but it takes a list of Listenable and rebuilds when any of them fires. No more cascading the builders manually.

Update: Listenable.merge([a, b, c]) is more efficient, thanks A3S.
πŸ‘1
How often do you have issues with iOS? I spent an hour on a trivial thing today because Flutter is not good at finding and fixing iOS misconfigurations. I hit something like that every time I upgrade something. So I filed a feature request to improve this: https://github.com/flutter/flutter/issues/154663

If you have suggestions to improve Flutter tooling for iOS that do not qualify as separate issues, you can post them as comments there.
πŸ‘2
Got an excellent interview question for you.
What will happen and why?
Enjoy.

void main() {
final future = Future.error('My error');
future.catchError((e, st) => print('Caught'));
future.whenComplete(() => print('whenComplete()'));
}
Last Sunday, I moved to The United States as a permanent resident under EB-1A program of extraordinary ability in science. I'm waiting for my green card to arrive by mail in a few months.

Here is my complete petition with just a few private things blacked out, the process of writing it, my strategy for each criterion, and all the reasoning:
https://github.com/alexeyinkin/eb-1a/tree/main/2-petition

And here is the entire process, every form I filled out, and every piece of interaction with each of the United States bodies I went through:
https://github.com/alexeyinkin/eb-1a/tree/main/1-process

I will be updating it with the few steps left as I will receive my SSN card and the green card.

To those of you who want to do the same, here's how I can help:
https://github.com/alexeyinkin/eb-1a/tree/main/4-help

I made a dedicated chat to answer any of your questions on this program: @eb1a_chat

Please join it even if just to say "Hi!"
I like to hear from those who want to come to this great country!
πŸ”₯27πŸ‘9❀5πŸŽ‰3
pub.dev now shows the download count for packages.
This is experimental. Go here to enable it: https://pub.dev/experimental

Here are my humble stats.
πŸ”₯4❀1πŸ‘1
Media is too big
VIEW IN TELEGRAM
Can you help me reach Elon or Vivek with my application for a job at the Department of Government Efficiency?

I want to optimize the operations in legal work immigration.

Getting this green card was long, expensive, and exhausting. I spent $7k even without a lawyer, spent 4 months full-time writing my petition of over 500 pages long (I also published it, take a look [1]), and waited for 11 months after that to be able to come to the United States.

I want to cut this from months to days for those who follow, because America needs to greatly expand legal skilled work immigration, especially after the border with Mexico is closed. The United States loses over a billion in GDP every year from delaying the workers who are already found qualified.

And I have a plan that pays for itself from taxes right away. Check it out as well [2].

To give you an idea of how bad things are in legal immigration:

- You won't believe it, but there is a quota in the extraordinary ability program. And it's not just the high bar, but even the number of people who have already proven they qualified is limited by Congress. Last year, the quota depleted before the end of the year, and the whole machine halted for over a month. What is the purpose of that?

- To make it worse, there is a quota per country of birth. People born in India currently wait 3 years longer than others under the highest program for most talented people, and 10 years longer under the second-most preferred program. This is racist. Not to mention that every petitioner must prove that their immigration will significantly benefit the United States, so we are talking about those who have proven that already. But the law says: 'We got it, we will benefit significantly, now wait for 12 years. In the meantime, your kids will grow up, and you won't be able to take them with you, even though they qualify now. Too bad that the wait is that long'. Crazy.

- Next, a doctor of the Olympic team of a large Asian country could not evaluate her diploma and is unable to work in the United States. It's nearly impossible for doctors to immigrate and work here, and that's a major healthcare cost driving factor. In my homeland, an MRI scan costs $50, and many do it out of pocket multiple times a year for even minor issues, but in the US it costs thousands and is the last resort after weeks of patient's suffering.

See more in the video.

Dear Elon & Vivek, please consider me for DoGE! We need many right people here fast. Make immigration great again!

To help me reach Elon or Vivek, please share:

This post on X: https://x.com/AlexeyInkin/status/1867992122827182233
Or this YouTube video anywhere: https://www.youtube.com/watch?v=M_d3k_6Rw5c
Or this on LinkedIn: https://www.linkedin.com/feed/update/urn:li:activity:7273770178067255296/

[1] My petition: https://github.com/alexeyinkin/eb-1a/tree/main/2-petition
[2] My plan: https://github.com/alexeyinkin/eb-1a/tree/main/3-improvements

X: https://x.com/AlexeyInkin
LinkedIn: https://www.linkedin.com/in/alexey-inkin/
Instagram: https://www.instagram.com/alexey.inkin/
GitHub: https://github.com/alexeyinkin
Telegram: https://t.me/ainkin_com
πŸ”₯13πŸ‘2😎2❀1