Skip to content

Commit

Permalink
task: photoView on swipe image -details
Browse files Browse the repository at this point in the history
  • Loading branch information
Atuoha committed Oct 7, 2022
1 parent 9d22d73 commit 79ea302
Show file tree
Hide file tree
Showing 19 changed files with 24 additions and 5 deletions.
6 changes: 5 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:firebase_auth/firebase_auth.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:multivendor_shop/views/splash/entry.dart';
import 'constants/colors.dart';
import 'routes/routes.dart';
import 'firebase_options.dart';

Expand All @@ -29,7 +30,10 @@ class _MultiVendorState extends State<MultiVendor> {
Widget build(BuildContext context) {
return MaterialApp(
title: 'MultiVendor App',
theme: ThemeData(fontFamily: 'Roboto'),
theme: ThemeData(
fontFamily: 'Roboto',
primaryColor: primaryColor,
),
debugShowCheckedModeBanner: false,
home: const EntryScreen(),
routes: routes,
Expand Down
15 changes: 11 additions & 4 deletions lib/views/main/product/details.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:flutter/services.dart';
import 'package:multivendor_shop/components/loading.dart';
import '../../../constants/colors.dart';
import 'package:flutter_swiper_null_safety/flutter_swiper_null_safety.dart';
import 'package:photo_view/photo_view.dart';

class DetailsScreen extends StatefulWidget {
const DetailsScreen({
Expand Down Expand Up @@ -49,7 +50,7 @@ class _DetailsScreenState extends State<DetailsScreen> {

final Stream<QuerySnapshot> similarProducts = firestore
.collection('products')
.where('sub_category', isEqualTo: product['sub_category'])
.where('category', isEqualTo: product['category'])
.snapshots();

return Scaffold(
Expand Down Expand Up @@ -117,9 +118,15 @@ class _DetailsScreenState extends State<DetailsScreen> {
builder: SwiperPagination.dots,
),
itemCount: product['images'].length,
itemBuilder: (context, index) => Image.network(
product['images'][index],
fit: BoxFit.cover,
itemBuilder: (context, index) => PhotoView(
backgroundDecoration: const BoxDecoration(
color: Colors.transparent,
),
maxScale: 100.0,
imageProvider: NetworkImage(
product['images'][index],
// fit: BoxFit.cover,
),
),
),
),
Expand Down
7 changes: 7 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "5.0.0"
photo_view:
dependency: "direct main"
description:
name: photo_view
url: "https://pub.dartlang.org"
source: hosted
version: "0.14.0"
platform:
dependency: transitive
description:
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ dependencies:
carousel_slider: ^4.1.1
path: ^1.8.1
flutter_swiper_null_safety: ^1.0.2
photo_view: ^0.14.0

dev_dependencies:
flutter_test:
Expand Down
File renamed without changes
Binary file added screenshots/detail_1_1_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/detail_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/detail_2_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/detail_2_2_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/detail_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/detail_3_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/detail_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/detail_4_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/details_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/detial_1_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes

0 comments on commit 79ea302

Please sign in to comment.