Skip to content

AndyGaskell/joomla4api_basic_flutter_app

Repository files navigation

Joomla 4 API Basic Flutter App

A basic flutter app using the Joomla 4 API.

This is tested using Joomla 4 Beta 4.

Getting Started

Set up flutter, see https://flutter.dev/docs/get-started/install

Get this code from https://github.com/AndyGaskell/joomla4api_basic_flutter_app

Set the details for your Joomla 4 site in the file...

lib/Networking/rest_api_manager.dart

This needs...

  • Site URL
  • Joomla API token

Create all the various other flutter files...

flutter create .

Build and run the app...

flutter run

What the App does

It is just using the content API endpoint, pulling all articles and displaying them in a list.

This is what it looks like on an Android Nexus 4 running Android 8.1.0...

screen grab of the app

Troubleshooting

Flutter set-up issues can usually solved by running...

flutter doctor

To check the API is working you can test it with a cURL call, like...

curl --location --request GET 'http://localhost/joomla/joomla_4_beta_4/api/index.php/v1/content/article' --header 'authorization: Bearer YOUR_API_TOKEN'

Check Make authorization header case insensitive in API #30882 - joomla/joomla-cms#30882 Auth headers in Joomla 4 API should maybe be case insensitive #30871 - joomla/joomla-cms#30871

Things to do next

I could / should do some more bits to this, like...

  • add HTML rendering
  • add image per item
  • add error handling
  • some other stuff...

General Flutter links

Joomla API Refs

Useful Flutter Refs