added capitalize extension
This commit is contained in:
parent
6d9352485b
commit
3af6cc5bc6
2 changed files with 7 additions and 1 deletions
|
@ -12,7 +12,7 @@ class Ingredient {
|
||||||
Widget getIngredientWidget(int weight){
|
Widget getIngredientWidget(int weight){
|
||||||
return Row(
|
return Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Text("${this.name}: "),
|
Text("${this.name.capitalize()}: "),
|
||||||
Text("${this.getAbsolute(weight)}$unit")
|
Text("${this.getAbsolute(weight)}$unit")
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
|
@ -19,4 +19,10 @@ Future<List<PizzaRecipe>> getRecipes() async {
|
||||||
|
|
||||||
Future<String> loadAsset(String path) async {
|
Future<String> loadAsset(String path) async {
|
||||||
return await rootBundle.loadString(path);
|
return await rootBundle.loadString(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
extension StringExtensions on String {
|
||||||
|
String capitalize() {
|
||||||
|
return this[0].toUpperCase() + this.substring(1);
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue