добавил немного красоты в 6 лабу
This commit is contained in:
parent
604a39379e
commit
c8115b9eca
@ -78,21 +78,9 @@ class _BodyState extends State<_Body> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top),
|
||||
child: Column(
|
||||
return Center(
|
||||
child: Stack(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(12),
|
||||
child: CupertinoSearchTextField(
|
||||
controller: searchController,
|
||||
onChanged: (search) {
|
||||
Debounce.run(() => context
|
||||
.read<HomeBloc>()
|
||||
.add(HomeLoadDataEvent(search: search)));
|
||||
},
|
||||
),
|
||||
),
|
||||
BlocBuilder<HomeBloc, HomeState>(
|
||||
builder: (context, state) => state.error != null
|
||||
? Text(
|
||||
@ -103,7 +91,7 @@ class _BodyState extends State<_Body> {
|
||||
?.copyWith(color: Colors.red),
|
||||
)
|
||||
: state.isLoading
|
||||
? const CircularProgressIndicator()
|
||||
? Center(child: CircularProgressIndicator())
|
||||
: Expanded(
|
||||
child: RefreshIndicator(
|
||||
onRefresh: _onRefresh,
|
||||
@ -114,11 +102,17 @@ class _BodyState extends State<_Body> {
|
||||
itemBuilder: (context, index) {
|
||||
if (index == 0) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(12),
|
||||
child: CupertinoSearchTextField(),
|
||||
);
|
||||
padding: const EdgeInsets.only(
|
||||
left: 8.0, right: 8),
|
||||
child: CupertinoSearchTextField(
|
||||
borderRadius: BorderRadius.only(
|
||||
bottomLeft: Radius.circular(20),
|
||||
bottomRight: Radius.circular(20),
|
||||
),
|
||||
backgroundColor: Colors.amberAccent,
|
||||
));
|
||||
}
|
||||
final data = state.data?.data?[index-1];
|
||||
final data = state.data?.data?[index - 1];
|
||||
return data != null
|
||||
? _Card.fromData(
|
||||
data,
|
||||
@ -132,11 +126,37 @@ class _BodyState extends State<_Body> {
|
||||
),
|
||||
),
|
||||
),
|
||||
BlocBuilder<HomeBloc, HomeState>(
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 8.0, right: 8),
|
||||
child: CupertinoSearchTextField(
|
||||
borderRadius: BorderRadius.only(
|
||||
bottomLeft: Radius.circular(20),
|
||||
bottomRight: Radius.circular(20),
|
||||
),
|
||||
backgroundColor: Colors.amberAccent,
|
||||
controller: searchController,
|
||||
onChanged: (search) {
|
||||
Debounce.run(() => context
|
||||
.read<HomeBloc>()
|
||||
.add(HomeLoadDataEvent(search: search)));
|
||||
},
|
||||
),
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: SizedBox(
|
||||
height: 50,
|
||||
width: 50,
|
||||
child: BlocBuilder<HomeBloc, HomeState>(
|
||||
builder: (context, state) => state.isPaginationLoading
|
||||
? const CircularProgressIndicator()
|
||||
: const SizedBox.shrink(),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user