appwrite / appwrite/sdk-for-dart

🐛 Bug Report: Error: Method 'toMap' cannot be called on 'BillingLimits?' because it is potentially null

Open Beginner friendly
#117 0 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
Dart
Stars
118
Forks
22
Avg merge
8h 16m
Merged PRs (30d)
3

Description

### 👟 Reproduction steps

dart ./server.dart

.pub-cache/hosted/pub.dev/dart_appwrite-24.1.0/lib/src/models/project.dart:178:38: Error: Method 'toMap' cannot be called on 'BillingLimits?' because it is potentially null.
- 'BillingLimits' is from 'package:dart_appwrite/models.dart' ('.pub-cache/hosted/pub.dev/dart_appwrite-24.1.0/lib/models.dart').
Try calling using ?. instead.
"billingLimits": billingLimits.toMap(),

### 👍 Expected behavior

Compatibility with dart language standarts

### 👎 Actual Behavior

null check ignored

### 🎲 Appwrite version

Different version (specify in environment)

### 💻 Operating system

Linux

### 🧱 Your Environment

appwrite Version 1.9.0 - sorry, you won't fix appwrite version dropdown and I won't upload my env

### 👀 Have you spent some time to check if this issue has been raised before?

- [x] I checked and didn't find similar issue

### 🏢 Have you read the Code of Conduct?

- [x] I have read the [Code of Conduct](https://github.com/appwrite/appwrite/blob/HEAD/CODE_OF_CONDUCT.md)

Contributor guide

Open the contributing guide

Research direction

Start with .pub-cache/hosted/pub.dev/dart_appwrite-24.1.0/lib/src/models/project.dart around line 178 and inspect the BillingLimits declaration and its generated model usage. Reproduce the Dart null-safety error with `dart ./server.dart`, then verify the project model compiles without the reported nullable-method error.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.