dialog_service 1.0.1 copy "dialog_service: ^1.0.1" to clipboard
dialog_service: ^1.0.1 copied to clipboard

Dialog Service for handling error dialogs from controllers

Features #

Push Dialog from Controller classes or classes without access to context. Useful for error dialogs. .

Usage #

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

class MyApp extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      builder: (context, child) => DialogNavigator(child),
      // Add your app routes or home
    );
  }
}

class AppController {
  final DialogService _dialogService = DialogService();
  
  void doSomething(){
    try {
      didSomethingWithError();
    } catch(e){
      _dialogService.pushDialog(builder: (context)=> ErrorDialog());
    }
  }
}
1
likes
120
pub points
18%
popularity

Publisher

verified publisherayushsuman.com

Dialog Service for handling error dialogs from controllers

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on dialog_service