Image for post
Image for post

Hiring is undoubtedly an important and resource consuming process for every company. What if I told you that you can spot out bad programmers within 2 weeks? You don’t have to wait for 3 months of probation to actually know a person is unqualified.

There are tons of articles out there like “How to be a bad programmer”, they aimed to let a programmer to reflect on his own practice and do the opposite way — not being a bad programmer. …

Image for post
Image for post

Today I am going to demonstrate how to create a two direction (vertical and horizontal) scrolling data table with flutter, this is how it looks like:

Tl;dr: Use flutter_inappwebview instead. It is rich in feature, and the switching process only takes a few minutes.

Image for post
Image for post

I have developed Flutter applications for a few years and some of you may have the same thought with me: the official plugins are better. Well, we were wrong. I have switched away from the official Flutter WebView plugin, and I think you should too.

3 months ago I published an article: “Flutter: How to make WebView transparent”, that worked fine but it was only a temporary fix. …

Note: This article is written at the end of December 2020. The content may be outdated by the time you read this article.

Image for post
Image for post

The M1 MacBook Air I ordered, with 16GBs of RAM, is delivered today. After a few hours of testing, here are some thoughts.

Hardware

Comparing with my old MacBook(MacBook Pro 2015 with Retina display), it’s thinner and much lighter. The display is much brighter; I would switch off True Tone when connected to an external monitor, since the white balance keeps changing with True Tone on. …

Flutter is great for building UIs, but sometimes we just need to embed a website into our app by using WebView. While dark mode UI is being more and more common, the white background of the official WebView plugin can be annoying.

Image for post
Image for post

Just a little bit of “Googling” you can see that transparent background is a frequently requested feature of Flutter WebView, but for unknown reasons they didn’t merge the code for months at the time of writing this article. Also there are no official responses regarding the issue.

Since I have forked the official Flutter WebView plugin and added…

Image for post
Image for post

Update on 16/11/2020: import_sorter just released 4.3.1, which provides us a way to sort only a subset of files rather than sorting all of them. We can integrate it into our workflow more nicely, see the updated lefthook.yml at the end of this article.

As the team size grows, coding standard is very important to maintain an easily understood and consistent codebase. In this article I will share how I setup and integrate it into my workflow.

Choosing linting rules

Flutter comes with a code linter in the SDK, all you have to do is create a file analysis_options.yaml

Image for post
Image for post

Before being a Flutter developer, I came from the JavaScript world. One thing I missed the most is the mighty JavaScript packages on npm, especially lodash and ramda, they give us great convenience on accessing nested JSON objects.

When developing Flutter applications, we often need to parse JSON objects from API responses, then access or manipulate them accordingly. Sadly dart language’s support for Map objects is not very rich, therefore I created this package: map_enhancer.

Usage

Actually this package is not restricted to Flutter and JSON(Map<String, dynamic>) objects, you may use it in any dart projects, or on any dart’s native Map objects.

And that’s it. Visit pub.dev to install this package, or submit issues/pull requests on GitHub.

Do you know you can clap up to 50 times for an article? Go smash that button!

Image for post
Image for post

Everyone says using const constructors improves the performance of your app, but how much? I haven’t found any analysis on the internet, so I decide to do it myself.

Here is my app for the test:

Image for post
Image for post

As web support of Flutter reaches beta channel, some may try to build their web applications in Flutter. While there aren’t much discussions or tutorials about how to handle mouse events, this is why I’m writing this article.

Mouse Movement Events

For mouse movements, you may use the MouseRegion widget.

It takes 3 callbacks as parameter: onEnter(when the cursor enters an area), onHover(when the cursor moves within the area), onExit(when the cursor leaves the area).

You may also get the position of the cursor from the events being passed to the callbacks.

Wheel Scrolling Events

When you want to detect for wheel scrolling events, you…

Problem

The way to extend ThemeData in Flutter has been a frequently asked question on StackOverflow: Is it possible “extend” ThemeData in Flutter.

There are even issues created in the Flutter official repository:

  1. Add custom properties to ThemeData
  2. Feature request: Extend ThemeData with app-specific palettes

With dart 2.7, this is finally possible by using Extension methods.

Note

  1. It’s possible to extend ThemeData object, but most of us only need a custom color palette. For simplicity, I would instead extend the ColorScheme object in the following example.
  2. Flutter team is moving the color dependencies of Material components from ThemeData to ColorScheme, let’s work…

Crizant Lai

A JavaScript/Node/Flutter developer who love technical stuffs.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store