import 'package:fis_common/event/event_type.dart';
import 'package:flutter/material.dart';

class VSideNavViewController {
  String? _currentTitle;

  /// 当前title
  String? get currentTitle => _currentTitle;

  /// 路由变更事件
  final titleChangedEvent = FEventHandler<String?>();

  /// 页面变更事件
  final pageChangedEvent = FEventHandler<WidgetBuilder?>();

  VSideNavViewController() {
    titleChangedEvent.addListener(_onTitleChanged);
  }

  /// 释放资源
  void dispose() {
    titleChangedEvent.removeListener(_onTitleChanged);
  }

  void _onTitleChanged(_, String? e) {
    _currentTitle = e;
  }
}
