这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
4f692fc
chore(gitignore): add .env to gitignore
ryanaidilp Sep 12, 2023
d2b8b38
chore(packages): install all required packages
ryanaidilp Sep 12, 2023
2e0c650
chore(test): remove unused test
ryanaidilp Sep 12, 2023
b330811
chore(env): add example env
ryanaidilp Sep 12, 2023
a8696bd
chore(config): add envied file and its generated file
ryanaidilp Sep 12, 2023
73d5f8c
chore(file): remove unused file
ryanaidilp Sep 12, 2023
e130f39
chore(base): create base usecase class
ryanaidilp Sep 12, 2023
85be729
chore(constant): add storage constant
ryanaidilp Sep 12, 2023
30ad740
chore(exceptions): create custom exceptions
ryanaidilp Sep 12, 2023
91dbb0a
chore(failures): add custom failures class
ryanaidilp Sep 12, 2023
aed1834
chore(di): add service locator file
ryanaidilp Sep 12, 2023
f76d343
chore(log): create logger class
ryanaidilp Sep 12, 2023
fc84a52
chore(typedef): create typedef file
ryanaidilp Sep 12, 2023
74aadbe
chore(local_storage): create base local storage class
ryanaidilp Sep 12, 2023
22c1ecb
chore(local_storage): add secure storage impl
ryanaidilp Sep 12, 2023
cb16039
chore(endpoint): add api endpoint class
ryanaidilp Sep 12, 2023
c66b192
chore(http): add http client, module, and setting
ryanaidilp Sep 12, 2023
12d911a
chore(interceptor): add logging and authenticator interceptor
ryanaidilp Sep 12, 2023
8d6f764
chore(http_modules): add base, list, and view http module
ryanaidilp Sep 12, 2023
7e9e192
chore(di): add register module
ryanaidilp Sep 12, 2023
8548f4e
chore(code): run dart format
ryanaidilp Sep 12, 2023
8f96e9d
chore(shared): add data availability enums
ryanaidilp Sep 12, 2023
28e905d
chore(entities): add pagination and api response entities
ryanaidilp Sep 12, 2023
1239d5c
chore(serializers): add custom serializers
ryanaidilp Sep 12, 2023
3b89c1b
chore(models): add pagination and api response models
ryanaidilp Sep 12, 2023
2d26726
fix(analysis): fix analysis issue
ryanaidilp Sep 12, 2023
8905bcf
chore(cspell): add words to cspell
ryanaidilp Sep 12, 2023
40a6020
test(helpers): add test injection helper
ryanaidilp Sep 12, 2023
adc17c0
test(helpers): add fixtures helper
ryanaidilp Sep 12, 2023
cf019e3
chore(entity): create domain entity
ryanaidilp Sep 12, 2023
d499799
chore(enums): add domain type enums
ryanaidilp Sep 12, 2023
9b7315f
chore(repository): add domain repository contract
ryanaidilp Sep 12, 2023
7a0fcdd
chore(usecase): add get domains use case
ryanaidilp Sep 12, 2023
20526b0
test(usecase): add fixture and test for get domains usecase
ryanaidilp Sep 12, 2023
945f72b
chore(models): add domain model
ryanaidilp Sep 12, 2023
56e4b44
chore(datasource): add domain remote data source
ryanaidilp Sep 12, 2023
3e0ee02
chore(repository): add domain repository implementation
ryanaidilp Sep 12, 2023
150f77a
chore(domains): create base file for domains
ryanaidilp Sep 12, 2023
c14a2c2
chore(list): add stadata list class
ryanaidilp Sep 12, 2023
fcb1acf
chore(view): create empty stadata view file
ryanaidilp Sep 12, 2023
1b52fc4
chore(di): run build_runner
ryanaidilp Sep 12, 2023
6233bdb
chore(sdk): add stadata flutter sdk initialization
ryanaidilp Sep 12, 2023
bf4ed88
chore(example): add example app
ryanaidilp Sep 12, 2023
9df6726
chore(test): add min code coverage
ryanaidilp Sep 12, 2023
cbc0d1f
chore(env): add env example to example app
ryanaidilp Sep 12, 2023
770b168
chore(env): add env to example app
ryanaidilp Sep 12, 2023
7b324f2
Merge pull request #2 from ryanaidilp/feature/core
ryanaidilp Sep 12, 2023
f5ae957
docs(README): update documentation
ryanaidilp Sep 12, 2023
911e033
chore(cspell): add words to cspell
ryanaidilp Sep 12, 2023
fb86d77
chore(pubspec): add homepage and publish to pub.dev
ryanaidilp Sep 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
API_BASE_URL=
13 changes: 10 additions & 3 deletions .github/cspell.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
"version": "0.2",
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
"dictionaries": ["vgv_allowed", "vgv_forbidden"],
"dictionaries": [
"vgv_allowed",
"vgv_forbidden"
],
"dictionaryDefinitions": [
{
"name": "vgv_allowed",
Expand All @@ -16,6 +19,10 @@
],
"useGitignore": true,
"words": [
"stadata_flutter_sdk"
"stadata_flutter_sdk",
"Stadata",
"Badan",
"Pusat",
"Statistik"
]
}
}
1 change: 1 addition & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ jobs:
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@v1
with:
flutter_channel: stable
min_coverage: 15
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,7 @@ app.*.symbols
app.*.map.json

# Test related
coverage
coverage

