Conversation
@karan-17, sorry, the PR needed to be created during Hacktoberfest for it to qualify. |
@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! |
We would love to add your contribution! Feel free to reach out on discord if you need assistance. |
Hey! @stnguyen90 what is the expected timeline for getting this PR reviewed for conflicts and merged in the main repository?? |
@karan-17 It'll be a while as we have a lot of PRs to review. |
There was a problem hiding this 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.
'read', | ||
'write', |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
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'; |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this needed?
@karan-17 have you had a chance to address the comments? |
@stnguyen90 I will be available to make the required changes post-January, as I'm having a project deadline. The delay is highly regretted! |
Too out of date. |
#<!--
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.)