Added image download functionality
Getting these messages while running your branch.
Compiler message:
Error: Could not resolve the package 'image_downloader' in 'package:image_downloader/image_downloader.dart'.
Error: Could not resolve the package 'permission_handler' in 'package:permission_handler/permission_handler.dart'.
lib/screens/image_page.dart:7:8: Error: Not found: 'package:image_downloader/image_downloader.dart'
import 'package:image_downloader/image_downloader.dart';
^
lib/screens/image_page.dart:8:8: Error: Not found: 'package:permission_handler/permission_handler.dart'
import 'package:permission_handler/permission_handler.dart';
^
lib/screens/image_page.dart:267:7: Error: 'PermissionStatus' isn't a type.
PermissionStatus status = await PermissionHandler()
^^^^^^^^^^^^^^^^
lib/screens/image_page.dart:267:39: Error: The method 'PermissionHandler' isn't defined for the class '_ImagePageState'.
- '_ImagePageState' is from 'package:chitr/screens/image_page.dart' ('lib/screens/image_page.dart').
Try correcting the name to the name of an existing method, or defining a method named 'PermissionHandler'.
PermissionStatus status = await PermissionHandler()
^^^^^^^^^^^^^^^^^
lib/screens/image_page.dart:268:34: Error: The getter 'PermissionGroup' isn't defined for the class '_ImagePageState'.
- '_ImagePageState' is from 'package:chitr/screens/image_page.dart' ('lib/screens/image_page.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'PermissionGroup'.
.checkPermissionStatus(PermissionGroup.storage);
^^^^^^^^^^^^^^^
lib/screens/image_page.dart:270:21: Error: The getter 'PermissionStatus' isn't defined for the class '_ImagePageState'.
- '_ImagePageState' is from 'package:chitr/screens/image_page.dart' ('lib/screens/image_page.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'PermissionStatus'.
if (status == PermissionStatus.granted) {
^^^^^^^^^^^^^^^^
lib/screens/image_page.dart:274:31: Error: The getter 'ImageDownloader' isn't defined for the class '_ImagePageState'.
- '_ImagePageState' is from 'package:chitr/screens/image_page.dart' ('lib/screens/image_page.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'ImageDownloader'.
var imageId = await ImageDownloader.downloadImage(
^^^^^^^^^^^^^^^
lib/screens/image_page.dart:276:28: Error: The getter 'AndroidDestinationType' isn't defined for the class '_ImagePageState'.
- '_ImagePageState' is from 'package:chitr/screens/image_page.dart' ('lib/screens/image_page.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'AndroidDestinationType'.
destination: AndroidDestinationType.directoryDownloads);
^^^^^^^^^^^^^^^^^^^^^^
lib/screens/image_page.dart:293:5: Error: 'PermissionStatus' isn't a type.
PermissionStatus status = await PermissionHandler()
^^^^^^^^^^^^^^^^
lib/screens/image_page.dart:292:11: Error: The method 'PermissionHandler' isn't defined for the class '_ImagePageState'.
- '_ImagePageState' is from 'package:chitr/screens/image_page.dart' ('lib/screens/image_page.dart').
Try correcting the name to the name of an existing method, or defining a method named 'PermissionHandler'.
await PermissionHandler().requestPermissions([PermissionGroup.storage]);
^^^^^^^^^^^^^^^^^
lib/screens/image_page.dart:292:51: Error: The getter 'PermissionGroup' isn't defined for the class '_ImagePageState'.
- '_ImagePageState' is from 'package:chitr/screens/image_page.dart' ('lib/screens/image_page.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'PermissionGroup'.
await PermissionHandler().requestPermissions([PermissionGroup.storage]);
^^^^^^^^^^^^^^^
lib/screens/image_page.dart:293:37: Error: The method 'PermissionHandler' isn't defined for the class '_ImagePageState'.
- '_ImagePageState' is from 'package:chitr/screens/image_page.dart' ('lib/screens/image_page.dart').
Try correcting the name to the name of an existing method, or defining a method named 'PermissionHandler'.
PermissionStatus status = await PermissionHandler()
^^^^^^^^^^^^^^^^^
lib/screens/image_page.dart:294:32: Error: The getter 'PermissionGroup' isn't defined for the class '_ImagePageState'.
- '_ImagePageState' is from 'package:chitr/screens/image_page.dart' ('lib/screens/image_page.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'PermissionGroup'.
.checkPermissionStatus(PermissionGroup.storage);
^^^^^^^^^^^^^^^
lib/screens/image_page.dart:295:19: Error: The getter 'PermissionStatus' isn't defined for the class '_ImagePageState'.
- '_ImagePageState' is from 'package:chitr/screens/image_page.dart' ('lib/screens/image_page.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'PermissionStatus'.
if (status == PermissionStatus.granted) {
Sorry, the issue was with my compiler. Ignore the above message.
When I click on download button it shows me Toast that "Check notification to see progress" but there is no notification.
Are you running on emulator or real device? It works fine on the devices I have tested. I have implemented the same download module here : https://github.com/bimsina/reWalls .
@bimsina I was running on the real device. Although after a couple of hours I got all those notifications. Let me check why That was happening.