2017-11-18 18:39:10 +00:00
|
|
|
import 'package:file/file.dart';
|
2017-04-05 20:38:03 +00:00
|
|
|
|
|
|
|
class MustacheContext {
|
2021-06-20 12:37:20 +00:00
|
|
|
Directory? viewDirectory;
|
2017-04-05 20:38:03 +00:00
|
|
|
|
2021-06-20 12:37:20 +00:00
|
|
|
Directory? partialDirectory;
|
2017-04-05 20:38:03 +00:00
|
|
|
|
2021-06-20 12:37:20 +00:00
|
|
|
String? extension;
|
2017-04-05 20:38:03 +00:00
|
|
|
|
|
|
|
MustacheContext([this.viewDirectory, this.partialDirectory, this.extension]);
|
|
|
|
|
|
|
|
File resolveView(String viewName) {
|
2021-06-20 12:37:20 +00:00
|
|
|
return viewDirectory!.childFile('$viewName$extension');
|
2017-04-05 20:38:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
File resolvePartial(String partialName) {
|
2021-06-20 12:37:20 +00:00
|
|
|
return partialDirectory!.childFile('$partialName$extension');
|
2017-04-05 20:38:03 +00:00
|
|
|
}
|
|
|
|
}
|