refactor: убрал закоментированный код
This commit is contained in:
parent
c087b6a2a2
commit
8132957bf2
@ -81,7 +81,10 @@ class _BodyState extends State<_Body> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top),
|
||||
padding: EdgeInsets.only(top: MediaQuery
|
||||
.of(context)
|
||||
.padding
|
||||
.top),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
@ -94,7 +97,8 @@ class _BodyState extends State<_Body> {
|
||||
controller: searchController,
|
||||
placeholder: context.locale.search,
|
||||
onChanged: (search) {
|
||||
Debounce.run(() => context
|
||||
Debounce.run(() =>
|
||||
context
|
||||
.read<HomeBloc>()
|
||||
.add(HomeLoadDataEvent(search: search)));
|
||||
},
|
||||
@ -121,10 +125,12 @@ class _BodyState extends State<_Body> {
|
||||
],
|
||||
),
|
||||
BlocBuilder<HomeBloc, HomeState>(
|
||||
builder: (context, state) => state.error != null
|
||||
builder: (context, state) =>
|
||||
state.error != null
|
||||
? Text(
|
||||
state.error ?? '',
|
||||
style: Theme.of(context)
|
||||
style: Theme
|
||||
.of(context)
|
||||
.textTheme
|
||||
.headlineSmall
|
||||
?.copyWith(color: Colors.red),
|
||||
@ -161,7 +167,8 @@ class _BodyState extends State<_Body> {
|
||||
),
|
||||
),
|
||||
BlocBuilder<HomeBloc, HomeState>(
|
||||
builder: (context, state) => state.isPaginationLoading
|
||||
builder: (context, state) =>
|
||||
state.isPaginationLoading
|
||||
? const CircularProgressIndicator()
|
||||
: const SizedBox.shrink(),
|
||||
),
|
||||
@ -205,27 +212,3 @@ class _BodyState extends State<_Body> {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// final data = ApiRepository().loadData();
|
||||
// return Center(
|
||||
// child: FutureBuilder<List<CardData>?>(
|
||||
// future: data,
|
||||
// builder: (context, snapshot) => SingleChildScrollView(
|
||||
// child: snapshot.hasData
|
||||
// ? Column(
|
||||
// mainAxisAlignment: MainAxisAlignment.center,
|
||||
// children: snapshot.data
|
||||
// ?.map((data) => CardPost.fromData(data,
|
||||
// onLike: (String title, bool isLiked) =>
|
||||
// _showSnackBar(context, title, isLiked),
|
||||
// onTap: () => _navToDetails(context, data)))
|
||||
// .toList() ??
|
||||
// [])
|
||||
// : const CircularProgressIndicator(),
|
||||
// ),
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
|
Loading…
x
Reference in New Issue
Block a user