Category: Flutter
Building an Audio Player in Flutter with Just Audio
I recently needed to create a reusable Audio Player for a Flutter App I was working on. After a bit of research I decided to use the Just Audio plugin. As is often the case I found that the documentation was useful for standalone implementations, but not entirely helpful for reusability. The first step is…
Styling Tab Bar in Flutter
Recently I decided to add a default tab bar to my app in flutter. This is relatively straightforward to achieve using the following And this yields a tab bar with two pages which looks like this: Following on from my posts about using Themes in Flutter, we can now start to style the tab bar…
Building a ListView which scrolls neatly by item
Recently I wanted to horizontally scrolling ListView to display a number of panels. This is relatively easy to achieve, but there were two things that I did not like about it. As it turns out both of these issues are also very easy to fix. First up, calculating the panel dimensions can be done by…
Using Provider to Share State Between Widgets
Today I needed to share a timer between two widgets. A quick search revealed that the way to go was to use Provider. So, as usual I looked for a good example of how to go about it. I didn’t actually find one, so instead I took a look at the official documentation (https://pub.dev/packages/provider). Unfortunately,…
Updating CocoaPods to run Flutter Apps on iOS
Having successfully run a couple of Flutter Apps on Android devices and the iOS Simulator (from AndroidStudio), I was not expecting there to be much of a problem getting my App running on iOS. Unfortunately as soon as I tried to run my code from XCode I hit an error A quick search revealed a…
Styling PopupMenuItem with Flutter themes
In my previous post I looked at creating a reusable popup menu in flutter and applying a flexible theme from ThemeData. After a bit of testing I’ve uncovered two minor wrinkles. The first is that the icons in my PopupMenuItem don’t take their style from iconTheme as I had anticipated. Instead, for some unknown reason…
Reusable overflow menu in Flutter
One of the problems of learning new languages is that the majority of example code shows only the simplest use cases. With Flutter particularly I have found that the samples in the documentation and answers available on Stack Overflow are built to solve specific single widget needs rather than being coded for reusability. When you…
Styling Flutter (Part 2)
As part of my flutter journey I have been updating an app I wrote a few years ago, and applying some dynamic themes to it. In part one (Styling Flutter – Nightmare in Themesville) we looked at how to use the ThemeData object to apply a dynamic dark theme to light theme switch. In this…
Flexible Themes in Flutter
Following on from my last post about the potential pitfalls of Flutter themes, let’s look at some of the benefits. Looking at articles on Medium and answers on StackOverflow it seems that a lot of people fail to grasp the power of themes, and apply styles in an ad-hoc fashion at the widget or property…
Styling Flutter – Nightmare in Themesville
One of the great things about Flutter is how quickly you can progress with a project. Everyone says it. Flutter development is fast. Except when it isn’t. Where it comes unravelled for me is when I try and apply themes to my project. I’m a big fan of generic code. Declare something once, use it…