FedID Flutter package
Utilizing the Flutter package for FedID involves the same steps as using any other package. First, add FedID to your Flutter project:
# Post-release, FedID will be available in the Flutter repository
flutter pub add fedid
# Until then you can clone the repo at https://codeberg.org/fedid/flutter-library
# and include it in ypur `pubspec.yaml`:
#
# dependencies:
# ...
# fedid:
# path: ../library-flutter/src
# ...
After spinning up your FedID server, you will next need to tell your app to use the FedID Server:
# Import the package
import 'package:fedid/package.dart';
# Set your resolver URL
setFedIdResolverUrl('https://fedid.domain.ext');
Lastly, there are two routes you can use to direct users to the screens built into the package:
Route | Description |
---|---|
/fedid-accounts | Add/edit/remove accounts from the device |
/fedid-login | Login to services using a FedID Account |
These can be used at any point with the standard Navigator
or any custom navigation:
onPressed: () {
Navigator.restorablePushNamed(
context,
'/fedid-accounts',
);
},