Modal named routes in Flutter

Flutter’s navigation and routing definitions are great tools for handling moving from one page of an application to another and back. In particular named routes make it simple to decouple implementation from intent. The standard navigation behaviour using named routes is to create a MaterialPageRoute using a widget. If you want to use a popup route or some other modal artifact that doesn’t work. Turns out it’s simple to override this behaviour and this post explains how. Basic named routes Using navigation with named routes is pretty simple. First declare the route in the routes table as part of the [Read on…]

Markdown Parsing in Dart

Markdown content has become pretty ubiquitous and along with that comes the requirement to parse it into its constituent parts. Sometimes it’s useful to know what links it contains, or to count the headings, etc. Writing parsers is super fun in comp sci class, and not too bad with something like Antlr, but when someone else has already done the work, so much the better. Dart has a very capable Markdown parser that is only missing a little bit of documentation to make it fit this more general requirement. This post fills in that bit of documentation. The Basics Markdown [Read on…]

Handling permission requests in Android for Flutter plugins

While building the Android functionality for a plugin recently I had to handle a system permission request. Although all the parts of that are simple it took me a while to figure out how to put them together. In hopes of making it simpler for others looking to do this here’s all the bits in one place. Note: Code examples are Kotlin, there’s a full gist here. Handling the callback The part that I had to search a bit to pull together was how to handle the Android permission callback in my plugin. The Android documentation for it is here [Read on…]