DarkToastManager.dart 468 Bytes
Newer Older
林生雨's avatar
林生雨 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
/*
 * @author lsy
 * @date   2020/5/20
 **/
import 'package:flutter/cupertino.dart';

import 'DarkToastView.dart';

class DarkToastManager {
  static OverlayEntry showDartToast(
      BuildContext context, Widget left, String right) {
    OverlayEntry overlayEntry = OverlayEntry(builder: (c) {
      return DartToastView(
        leftChild: left,
        rightText: right,
      );
    });
    Overlay.of(context).insert(overlayEntry);
    return overlayEntry;
  }
}