How to Do a Database Table Update with Sqflite in Flutter

How do you update data in a table row in Flutter using the SQFlite plugin?

There are a number of problem solving questions out there (see this and this) but none that I could find to add a canonical answer to. My answer is below.

3 Answers

Add the dependencies

Open pubspec.yaml and in the dependency section add the following lines:

sqflite: ^1.0.0
path_provider: ^0.4.1

The sqflite is the SQFlite plugin of course and the path_provider will help us get the user directory on Android and iPhone.

Maya Lin-Takahashi

Maya Lin-Takahashi

Consumer Tech & Gadget Reviewer

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.