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) => Navigator.withDialogManager(child),
      // Add your app routes or home
    );
  }
}

class AppController {
  final DialogService _dialogService = DialogService();
  
  void doSomething(){
    try {
      didSomethingWithError();
    } catch(e){
      _dialogService.pushDialog(builder: (context)=> ErrorDialog());
    }
  }
}

Libraries

dialog_service