-
Notifications
You must be signed in to change notification settings - Fork 147
feat: Flutter SDK update for version 20.3.1 #284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| import 'package:appwrite/appwrite.dart'; | ||
|
|
||
| Client client = Client() | ||
| .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint | ||
| .setProject('<YOUR_PROJECT_ID>'); // Your project ID | ||
|
|
||
| Avatars avatars = Avatars(client); | ||
|
|
||
| // Downloading file | ||
| UInt8List bytes = await avatars.getScreenshot( | ||
| url: 'https://example.com', | ||
| headers: {}, // optional | ||
| viewportWidth: 1, // optional | ||
| viewportHeight: 1, // optional | ||
| scale: 0.1, // optional | ||
| theme: .light, // optional | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix enum reference syntax. The enum values are referenced with a leading dot without proper qualification. In Dart, enum values must be prefixed with the enum type or imported with a prefix. Apply this diff to fix the enum references: - theme: .light, // optional
+ theme: enums.Theme.light, // optional- timezone: .africaAbidjan, // optional
+ timezone: enums.Timezone.africaAbidjan, // optional- output: .jpg, // optional
+ output: enums.Output.jpg, // optionalThe same corrections apply to lines 44, 48, and 58 in the second example. Also applies to: 20-20, 30-30 🤖 Prompt for AI Agents |
||
| userAgent: '<USER_AGENT>', // optional | ||
| fullpage: false, // optional | ||
| locale: '<LOCALE>', // optional | ||
| timezone: .africaAbidjan, // optional | ||
| latitude: -90, // optional | ||
| longitude: -180, // optional | ||
| accuracy: 0, // optional | ||
| touch: false, // optional | ||
| permissions: [], // optional | ||
| sleep: 0, // optional | ||
| width: 0, // optional | ||
| height: 0, // optional | ||
| quality: -1, // optional | ||
| output: .jpg, // optional | ||
| ) | ||
|
|
||
| final file = File('path_to_file/filename.ext'); | ||
| file.writeAsBytesSync(bytes); | ||
|
|
||
| // Displaying image preview | ||
| FutureBuilder( | ||
| future: avatars.getScreenshot( | ||
| url:'https://example.com' , | ||
| headers:{} , // optional | ||
| viewportWidth:1 , // optional | ||
| viewportHeight:1 , // optional | ||
| scale:0.1 , // optional | ||
| theme: .light, // optional | ||
| userAgent:'<USER_AGENT>' , // optional | ||
| fullpage:false , // optional | ||
| locale:'<LOCALE>' , // optional | ||
| timezone: .africaAbidjan, // optional | ||
| latitude:-90 , // optional | ||
| longitude:-180 , // optional | ||
| accuracy:0 , // optional | ||
| touch:false , // optional | ||
| permissions:[] , // optional | ||
| sleep:0 , // optional | ||
| width:0 , // optional | ||
| height:0 , // optional | ||
| quality:-1 , // optional | ||
| output: .jpg, // optional | ||
| ), // Works for both public file and private file, for private files you need to be logged in | ||
| builder: (context, snapshot) { | ||
| return snapshot.hasData && snapshot.data != null | ||
| ? Image.memory(snapshot.data) | ||
| : CircularProgressIndicator(); | ||
| } | ||
| ); | ||
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.
Fix type name typo.
Line 10 uses
UInt8Listbut should beUint8List(lowercase 'int').Apply this diff:
📝 Committable suggestion
🤖 Prompt for AI Agents