-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(pages): add pages docs for unit, vervar, & var
- Loading branch information
1 parent
2d78f32
commit b4ceb9f
Showing
11 changed files
with
373 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Units | ||
|
||
This method is used to retrieve a list of units based on the selected domain (region). | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| ------------ | -------------- | ----------------------------------------------------- | | ||
| `domain` | `String` | Domain code (region) to retrieve units. | | ||
| `lang` | `DataLanguage` | Language for units data (default: `DataLanguage.id`). | | ||
| `page` | `int` | Page number (default: `1`). | | ||
| `variableID` | `int?` | Variable ID of the units (optional). | | ||
|
||
## Examples | ||
|
||
Example usage and output: | ||
|
||
```dart | ||
// Fetch units data from BPS | ||
final result = await StadataFlutter.instance.list.units( | ||
domain: 'example_domain_code', // Replace with the desired domain code | ||
lang: DataLanguage.id, | ||
page: 1, | ||
variableID: 'example_variable_id', // Replace with the desired variable ID or null | ||
); | ||
final units = result.data; | ||
final pagination = result.pagination; | ||
// Print page information | ||
print('Current page: ${pagination.page}'); | ||
print('Total Pages: ${pagination.pages}'); | ||
print('Total Data in This Page: ${pagination.count}'); | ||
print('PerPage: ${pagination.perPage}'); | ||
print('Total: ${pagination.total}'); | ||
print('------------------------'); | ||
// Print retrieved units data | ||
for (final unit in units) { | ||
print('Unit ID: ${unit.id}'); | ||
print('Title: ${unit.title}'); | ||
} | ||
``` | ||
|
||
## Properties (UnitData) | ||
|
||
| Property | Type | Description | | ||
| -------- | -------- | ----------------------------------- | | ||
| `id` | `int` | The unique identifier for the Unit. | | ||
| `title` | `String` | The title of the Unit. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# Variables | ||
|
||
This method is used to retrieve a list of variables based on the selected domain (region). | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| ---------------------- | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| `domain` | `String` | Domain code (region) to retrieve variables. | | ||
| `lang` | `DataLanguage` | Language for variables data (default: `DataLanguage.id`). | | ||
| `page` | `int` | Page number (default: `1`). | | ||
| `subjectID` | `int?` | Variable ID of the variables (optional). | | ||
| `showExistingVariable` | `bool` | A boolean flag to determine whether to only show variables that have values for the specified domain. When set to `true`, the function translates this to the `area` query parameter with a value of 1, filtering the variables to include only those that have existing values in the domain (default: `false`) | | ||
| `year` | `int?` | (Optional) The specific year for which variables are being requested. | | ||
|
||
## Examples | ||
|
||
Example usage and output: | ||
|
||
```dart | ||
// Fetch variables data from BPS | ||
final result = await StadataFlutter.instance.list.variables( | ||
domain: 'example_domain_code', // Replace with the desired domain code | ||
lang: DataLanguage.id, | ||
page: 1, | ||
showExistingVariable: false, | ||
year: 2020, | ||
subjectID: 'example_subject_id', // Replace with the desired subject ID or null | ||
); | ||
final variables = result.data; | ||
final pagination = result.pagination; | ||
// Print page information | ||
print('Current page: ${pagination.page}'); | ||
print('Total Pages: ${pagination.pages}'); | ||
print('Total Data in This Page: ${pagination.count}'); | ||
print('PerPage: ${pagination.perPage}'); | ||
print('Total: ${pagination.total}'); | ||
print('------------------------'); | ||
// Print retrieved variables data | ||
for (final variable in variables) { | ||
print('Variable ID: ${unit.id}'); | ||
print('Title: ${unit.title}'); | ||
print('Subject ID: ${unit.subjectID}'); | ||
print('Subject Name: ${unit.subjectName}'); | ||
print('Vertical Variable ID: ${unit.verticalVariableID}'); | ||
print('CSA Subject Name: ${unit.csaSubjectName}'); | ||
print('Graph Name: ${unit.graphName}'); | ||
print('Notes: ${unit.notes}'); | ||
print('Unit: ${unit.unit}'); | ||
print('Type: ${unit.type}'); | ||
print('Derived Period ID: ${unit.derivedPeriodID}'); | ||
print('Derived Variable ID: ${unit.derivedVariableID}'); | ||
} | ||
``` | ||
|
||
## Properties (Variable) | ||
|
||
| Property | Type | Description | | ||
| -------------------- | --------- | ------------------------------------------------------------------------------- | | ||
| `id` | `int` | The unique identifier for the Variable. | | ||
| `title` | `String` | The official title or label of the variable | | ||
| `subjectID` | `int` | An identifier for the sub-category of the variable. | | ||
| `subjectName` | `String` | The name of the subject to which the variable belongs. | | ||
| `verticalVariableID` | `int` | An identifier for the vertical variable. | | ||
| `csaSubjectName` | `String?` | The name of the cross-sectional subject related to the variable, if applicable. | | ||
| `graphName` | `String` | A descriptive name used for graphing purposes. | | ||
| `notes` | `String` | Additional notes or descriptions about the variable. | | ||
| `unit` | `String` | The measurement unit of the variable. | | ||
| `type` | `int?` | The type of the variable, if applicable. | | ||
| `derivedPeriodID` | `int?` | The identifier for the derived period, if applicable. | | ||
| `derivedVariableID` | `int?` | The identifier for the derived variable, if applicable. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Vertical Variables | ||
|
||
This method is used to retrieve a list of vertical variables based on the selected domain (region). | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| ------------ | -------------- | ------------------------------------------------------------------ | | ||
| `domain` | `String` | Domain code (region) to retrieve vertical variables. | | ||
| `lang` | `DataLanguage` | Language for vertical variables data (default: `DataLanguage.id`). | | ||
| `page` | `int` | Page number (default: `1`). | | ||
| `variableID` | `int?` | Variable ID of the vertical variables (optional). | | ||
|
||
## Examples | ||
|
||
Example usage and output: | ||
|
||
```dart | ||
// Fetch vertical variables data from BPS | ||
final result = await StadataFlutter.instance.list.verticalVariables( | ||
domain: 'example_domain_code', // Replace with the desired domain code | ||
lang: DataLanguage.id, | ||
page: 1, | ||
variableID: 'example_variable_id', // Replace with the desired variable ID or null | ||
); | ||
final variables = result.data; | ||
final pagination = result.pagination; | ||
// Print page information | ||
print('Current page: ${pagination.page}'); | ||
print('Total Pages: ${pagination.pages}'); | ||
print('Total Data in This Page: ${pagination.count}'); | ||
print('PerPage: ${pagination.perPage}'); | ||
print('Total: ${pagination.total}'); | ||
print('------------------------'); | ||
// Print retrieved variables data | ||
for (final variable in variables) { | ||
print('Vertical Variable ID: ${unit.id}'); | ||
print('Title: ${unit.title}'); | ||
print('Item ID: ${unit.itemID}'); | ||
print('Group ID: ${unit.groupID}'); | ||
print('Group Name: ${unit.groupName}'); | ||
} | ||
``` | ||
|
||
## Properties (VerticalVariable) | ||
|
||
| Property | Type | Description | | ||
| ----------- | --------- | ----------------------------------------------------------------------- | | ||
| `id` | `int` | The unique identifier for the Vertical Variable. | | ||
| `title` | `String` | The official title or label of the vertical variable. | | ||
| `itemID` | `int` | It specifies a particular item or element within the vertical variable. | | ||
| `groupID` | `int?` | This identifies the group to which the variable belongs. | | ||
| `groupName` | `String?` | It indicates the name of the group associated with the variable. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
docs/i18n/id/docusaurus-plugin-content-docs/current/api-docs/list/units.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Satuan | ||
|
||
Metode ini digunakan untuk mengambil daftar satuan berdasarkan domain yang dipilih (wilayah). | ||
|
||
## Parameters | ||
|
||
| Parameter | Tipe | Deskripsi | | ||
| ------------ | -------------- | ------------------------------------------------------ | | ||
| `domain` | `String` | Kode domain (wilayah) untuk mengambil satuan. | | ||
| `lang` | `DataLanguage` | Bahasa untuk data satuan (default: `DataLanguage.id`). | | ||
| `page` | `int` | Nomor halaman (default: `1`). | | ||
| `variableID` | `int?` | ID Variable dari satuan (opsional). | | ||
|
||
## Contoh | ||
|
||
Contoh penggunaan dan keluaran contoh: | ||
|
||
```dart | ||
// Fetch units data from BPS | ||
final result = await StadataFlutter.instance.list.units( | ||
domain: 'kode_domain_contoh', // Ganti dengan kode domain yang diinginkan | ||
lang: DataLanguage.id, | ||
page: 1, | ||
variableID: 'contoh_kata_kunci', // Ganti dengan ID variabel yang diinginkan atau null | ||
); | ||
final units = result.data; | ||
final pagination = result.pagination; | ||
// Mencetak informasi halaman | ||
print('Current page: ${pagination.page}'); | ||
print('Total Pages: ${pagination.pages}'); | ||
print('Total Data in This Page: ${pagination.count}'); | ||
print('PerPage: ${pagination.perPage}'); | ||
print('Total: ${pagination.total}'); | ||
print('------------------------'); | ||
// Mencetak data satuan yang diambil | ||
for (final unit in units) { | ||
print('Unit ID: ${unit.id}'); | ||
print('Title: ${unit.title}'); | ||
} | ||
``` | ||
|
||
## Properti (UnitData) | ||
|
||
| Properti | Tipe | Deskripsi | | ||
| -------- | -------- | ---------------------------- | | ||
| `id` | `int` | Identifier unik dari satuan. | | ||
| `title` | `String` | Nama/Judul satuan. | |
74 changes: 74 additions & 0 deletions
74
docs/i18n/id/docusaurus-plugin-content-docs/current/api-docs/list/variables.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# Variabel | ||
|
||
Metode ini digunakan untuk mengambil daftar variabel berdasarkan domain yang dipilih (wilayah). | ||
|
||
## Parameters | ||
|
||
| Parameter | Tipe | Deskripsi | | ||
| ---------------------- | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| `domain` | `String` | Kode domain (wilayah) untuk mengambil variabel. | | ||
| `lang` | `DataLanguage` | Bahasa untuk data variabel (bawaan: `DataLanguage.id`). | | ||
| `page` | `int` | Nomor halaman (bawaan: `1`). | | ||
| `subjectID` | `int?` | ID variabel dari variabel yang dipilih (opsional). | | ||
| `showExistingVariable` | `bool` | Digunakan untuk menentukan apakah hanya menampilkan variabel yang memiliki data berdasarkan domain yang ditentukan. Ketika diatur menjadi `true`, fungsi ini menerjemahkan data tersebut ke parameter kueri `area` dengan nilai 1, memfilter variabel untuk hanya menyertakan yang memiliki nilai yang ada di domain (bawaan: `false`) | | ||
| `year` | `int?` | (Opsional) Tahun spesifik untuk permintaan variabel. | | ||
|
||
## Contoh | ||
|
||
Contoh penggunaan dan keluaran contoh: | ||
|
||
```dart | ||
// Fetch variables data from BPS | ||
final result = await StadataFlutter.instance.list.variables( | ||
domain: 'example_domain_code', // Replace with the desired domain code | ||
lang: DataLanguage.id, | ||
page: 1, | ||
showExistingVariable: false, | ||
year: 2020, | ||
subjectID: 'example_subject_id', // Replace with the desired subject ID or null | ||
); | ||
final variables = result.data; | ||
final pagination = result.pagination; | ||
// Mencetak informasi halaman | ||
print('Current page: ${pagination.page}'); | ||
print('Total Pages: ${pagination.pages}'); | ||
print('Total Data in This Page: ${pagination.count}'); | ||
print('PerPage: ${pagination.perPage}'); | ||
print('Total: ${pagination.total}'); | ||
print('------------------------'); | ||
// Mencetak data variabel yang diambil | ||
for (final variable in variables) { | ||
print('Variable ID: ${unit.id}'); | ||
print('Title: ${unit.title}'); | ||
print('Subject ID: ${unit.subjectID}'); | ||
print('Subject Name: ${unit.subjectName}'); | ||
print('Vertical Variable ID: ${unit.verticalVariableID}'); | ||
print('CSA Subject Name: ${unit.csaSubjectName}'); | ||
print('Graph Name: ${unit.graphName}'); | ||
print('Notes: ${unit.notes}'); | ||
print('Unit: ${unit.unit}'); | ||
print('Type: ${unit.type}'); | ||
print('Derived Period ID: ${unit.derivedPeriodID}'); | ||
print('Derived Variable ID: ${unit.derivedVariableID}'); | ||
} | ||
``` | ||
|
||
## Properti (Variable) | ||
|
||
| Properti | Tipe | Deskripsi | | ||
| -------------------- | --------- | ------------------------------------------------------------------------ | | ||
| `id` | `int` | Pengenal unik untuk Variabel. | | ||
| `title` | `String` | Judul resmi atau label dari variabel | | ||
| `subjectID` | `int` | Pengenal untuk sub-kategori dari variabel. | | ||
| `subjectName` | `String` | Nama subjek di mana variabel tersebut berada. | | ||
| `verticalVariableID` | `int` | Pengenal untuk variabel vertikal. | | ||
| `csaSubjectName` | `String?` | Nama subjek lintas seksional yang terkait dengan variabel, jika berlaku. | | ||
| `graphName` | `String` | Nama deskriptif yang digunakan untuk keperluan grafis. | | ||
| `notes` | `String` | Catatan atau deskripsi tambahan tentang variabel. | | ||
| `unit` | `String` | Satuan pengukuran dari variabel. | | ||
| `type` | `int?` | Tipe dari variabel, jika berlaku. | | ||
| `derivedPeriodID` | `int?` | Pengenal untuk periode turunan, jika berlaku. | | ||
| `derivedVariableID` | `int?` | Pengenal untuk variabel turunan, jika berlaku. | |
Oops, something went wrong.