firebase / FirebaseUI-Flutter

Apache License 2.0
101 stars 91 forks source link

[firebase_ui_storage] upload/download intents and actions for custom UIs #42

Open lesnitsky opened 1 year ago

lesnitsky commented 1 year ago

Firebase UI should provide intents and actions that could be used directly by custom UIs.

Example:

class MyApp extends StatelessWidget {
  Widget build(BuildContext context) {
      return Actions(
        actions: {
          UploadFileIntent: UploadFileAction(), // <- from 'package:firebase_ui_storage/firebase_ui_storage.dart'
        },
        ...
      )
   }
}

class MyCustomView extends StatelessWidget {
  Widget build(BuildContext context) {
    return ElevatedButton(onPressed: () async {
      final file = await pickFile();
      Actions.invoke(UploadFileIntent(file));
    }, ...);
  }
}