Fix: some design fixes
This commit is contained in:
@@ -154,10 +154,10 @@ class _MainPageState extends State<MainPage> {
|
||||
decoration: InputDecoration(
|
||||
hintText: 'Поиск',
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
borderRadius: BorderRadius.circular(50),
|
||||
),
|
||||
suffixIcon: Padding(
|
||||
padding: const EdgeInsets.only(right: 8),
|
||||
padding: const EdgeInsets.only(right: 5),
|
||||
child: ElevatedButton(
|
||||
onPressed: _onSearch,
|
||||
style: ElevatedButton.styleFrom(
|
||||
@@ -213,38 +213,41 @@ class _MainPageState extends State<MainPage> {
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 60,
|
||||
child: ListView.builder(
|
||||
scrollDirection: Axis.horizontal,
|
||||
shrinkWrap: true,
|
||||
itemCount: categories.length,
|
||||
itemBuilder: (context, index) {
|
||||
final category = categories[index];
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
selectedCategory =
|
||||
selectedCategory == category ? null : category;
|
||||
});
|
||||
_onSearch();
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10, vertical: 10),
|
||||
child: Chip(
|
||||
label: Text(category.name),
|
||||
backgroundColor: selectedCategory == category
|
||||
? Theme.of(context).primaryColor
|
||||
: Colors.white,
|
||||
labelStyle: TextStyle(
|
||||
color: selectedCategory == category
|
||||
? Colors.white
|
||||
: Colors.black),
|
||||
Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: SizedBox(
|
||||
height: 60,
|
||||
child: ListView.builder(
|
||||
scrollDirection: Axis.horizontal,
|
||||
shrinkWrap: true,
|
||||
itemCount: categories.length,
|
||||
itemBuilder: (context, index) {
|
||||
final category = categories[index];
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
selectedCategory =
|
||||
selectedCategory == category ? null : category;
|
||||
});
|
||||
_onSearch();
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10, vertical: 10),
|
||||
child: Chip(
|
||||
label: Text(category.name),
|
||||
backgroundColor: selectedCategory == category
|
||||
? Theme.of(context).primaryColor
|
||||
: Colors.white,
|
||||
labelStyle: TextStyle(
|
||||
color: selectedCategory == category
|
||||
? Colors.white
|
||||
: Colors.black),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
);
|
||||
}),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: LazyLoadScrollView(
|
||||
@@ -271,7 +274,9 @@ class _MainPageState extends State<MainPage> {
|
||||
200)
|
||||
.toInt(),
|
||||
8),
|
||||
childAspectRatio: 1.0),
|
||||
childAspectRatio: 0.8,
|
||||
mainAxisSpacing: 10.0,
|
||||
crossAxisSpacing: 40.0),
|
||||
itemCount: itemViewCount,
|
||||
itemBuilder: (context, index) {
|
||||
final product = filteredData[index];
|
||||
@@ -280,7 +285,7 @@ class _MainPageState extends State<MainPage> {
|
||||
image:
|
||||
Image.network(product.images[0].url)
|
||||
.image,
|
||||
width: 50,
|
||||
width: 120,
|
||||
),
|
||||
name: shortString(product.title),
|
||||
price: product.price.toStringAsFixed(2),
|
||||
@@ -310,9 +315,17 @@ class _MainPageState extends State<MainPage> {
|
||||
Radius.circular(50)),
|
||||
),
|
||||
foregroundColor: Colors.white,
|
||||
fixedSize: const Size(180, 40),
|
||||
),
|
||||
child: const Text('Загрузить ещё'),
|
||||
)
|
||||
child: const Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text('Загрузить ещё'),
|
||||
Spacer(),
|
||||
Icon(Icons.arrow_downward),
|
||||
Spacer()
|
||||
],
|
||||
))
|
||||
: const CircularProgressIndicator()
|
||||
: const Text(
|
||||
'Конец списка',
|
||||
|
||||
Reference in New Issue
Block a user