Masamune logo

Katana Functions

Follow on Twitter Follow on Threads Maintained with Melos

GitHub Sponsor

[GitHub]( | [YouTube]( | [Packages]( | [Twitter]( | [Threads]( | [LinkedIn]( | [](

Adapter plug-ins for server integration such as Cloud Functions for Firebase.

It is possible to work with @mathrunet/masamune to secure client-side implementations.


Import the following packages

flutter pub add katana_functions

If you use Cloud Functions for Firebase, import the following packages as well.

flutter pub add katana_functions_firebase


Advance preparation

Always place the FunctionsAdapterScope widget near the root of the app.

Pass a FunctionsAdapter such as RuntimeFunctionsAdapter as the parameter of adapter.

void main() {
  runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  Widget build(BuildContext context) {
    return FunctionsAdapterScope(
      adapter: const RuntimeFunctionsAdapter(),
      child: MaterialApp(
        home: const FunctionsPage(),
        title: "Flutter Demo",
        theme: ThemeData(

Using Functions

Create a Functions object as shown below and call the corresponding method.

If the corresponding method is not implemented on the server side, an error is returned.

final functions = Functions();
await functions.sendNotification(
  title: "Title",
  text: "Push Notifications",
  target: "TopicName",


The following FunctionsAdapter is available

  • RuntimeFunctionsAdapter´╝ÜFunctionsAdapter that completes without server processing and without error. available as a stub.
  • FirebaseFunctionsAdapter´╝ÜFunctionsAdapter for using FirebaseFunctions, available by defining a Function using @mathrunet/mathamune.

GitHub Sponsors

Sponsors are always welcome. Thank you for your support!


Provides an interface to execute server-side processing in a type-safe manner. Actual processing on the server side is done by importing a separate adapter.