layoutStatelessNotifierTemplate top-level constant
String
const layoutStatelessNotifierTemplate
layoutStatelessNotifierTemplate
will be used when create a new layout and its test file
Implementation
const String layoutStatelessNotifierTemplate =
"""import 'package:projectName/core.dart';\nimport 'package:flutter/foundation.dart';\n
class className extends StatelessWidget {
/// `child`: optional widget
final Widget? child;
/// ### `className`
///
/// `Description`:
///
/// `Example`:
// TODO: Implement the className
const className({Key? key, this.child}) : super(key: key);
@override
Widget build(BuildContext context) {
return ChangeNotifierProvider(
create: (_) => classNameState(),
child: AdaptivePlatformWidget(child: child ?? Container()),
);
}
}
class classNameState extends ChangeNotifier with DiagnosticableTreeMixin
implements ReassembleHandler {
bool isDisposed = false;
bool get mounted => !isDisposed;
classNameState(){
}
@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() {
/// TODO: reassemble
print('Did hot-reload className');
}
@override
void notifyListeners() {
if (!isDisposed) {
super.notifyListeners();
}
}
@override
void dispose() {
/// TODO: dispose
isDisposed = true;
super.dispose();
}
}
""";