Fix: some design fixes

This commit is contained in:
2024-06-12 02:03:20 +03:00
parent c0c3ef2ca0
commit 27da063c34
3 changed files with 59 additions and 43 deletions

View File

@@ -1,4 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:label="Example Gym App"
android:name="${applicationName}"
@@ -31,7 +32,6 @@
android:name="flutterEmbedding"
android:value="2" />
</application>
<uses-permission android:name="android.permission.INTERNET" />
<!-- Required to query activities that can process text, see:
https://developer.android.com/training/package-visibility?hl=en and
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.

View File

@@ -15,10 +15,10 @@ class ProductCard extends StatelessWidget {
});
double getCardHeight({required BuildContext context}) {
if (MediaQuery.of(context).size.width > 600) {
return 200;
if (MediaQuery.of(context).size.width > 400) {
return 300;
}
return 100;
return 160;
}
@override
@@ -27,7 +27,9 @@ class ProductCard extends StatelessWidget {
onTap: onTap,
child: ConstrainedBox(
constraints: BoxConstraints(
minHeight: 80, maxHeight: getCardHeight(context: context)),
minHeight: 160,
maxHeight: getCardHeight(context: context),
),
child: Card(
elevation: 3,
color: Theme.of(context).scaffoldBackgroundColor,
@@ -42,7 +44,8 @@ class ProductCard extends StatelessWidget {
const SizedBox(height: 16),
Text(
name,
style: Theme.of(context).textTheme.titleLarge,
style: Theme.of(context).textTheme.titleMedium,
maxLines: 2,
),
const SizedBox(height: 8),
Text(

View File

@@ -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,7 +213,9 @@ class _MainPageState extends State<MainPage> {
],
),
),
SizedBox(
Align(
alignment: Alignment.centerLeft,
child: SizedBox(
height: 60,
child: ListView.builder(
scrollDirection: Axis.horizontal,
@@ -246,6 +248,7 @@ class _MainPageState extends State<MainPage> {
);
}),
),
),
Expanded(
child: LazyLoadScrollView(
onEndOfPage: _onLoad,
@@ -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(
'Конец списка',