diff --git a/lib/pages/add_recipe_url.dart b/lib/pages/add_recipe_url.dart index 5cf000a..9d7eec8 100644 --- a/lib/pages/add_recipe_url.dart +++ b/lib/pages/add_recipe_url.dart @@ -34,46 +34,51 @@ class AddRecipeURLPageState extends State { children: [ Expanded( flex: 5, - child: InkWell( - onTap: () async { - showDialog(context: context, builder: (BuildContext context) { - return AlertDialog( - title: const Text("URL"), - content: TextFormField( - decoration: const InputDecoration( - hintText: "Recipe URL", - ), - initialValue: url ?? "", - onChanged: (String newUrl) { - setState(() { - tempUrl = newUrl; - }); - }, - ), - actions: [ - TextButton( - onPressed: () { - Navigator.pop(context); - }, - child: const Text("Cancel"), - ), - TextButton( - onPressed: () { - Navigator.pop(context); - url = tempUrl; + child: Container( + color: Colors.blue, + width: double.infinity, + child: TextButton( + onPressed: () async { + showDialog(context: context, builder: (BuildContext context) { + return AlertDialog( + title: const Text("URL"), + content: TextFormField( + decoration: const InputDecoration( + hintText: "Recipe URL", + ), + initialValue: url ?? "", + onChanged: (String newUrl) { setState(() { - fetchUrl(); + tempUrl = newUrl; }); }, - child: const Text("Fetch"), ), - ], - ); - }); - }, - child: Text(url ?? "?"), - ), + actions: [ + TextButton( + onPressed: () { + Navigator.pop(context); + }, + child: const Text("Cancel"), + ), + TextButton( + onPressed: () { + Navigator.pop(context); + url = tempUrl; + setState(() { + fetchUrl(); + }); + }, + child: const Text("Fetch"), + ), + ], + ); + }); + }, + child: Text(url ?? "Tap to load URL", style: const TextStyle(color: Colors.white)), + ), + ), ), + const Divider(), Expanded( flex: 45, child: ListView( diff --git a/todo.md b/todo.md index 8f172ff..32a1b76 100644 --- a/todo.md +++ b/todo.md @@ -13,8 +13,7 @@ - RecipeStep.waitUnit should probably be an enum? - refactor to const page names instead of loose strings everywhere ('/path/page') - also do this with hive box names -- make the url fetching less shit - - probably use a stream for adding to the listview ? +- probably use a stream for adding fetched url data to the listview ? ## Bug - add option to start recipe step instruction after step datetime and not completed