handlerz 0.0.3 copy "handlerz: ^0.0.3" to clipboard
handlerz: ^0.0.3 copied to clipboard

this project is for handling error in flutter, and still upgrading for better performance and easy to use

example/lib/main.dart

import 'package:flutter/material.dart';
import 'dart:async';

import 'package:handlerz/handlerz.dart';
import 'kelas.dart';

Handlerz controller = Handlerz();

void main() {

  
  runApp(const MyApp());
}

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

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
    initPlatformState();
  }

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initPlatformState() async {


    controller.set([
      Kelas.state,
    ],
      firebaseConfig: FirebaseConfig(
        credentialsPath: 'assets/file_firebase_notification_v1.json',
        projectId: 'your project id firebase',
        targetToken: 'Error Watcher Extended token or target to receive notification',
        config: {
          'name': 'app name', 
          'version': '1.0.0',
          'author': 'your name',
          'description': 'your description',
          'package': 'your package',
          'platform': 'your platform',
        }
      )
    );


    controller.getAsync<Kelas>((c) {
      c.getDataFromApi();
    });


  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Text('Running on: ${controller.get<Kelas>((c) {return c.getData();}) ?? ''}\n'),
        ),
      ),
    );
  }
}
0
likes
110
points
14
downloads

Publisher

unverified uploader

Weekly Downloads

this project is for handling error in flutter, and still upgrading for better performance and easy to use

Documentation

API reference

License

MIT (license)

Dependencies

dart_jsonwebtoken, flutter, http, path_provider, plugin_platform_interface

More

Packages that depend on handlerz