Skip to content
This repository has been archived by the owner on Jan 26, 2024. It is now read-only.

Appwrite Issue #4276 #11

Closed
wants to merge 10 commits into from
Closed

Appwrite Issue #4276 #11

wants to merge 10 commits into from

Conversation

karan-17
Copy link

@karan-17 karan-17 commented Nov 1, 2022

#<!--
Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to appwrite here: https://github.com/appwrite/appwrite/blob/master/CONTRIBUTING.md

Happy contributing!

-->

What does this PR do?

This PR gives the demo-todo-with-flutter app the support of appwrite 1.0 platform.

Test Plan

The application is tested on the emulator and physical device as well after the application of the made changes.
The deprecated keywords are upgraded with appwrite 1.0 platform support such as "Database" has been changed to "Databases", etc.
The app constants are also included in the PR and the endpoint is also added to the constants.dart.

Related PRs and Issues

Issue related to this PR

Have you read the Contributing Guidelines on issues?

Yes
(Write your answer here.)

@stnguyen90
Copy link
Contributor

@karan-17, sorry, the PR needed to be created during Hacktoberfest for it to qualify.

@karan-17
Copy link
Author

karan-17 commented Nov 1, 2022

@stnguyen90 I have no issues with that, but if it can be a contribution for the AppWrite Organization, and as an open source too, it would be worth investing the time for me!
You can review the PR without adding hacktoberfest tag. ☺

@stnguyen90
Copy link
Contributor

@stnguyen90 I have no issues with that, but if it can be a contribution for the AppWrite Organization, and as an open source too, it would be worth investing the time for me! You can review the PR without adding hacktoberfest tag. ☺

We would love to add your contribution! Feel free to reach out on discord if you need assistance.

@karan-17
Copy link
Author

karan-17 commented Nov 5, 2022

Hey! @stnguyen90 what is the expected timeline for getting this PR reviewed for conflicts and merged in the main repository??

@stnguyen90
Copy link
Contributor

@karan-17 It'll be a while as we have a lot of PRs to review.

@stnguyen90 stnguyen90 linked an issue Nov 7, 2022 that may be closed by this pull request
4 tasks
@stnguyen90 stnguyen90 self-requested a review December 6, 2022 19:30
Copy link
Contributor

@stnguyen90 stnguyen90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't seem to build this project on Android:

Launching lib/main.dart on sdk gphone64 arm64 in debug mode...
lib/main.dart:1
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: unexpected element (uri:"", local:"extension-level"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level>
Warning: unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level>
: Error: Member not found: 'packageRoot'.
../…/interface/local_platform.dart:46
      io.Platform.packageRoot; // ignore: deprecated_member_use
                  ^^^^^^^^^^^



FAILURE: Build failed with an exception.

* Where:
Script '/Users/steven/development/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1156

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/Users/steven/development/flutter/bin/flutter'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 8s
Exception: Gradle task assembleDebug failed with exit code 1
Exited

Did you get everything working? Please see my other comments too.

Comment on lines +103 to +104
'read',
'write',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are incorrect permissions. Please refer to the Permissions docs.

import 'package:appwrite/appwrite.dart';
import 'package:easy_one/data/model/addData_model.dart';
import 'package:easy_one/data/model/user_model.dart';
import 'package:http/http.dart' as http;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is http needed for?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Http was added to create a Multipartfile request but will be needed to be changed as the InputFile needs to be used in place of http.MultipartFile.

@@ -272,7 +276,7 @@ class _HomePageState extends State<HomePage> {
source: ImageSource.gallery,
);
if (image == null) return;
final file = await MultipartFile.fromFile(image.path);
final file = await http.MultipartFile.fromPath('file', image.path);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

File should be an InputFile not http.MultipartFile. See the docs: https://appwrite.io/docs/client/storage?sdk=flutter-default#storageCreateFile

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I'll refer to the documentation once again, and make the required changes.

Comment on lines +2 to +6
static const String projectid = '6358f077598701771cb7';
static const String endPoint = 'http://192.168.1.12/v1';
static const String database = '6358f3893420e9ee5b8d';
static const String collectionId = '6358f3ab531448a7be76';
static const bucketId = '63617da0e1e0b810ca92';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't your IDE be auto-formatting this stuff?

cupertino_icons: ^1.0.2
flutter_staggered_grid_view: ^0.4.0
flutter_svg: ^0.22.0
image_picker: ^0.8.0+3
intl: ^0.17.0
shared_preferences: ^2.0.6
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why was shared_preferences added?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used this to keep the user logged in, as the user was not staying logged in to the device.

class LoginPage extends StatefulWidget {
@override
_LoginPageState createState() => _LoginPageState();
}

class _LoginPageState extends State<LoginPage> {
User user;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed?

@stnguyen90
Copy link
Contributor

@karan-17 have you had a chance to address the comments?

@karan-17
Copy link
Author

karan-17 commented Jan 9, 2023

@stnguyen90 I will be available to make the required changes post-January, as I'm having a project deadline. The delay is highly regretted!

@codercatdev
Copy link
Contributor

Too out of date.

@codercatdev codercatdev closed this Mar 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🪄 Upgrade ’demo-todo-with-flutter’ to Appwrite 1.0
3 participants