FirebaseUI-Flutter icon indicating copy to clipboard operation
FirebaseUI-Flutter copied to clipboard

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

Open lesnitsky opened this issue 2 years ago • 0 comments

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));
    }, ...);
  }
}

lesnitsky avatar Feb 03 '23 12:02 lesnitsky