controllerTemplate top-level constant

String const controllerTemplate

controllerTemplate

will be used when create a new controller and its test file

Implementation

const String controllerTemplate =
    """import 'package:projectName/core.dart';\nimport 'package:flutter/foundation.dart';\n
class className extends ChangeNotifier with DiagnosticableTreeMixin implements ReassembleHandler{

  /// check if current controller is dispose
  bool isDisposed = false;

  bool get mounted => !isDisposed;

  /// ### `className`
  ///
  /// `Description`:
  ///
  /// `Example`:
  // TODO: Implement controller
  className(){

  }

  @override
  void debugFillProperties(DiagnosticPropertiesBuilder properties) {
    super.debugFillProperties(properties);
    /// list all the properties of your class here.
    /// See the documentation of debugFillProperties for more information.
    /// TODO: implement add
    properties.add(StringProperty('className', null));
  }

  @override
  void reassemble() {
    print('Did hot-reload className');
  }

  @override
  void notifyListeners() {
    if (!isDisposed) {
      super.notifyListeners();
    }
  }

  @override
  void dispose() {
    /// TODO: dispose
    isDisposed = true;
    super.dispose();
  }
}
""";