diff --git a/lib/presentation/home_page/home_page.dart b/lib/presentation/home_page/home_page.dart index c7867b2..4d183b2 100644 --- a/lib/presentation/home_page/home_page.dart +++ b/lib/presentation/home_page/home_page.dart @@ -29,53 +29,55 @@ class _MyHomePageState extends State { @override Widget build(BuildContext context) { - return Padding( - padding: EdgeInsets.only(top: MediaQuery - .of(context) - .padding - .top), - child: Column(children: [ - Padding( - padding: const EdgeInsets.all(12), - child: CupertinoSearchTextField( - controller: searchController, - style: const TextStyle(color: Colors.white), - onSubmitted: (search) { - setState(() { - data = repo.loadData(q: search); - }); - }, - ), - ), - Expanded( - child: Center( - child: FutureBuilder?>( - future: data, - builder: (context, snapshot) => - SingleChildScrollView( - child: snapshot.hasData - ? Column( - mainAxisAlignment: MainAxisAlignment.center, - children: snapshot.data?.map((data) { - return _MarketCard.fromData( - data, - onLike: (String title, bool isLiked) => - _showSnackBar(context, title, isLiked), - onTap: () => _navToDetails(context, data), - ); - }).toList() ?? - [], - ) - : const CircularProgressIndicator(), - ), + return Scaffold( + body: Padding( + padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top), + child: Column( + children: [ + Padding( + padding: const EdgeInsets.all(12), + child: CupertinoSearchTextField( + controller: searchController, + style: const TextStyle(color: Colors.white), + onSubmitted: (search) { + setState(() { + data = repo.loadData(q: search); + }); + }, ), ), - ), - ])); + Expanded( + child: Center( + child: FutureBuilder?>( + future: data, + builder: (context, snapshot) => SingleChildScrollView( + child: snapshot.hasData + ? Column( + mainAxisAlignment: MainAxisAlignment.center, + children: snapshot.data?.map((data) { + return _MarketCard.fromData( + data, + onLike: (String title, bool isLiked) => + _showSnackBar(context, title, isLiked), + onTap: () => _navToDetails(context, data), + ); + }).toList() ?? + [], + ) + : const CircularProgressIndicator(), + ), + ), + ), + ), + ], + ), + ), + ); } - void _showSnackBar(BuildContext context, String title, bool isLiked) { + + void _showSnackBar(BuildContext context, String title, bool isLiked) { WidgetsBinding.instance.addPostFrameCallback((_) { ScaffoldMessenger.of(context).showSnackBar(SnackBar( content: Text(