# Environment Variable
.env
69 changes: 66 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,88 @@
[![Powered by Mason](https://img.shields.io/endpoint?url=https%3A%2F%2Ftinyurl.com%2Fmason-badge)](https://github.com/felangel/mason)
[![License: MIT][license_badge]][license_link]

A Very Good Project created by Very Good CLI.
# stadata_flutter_sdk

## Description

The **stadata_flutter_sdk** is a powerful and user-friendly Flutter SDK designed to seamlessly integrate with the official API offered by the Badan Pusat Statistik (BPS) Statistic of the Republic of Indonesia. This SDK empowers Flutter developers to effortlessly access a wealth of statistical data and information directly from BPS's extensive database, enabling the creation of data-driven applications that provide valuable insights into various aspects of Indonesia's socio-economic landscape.

With **stadata_flutter_sdk**, you can harness the comprehensive data sets made available by BPS, covering a wide range of domains such as population, economy, demographics, and more. This SDK simplifies the process of fetching, processing, and presenting statistical data within your Flutter apps, ensuring a smooth and efficient user experience.

## Key Features

- **Seamless Integration:** Easily incorporate BPS Statistic of the Republic of Indonesia's data into your Flutter projects.
- **Rich Data Sources:** Access a vast repository of statistical data on Indonesia's diverse economic and demographic aspects.
- **User-Friendly:** Designed with developers in mind, making it straightforward to utilize the API's functionalities.
- **Data Insights:** Create data-driven applications to provide valuable insights and visualizations to your users.
- **Up-to-Date:** Stay current with the latest data releases and updates from BPS.

Unlock the potential of BPS's statistical data with the **stadata_flutter_sdk** and empower your Flutter applications to provide users with valuable information and insights about Indonesia's dynamic landscape.

For detailed usage instructions and documentation of the BPS API, please refer to the [official documentation](https://webapi.bps.go.id/documentation/).

## Installation 💻

**❗ In order to start using Stadata Flutter Sdk you must have the [Flutter SDK][flutter_install_link] installed on your machine.**

Add `stadata_flutter_sdk` to your `pubspec.yaml`:
**Step 1:** Add `stadata_flutter_sdk` to your `pubspec.yaml` file:

```yaml
dependencies:
stadata_flutter_sdk:
git:
url: https://github.com/ryanaidilp/stadata_flutter_sdk.git
ref: main
```

Install it:
**Step 2:** Install the package:

```sh
flutter packages get
```

**Step 3:** Get your API Key:

Visit [https://webapi.bps.go.id/](https://webapi.bps.go.id/) to obtain your API Key.

**Step 4:** Initialize the SDK:

Inside your `main.dart` file, add the following code to initialize the SDK with your API Key:

```dart
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();

await StadataFlutter.instance.init(
apiKey: 'YOUR_API_KEY', // Replace 'YOUR_API_KEY' with your actual API Key
);
}
```

**Step 5:** Try the Example:

You can explore the SDK by checking out the [example](https://github.com/ryanaidilp/stadata_flutter_sdk/tree/develop/example). To run the example app, follow these steps:

- Create an `.env` file in the `example` directory or copy it from `.env.example`:

```sh
cp .env.example .env
```

- Generate `env.g.dart` by running the following command:

```sh
dart run build_runner build -d
```

- If the build is successful, you can run the example app:

```sh
flutter run
```

Now, you're ready to explore the capabilities of `stadata_flutter_sdk` in your Flutter application.

---

## Continuous Integration 🤖
Expand Down
7 changes: 7 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
include: package:very_good_analysis/analysis_options.5.0.0.yaml

analyzer:
exclude:
- "build/**"
- "**/*.config.dart"
- "**/*.g.dart"
- "**/*.freezed.dart"
1 change: 1 addition & 0 deletions example/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
API_KEY=
47 changes: 47 additions & 0 deletions example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/

# Symbolication related
app.*.symbols

# Obfuscation related
app.*.map.json

# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release

.env
/lib/config/env.g.dart
33 changes: 33 additions & 0 deletions example/.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.

version:
revision: "2524052335ec76bb03e04ede244b071f1b86d190"
channel: "stable"

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: 2524052335ec76bb03e04ede244b071f1b86d190
base_revision: 2524052335ec76bb03e04ede244b071f1b86d190
- platform: android
create_revision: 2524052335ec76bb03e04ede244b071f1b86d190
base_revision: 2524052335ec76bb03e04ede244b071f1b86d190
- platform: ios
create_revision: 2524052335ec76bb03e04ede244b071f1b86d190
base_revision: 2524052335ec76bb03e04ede244b071f1b86d190

# User provided section

# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
16 changes: 16 additions & 0 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# stadata_example

A new Flutter project.

## Getting Started

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)

For help getting started with Flutter development, view the
[online documentation](https://docs.flutter.dev/), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
28 changes: 28 additions & 0 deletions example/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.

# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml

linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at https://dart.dev/lints.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
13 changes: 13 additions & 0 deletions example/android/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
gradle-wrapper.jar
/.gradle
/captures/
/gradlew
/gradlew.bat
/local.properties
GeneratedPluginRegistrant.java

# Remember to never publicly share your keystore.
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
key.properties
**/*.keystore
**/*.jks
67 changes: 67 additions & 0 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

android {
namespace "stadata.example.app.stadata_example"
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "stadata.example.app.stadata_example"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}

buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}

flutter {
source '../..'
}

dependencies {}
7 changes: 7 additions & 0 deletions example/android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
Loading