This commit is contained in:
Вячеслав Иванов 2024-09-24 22:27:49 +04:00
parent f80bc53118
commit 16f0f53745
11 changed files with 78 additions and 82 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB

BIN
assets/logo.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

View File

@ -10,27 +10,26 @@ class DetailsPage extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(),
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(bottom: 16.0),
child: Image.network(
data.image ?? '',
body: Padding(
padding: const EdgeInsets.all(20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Center(
child: Image.network(
data.image ?? '',
),
),
),
Padding(
padding: const EdgeInsets.only(bottom: 4.0),
child: Text(
data.text,
style: Theme.of(context).textTheme.headlineLarge,
),
),
Text(
data.descriptionText,
style: Theme.of(context).textTheme.bodyLarge,
)
],
const SizedBox(height: 20),
Text(data.text,
style:
const TextStyle(fontSize: 24, fontWeight: FontWeight.bold)),
const SizedBox(height: 10),
Text(data.descriptionText,
style: const TextStyle(fontSize: 22, color: Colors.black87)),
// Add more details here as needed
],
),
),
);
}

View File

@ -46,9 +46,9 @@ class _Card extends StatelessWidget {
onTap: onTap,
child: Container(
margin: const EdgeInsets.all(16),
constraints: const BoxConstraints(minHeight: 160),
constraints: const BoxConstraints(minHeight: 240),
decoration: BoxDecoration(
color: Colors.white70,
color: Colors.white30,
borderRadius: BorderRadius.circular(20),
boxShadow: [
BoxShadow(
@ -59,73 +59,70 @@ class _Card extends StatelessWidget {
),
],
),
child: IntrinsicHeight(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ClipRRect(
borderRadius: const BorderRadius.only(
bottomLeft: Radius.circular(20),
topLeft: Radius.circular(20),
),
child: SizedBox(
height: double.infinity,
width: 120,
child: Stack(
children: [
Positioned.fill(
child: Image.network(
image ?? '',
fit: BoxFit.cover,
errorBuilder: (_, __, ___) => const Placeholder(),
),
child: Column(
children: [
ClipRRect(
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(20),
topRight: Radius.circular(20),
),
child: SizedBox(
height: 160,
width: double.infinity,
child: Stack(
children: [
Positioned.fill(
child: Image.network(
image ?? '',
fit: BoxFit.contain,
errorBuilder: (_, __, ___) => const Placeholder(),
),
],
),
),
],
),
),
Expanded(
child: Padding(
padding: const EdgeInsets.only(left: 16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
text,
style: Theme.of(context).textTheme.headlineSmall,
),
Text(
descriptionText,
style: Theme.of(context).textTheme.bodyLarge,
)
],
),
Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
text,
style: Theme.of(context).textTheme.headlineSmall,
textAlign: TextAlign.center,
),
),
Text(
descriptionText,
style: Theme.of(context).textTheme.bodyLarge,
textAlign: TextAlign.center,
),
],
),
Align(
alignment: Alignment.bottomRight,
child: Padding(
padding: const EdgeInsets.only(left: 8, right: 16, bottom: 16),
child: GestureDetector(
onTap: () => onLike?.call(id, text, isLiked),
child: AnimatedSwitcher(
duration: const Duration(milliseconds: 200),
child: isLiked
? const Icon(
Icons.favorite,
color: Colors.redAccent,
key: ValueKey<int>(0),
)
: const Icon(
Icons.favorite_border,
key: ValueKey<int>(1),
),
),
Align(
alignment: Alignment.bottomRight,
child: Padding(
padding: const EdgeInsets.only(left: 8, right: 16, bottom: 16),
child: GestureDetector(
onTap: () => onLike?.call(id, text, isLiked),
child: AnimatedSwitcher(
duration: const Duration(milliseconds: 200),
child: isLiked
? const Icon(
Icons.favorite,
color: Colors.redAccent,
key: ValueKey<int>(0),
)
: const Icon(
Icons.favorite_border,
key: ValueKey<int>(1),
),
),
),
),
],
),
),
],
),
),
);

View File

@ -187,7 +187,7 @@ class _BodyState extends State<_Body> {
'$title ${isLiked ? context.locale.liked : context.locale.disliked}',
style: Theme.of(context).textTheme.bodyLarge,
),
backgroundColor: Colors.orangeAccent,
backgroundColor: Colors.white,
duration: const Duration(seconds: 1),
));
});

View File

@ -47,7 +47,7 @@ dev_dependencies:
flutter_icons:
android: "ic_launcher"
image_path: "assets/logo.png"
image_path: "assets/logo.jpg"
min_sdk_android: 21
flutter: