handleNotification method

void handleNotification(
  1. Map<String, dynamic> data
)

通知内容に応じた処理を行う

typeを含む場合、その値に応じた画面遷移処理を行う

Implementation

void handleNotification(Map<String, dynamic> data) {
  // TODO: Key: Valueが決まっていないため、仮実装
  if (data.containsKey('type')) {
    final type = data['type'];
    switch (type) {
      case 'message':
        _logger.d('##### type: message #####');
        _goRouter.go('/message');
        break;

      default:
        _logger.d('##### type: unknown #####');
        break;
    }
  } else {
    _logger.d('##### key: type not found #####');
    // TODO: 動作検証用のため、実装完了したら削除
    // デバッグモードの場合はデバッグ画面に遷移
    if (kDebugMode) {
      _goRouter.go('/debug');
    }
  }
}