• This project
    • Loading...
  • Sign in

OnePoem / OnePoem-App

Go to a project
Toggle navigation Toggle navigation pinning
  • Projects
  • Groups
  • Snippets
  • Help
  • Project
  • Activity
  • Repository
  • Pipelines
  • Graphs
  • Issues 0
  • Merge Requests 0
  • Wiki
  • Snippets
  • Network
  • Create a new issue
  • Builds
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Network
  • Compare
  • Branches
  • Tags
Switch branch/tag
  • OnePoem-App
  • lib
  • util
  • toast_utils.dart
  • reason's avatar
    init · 9f86f44b
    9f86f44b
    reason authored 2021-12-27 17:10:15 +0800
toast_utils.dart 351 Bytes
Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

import 'package:oktoast/oktoast.dart';

/// Toast工具类
class Toast {
  static void show(String? msg, {int duration = 2000}) {
    if (msg == null) {
      return;
    }
    showToast(
      msg,
      duration: Duration(milliseconds: duration),
      dismissOtherToast: true
    );
  }

  static void cancelToast() {
    dismissAllToast();
  }
}