diff --git a/lib/pages/create_recipe_page.dart b/lib/pages/create_recipe_page.dart index c985a6a..8879584 100644 --- a/lib/pages/create_recipe_page.dart +++ b/lib/pages/create_recipe_page.dart @@ -43,17 +43,23 @@ class _CreateRecipeState extends State { decoration: const InputDecoration( label: Text('Title'), ), + style: TextStyle( + color: Theme.of(context).colorScheme.onBackground), ), TextFormField( onChanged: (value) => recipe.description = value, decoration: const InputDecoration( label: Text('Description'), ), + style: TextStyle( + color: Theme.of(context).colorScheme.onBackground), ), DropdownMenu( dropdownMenuEntries: DifficultyUtil.getDropdownList(), onSelected: (value) => recipe.difficulty = value, label: const Text('Difficulty'), + textStyle: TextStyle( + color: Theme.of(context).colorScheme.onBackground), ), ElevatedButton( onPressed: _openIngredientBottomSheet, @@ -87,27 +93,42 @@ class _CreateRecipeState extends State { recipe.ingredients.add(ingredient); }); + void _onIngredientRemoveTapped(int index) {} + Widget? _ingredientListBuilder(BuildContext context, int index) { final ingredient = recipe.ingredients.elementAt(index); - final textTheme = Theme.of(context).textTheme.titleMedium; - return Padding( - padding: const EdgeInsets.symmetric(vertical: 10), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + + return ListTile( + contentPadding: EdgeInsets.zero, + title: Text(ingredient.ingredient.title), + subtitle: ingredient.optional ? const Text('optional') : null, + trailing: Row( + mainAxisSize: MainAxisSize.min, children: [ - Text(ingredient.ingredient.title, style: textTheme), - Row( - children: [ - Text( - ingredient.amount.toString(), - style: textTheme, - ), - const Padding(padding: EdgeInsets.symmetric(horizontal: 2)), - Text( - ingredient.unit.name, - style: textTheme, - ), - ], + Text( + ingredient.amount.toString(), + style: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith(color: Theme.of(context).colorScheme.onBackground), + ), + const Padding(padding: EdgeInsets.symmetric(horizontal: 2)), + Text( + ingredient.unit.name, + style: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith(color: Theme.of(context).colorScheme.onBackground), + ), + const Padding(padding: EdgeInsets.symmetric(horizontal: 5)), + SizedBox( + width: 30, + height: 30, + child: IconButton( + padding: EdgeInsets.zero, + onPressed: () => _onIngredientRemoveTapped(index), + icon: const Icon(Icons.delete), + ), ), ], ), diff --git a/lib/theme.dart b/lib/theme.dart index a3d489f..af757f3 100644 --- a/lib/theme.dart +++ b/lib/theme.dart @@ -4,7 +4,7 @@ final _baseTheme = ThemeData( fontFamily: "Ubuntu", useMaterial3: true, ).copyWith( - dividerTheme: const DividerThemeData(indent: 20, endIndent: 20), + dividerTheme: const DividerThemeData(indent: 0, endIndent: 0), ); final lightTheme = _baseTheme.copyWith( @@ -17,8 +17,11 @@ final lightTheme = _baseTheme.copyWith( )); final darkTheme = _baseTheme.copyWith( - colorScheme: ColorScheme.fromSeed( - seedColor: Colors.purple.shade100, - brightness: Brightness.dark, - ), + colorScheme: _darkColorScheme, + scaffoldBackgroundColor: _darkColorScheme.background, +); + +final _darkColorScheme = ColorScheme.fromSeed( + seedColor: Colors.purple.shade100, + brightness: Brightness.dark, );