Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MilawWork13 committed Jun 12, 2024
1 parent f9c3995 commit 64f3415
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 27 deletions.
57 changes: 36 additions & 21 deletions lib/view/recipe_detail_widget.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';

import 'package:shimmer/shimmer.dart';
import 'package:taste_hub/components/custom_arrowback.dart';
import 'package:taste_hub/components/favourite_button.dart';
import 'package:taste_hub/components/intruction_tile.dart';
Expand Down Expand Up @@ -81,23 +83,33 @@ class RecipeDetailScreenState extends State<RecipeDetailScreen> {
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.done &&
snapshot.hasData) {
return Container(
return CachedNetworkImage(
imageUrl: snapshot.data!,
width: double.infinity,
height: 300,
decoration: BoxDecoration(
image: DecorationImage(
image: NetworkImage(snapshot.data!),
fit: BoxFit.cover,
fit: BoxFit.cover,
placeholder: (context, url) => Shimmer.fromColors(
baseColor: Colors.grey[300]!,
highlightColor: Colors.grey[100]!,
child: Container(
decoration: const BoxDecoration(
color: Colors.white,
),
),
),
errorWidget: (context, url, error) => const Icon(Icons.error),
);
} else {
return const SizedBox(
return SizedBox(
height: 300,
child: Center(
child: SpinKitFadingCircle(
color: Color.fromARGB(255, 255, 71, 71),
size: 50.0,
child: Shimmer.fromColors(
baseColor: Colors.grey[300]!,
highlightColor: Colors.grey[100]!,
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(32),
color: Colors.white,
),
),
),
);
Expand Down Expand Up @@ -261,16 +273,19 @@ class RecipeDetailScreenState extends State<RecipeDetailScreen> {
Widget _buildTabBarView() {
return SingleChildScrollView(
physics: const NeverScrollableScrollPhysics(),
child: SizedBox(
height:
_calculateHeight(), // Calculates the height of tab bar view based on content
child: TabBarView(
children: [
_buildIngredientsList(), // Ingredients list
_buildInstructionsList(), // Instructions list
_buildInfoSection(), // Info section with allergens, creator info, and creation date
],
),
child: Column(
children: [
SizedBox(
height: _calculateHeight(),
child: TabBarView(
children: [
_buildIngredientsList(), // Ingredients list
_buildInstructionsList(), // Instructions list
_buildInfoSection(), // Info section with allergens, creator info, and creation date
],
),
),
],
),
);
}
Expand Down
12 changes: 6 additions & 6 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,10 @@ packages:
dependency: "direct main"
description:
name: file_picker
sha256: a7eed9716c82453da5c09d3a82d4644e7070dd2da81bfe5b6c6873ae4f07cf4f
sha256: "2ca051989f69d1b2ca012b2cf3ccf78c70d40144f0861ff2c063493f7c8c3d45"
url: "https://pub.dev"
source: hosted
version: "8.0.4"
version: "8.0.5"
file_selector_linux:
dependency: transitive
description:
Expand Down Expand Up @@ -333,18 +333,18 @@ packages:
dependency: transitive
description:
name: firebase_core_platform_interface
sha256: c437ae5d17e6b5cc7981cf6fd458a5db4d12979905f9aafd1fea930428a9fe63
sha256: "1003a5a03a61fc9a22ef49f37cbcb9e46c86313a7b2e7029b9390cf8c6fc32cb"
url: "https://pub.dev"
source: hosted
version: "5.0.0"
version: "5.1.0"
firebase_core_web:
dependency: transitive
description:
name: firebase_core_web
sha256: "22fcb352744908224fc7be3caae254836099786acfe5df6e9fe901e9c2575a41"
sha256: "6643fe3dbd021e6ccfb751f7882b39df355708afbdeb4130fc50f9305a9d1a3d"
url: "https://pub.dev"
source: hosted
version: "2.17.1"
version: "2.17.2"
firebase_storage:
dependency: "direct main"
description:
Expand Down

0 comments on commit 64f3415

Please sign in to comment.