Skip to content

Commit

Permalink
Download Images Done
Browse files Browse the repository at this point in the history
  • Loading branch information
Debajyoti14 committed Aug 16, 2023
1 parent c5583e3 commit f7824c1
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 23 deletions.
6 changes: 6 additions & 0 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -834,6 +834,8 @@ PODS:
- AppAuth/Core (~> 1.6)
- GTMSessionFetcher/Core (< 3.0, >= 1.5)
- GTMSessionFetcher/Core (2.3.0)
- image_downloader (0.0.1):
- Flutter
- image_picker_ios (0.0.1):
- Flutter
- leveldb-library (1.22.2)
Expand Down Expand Up @@ -875,6 +877,7 @@ DEPENDENCIES:
- gallery_saver (from `.symlinks/plugins/gallery_saver/ios`)
- geolocator_apple (from `.symlinks/plugins/geolocator_apple/ios`)
- google_sign_in_ios (from `.symlinks/plugins/google_sign_in_ios/ios`)
- image_downloader (from `.symlinks/plugins/image_downloader/ios`)
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- pdf_render (from `.symlinks/plugins/pdf_render/ios`)
Expand Down Expand Up @@ -934,6 +937,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/geolocator_apple/ios"
google_sign_in_ios:
:path: ".symlinks/plugins/google_sign_in_ios/ios"
image_downloader:
:path: ".symlinks/plugins/image_downloader/ios"
image_picker_ios:
:path: ".symlinks/plugins/image_picker_ios/ios"
path_provider_foundation:
Expand Down Expand Up @@ -981,6 +986,7 @@ SPEC CHECKSUMS:
gRPC-Core: 17108291d84332196d3c8466b48f016fc17d816d
GTMAppAuth: 0ff230db599948a9ad7470ca667337803b3fc4dd
GTMSessionFetcher: 3a63d75eecd6aa32c2fc79f578064e1214dfdec2
image_downloader: 73e190d6c9f286f2649554051348d9cb319cd4b3
image_picker_ios: 4a8aadfbb6dc30ad5141a2ce3832af9214a705b5
leveldb-library: f03246171cce0484482ec291f88b6d563699ee06
nanopb: b552cce312b6c8484180ef47159bc0f65a1f0431
Expand Down
1 change: 1 addition & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ class _MyAppState extends State<MyApp> {
return Consumer<ThemeProvider>(
builder: (context, ThemeProvider themeNotifier, child) {
final provider = Provider.of<ThemeProvider>(context);
print(provider.darkTheme);
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'MamaVault',
Expand Down
2 changes: 1 addition & 1 deletion lib/resources/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ final darkThemeData = ThemeData(
elevation: 0,
),
bottomSheetTheme: const BottomSheetThemeData(
backgroundColor: AppColors.backgroundDark,
backgroundColor: Color.fromARGB(255, 14, 14, 23),
),
iconTheme: const IconThemeData(color: Colors.white),
floatingActionButtonTheme:
Expand Down
11 changes: 5 additions & 6 deletions lib/view/preview_doc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:gallery_saver/gallery_saver.dart';
import 'package:image_downloader/image_downloader.dart';
import 'package:interrupt/utils/date_formatter.dart';
import 'package:interrupt/utils/utils.dart';
import 'package:pdf_render/pdf_render_widgets.dart';

import '../resources/UI_constraints.dart';
Expand Down Expand Up @@ -92,11 +93,9 @@ class _PreviewDocScreenState extends State<PreviewDocScreen> {
PrimaryButton(
buttonTitle: 'Download',
onPressed: () async {
await GallerySaver.saveImage(widget.docURL).then((value) {
var snackBar =
const SnackBar(content: Text('Image Saved in Gallery'));
ScaffoldMessenger.of(context).showSnackBar(snackBar);
});
await ImageDownloader.downloadImage(widget.docURL).then(
(value) => Utils.toastMessage("Image Saved to your Gallery"),
);
},
)
],
Expand Down
13 changes: 6 additions & 7 deletions lib/view/upload_document.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,14 @@ class _DocumentUploadState extends State<DocumentUpload> {
allowMultiple: true,
);
if (result != null) {
PlatformFile fileDetails = result.files.first;
setState(() {
fileList = files;
isSelected = false;
fileExt = fileDetails.extension!;
});
files = result.paths.map((path) => File(path!)).toList();
}

PlatformFile fileDetails = result!.files.first;
setState(() {
fileList = files;
isSelected = false;
fileExt = fileDetails.extension!;
});
}

Future uploadFile(File? image) async {
Expand Down
1 change: 1 addition & 0 deletions lib/view_model/theme_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class ThemeProvider extends ChangeNotifier {
bool get darkTheme => _darkTheme;

set darkTheme(bool value) {
print("Setting Theme ---- $value");
_darkTheme = value;
darkThemePreference.setDarkTheme(value);
notifyListeners();
Expand Down
16 changes: 8 additions & 8 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -432,14 +432,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "10.5.0"
gallery_saver:
dependency: "direct main"
description:
name: gallery_saver
sha256: df8b7e207ca12d64c71e0710a7ee3bc48aa7206d51cc720716fedb1543a66712
url: "https://pub.dev"
source: hosted
version: "2.3.2"
geolocator:
dependency: "direct main"
description:
Expand Down Expand Up @@ -576,6 +568,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.3.0"
image_downloader:
dependency: "direct main"
description:
name: image_downloader
sha256: "2b1c1d1fcfb6677175d009af3fc86914aee07684c12ea061f380ef1f44cae8df"
url: "https://pub.dev"
source: hosted
version: "0.31.0"
image_picker:
dependency: "direct main"
description:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ dependencies:
flutter_svg: ^2.0.1
fluttertoast: ^8.2.2
font_awesome_flutter: ^10.4.0
gallery_saver: ^2.3.2
geolocator: ^8.0.0
google_fonts: ^4.0.3
google_sign_in: ^6.0.0
http: ^0.13.5
image_downloader: ^0.31.0
image_picker: ^0.8.3
logger: ^1.2.2
lottie: ^2.2.0
Expand Down

0 comments on commit f7824c1

Please sign in to comment.