Skip to content

Commit

Permalink
feat : Create an example package for altfire_tracker (#51)
Browse files Browse the repository at this point in the history
* Create an example package for altfire_tracker

* fix: add MaterialApp

* add GoogleService-Info.plist to pbxproj section

* build: add GoogleService-Info.plist for macOS

* docs: Update README.md

* chore: Add launch configuration for altfire_tracker/example

* build: flutter create diff

* add new usage

* modified buttons

* modified AndroidManifest.xml

* Modified gitignore and readme.

* Modified pubspec.yaml

---------

Co-authored-by: Ryunosuke Muramatsu <[email protected]>
  • Loading branch information
k-nkmr and riscait authored Jan 24, 2024
1 parent 7946aad commit 7547028
Show file tree
Hide file tree
Showing 113 changed files with 3,968 additions and 33 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ unlinked_spec.ds
**/android/.settings
**/android/.project
**/android/service-account.json
**/android/app/src/main/res/mipmap*/
*.jks
*.keystore
!debug.keystore
Expand Down
7 changes: 7 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
"request": "launch",
"type": "dart",
"flutterMode": "debug"
},
{
"name": "altfire_tracker/example",
"cwd": "packages/altfire_tracker/example",
"request": "launch",
"type": "dart",
"flutterMode": "debug"
}
]
}
39 changes: 7 additions & 32 deletions packages/altfire_tracker/README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,14 @@
<!--
This README describes the package. If you publish this package to pub.dev,
this README's contents appear on the landing page for your package.
# AltFire Tracker

For information about how to write a good package README, see the guide for
[writing package pages](https://dart.dev/guides/libraries/writing-package-pages).
For general information about developing packages, see the Dart guide for
[creating packages](https://dart.dev/guides/libraries/create-library-packages)
and the Flutter guide for
[developing packages and plugins](https://flutter.dev/developing-packages).
-->

TODO: Put a short description of the package here that helps potential users
know whether this package might be useful for them.

## Features

TODO: List what your package can do. Maybe include images, gifs, or videos.
Provides a wrapper class for FlutterFire Analytics and Crashlytics packages to simplify its usage.

## Getting started

TODO: List prerequisites and provide or point to information on how to
start using the package.
### pubspec.yaml

## Usage

TODO: Include short and useful examples for package users. Add longer examples
to `/example` folder.

```dart
const like = 'sample';
```yaml
dependencies:
altfire_tracker: any
```
## Additional information

TODO: Tell users more about the package: where to find more information, how to
contribute to the package, how to file issues, what response they can expect
from the package authors, and more.
## Usage
43 changes: 43 additions & 0 deletions packages/altfire_tracker/example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# 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
.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
45 changes: 45 additions & 0 deletions packages/altfire_tracker/example/.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# 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: "7f20e5d18ce4cb80c621533090a7c5113f5bdc52"
channel: "stable"

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: 7f20e5d18ce4cb80c621533090a7c5113f5bdc52
base_revision: 7f20e5d18ce4cb80c621533090a7c5113f5bdc52
- platform: android
create_revision: 7f20e5d18ce4cb80c621533090a7c5113f5bdc52
base_revision: 7f20e5d18ce4cb80c621533090a7c5113f5bdc52
- platform: ios
create_revision: 7f20e5d18ce4cb80c621533090a7c5113f5bdc52
base_revision: 7f20e5d18ce4cb80c621533090a7c5113f5bdc52
- platform: linux
create_revision: 7f20e5d18ce4cb80c621533090a7c5113f5bdc52
base_revision: 7f20e5d18ce4cb80c621533090a7c5113f5bdc52
- platform: macos
create_revision: 7f20e5d18ce4cb80c621533090a7c5113f5bdc52
base_revision: 7f20e5d18ce4cb80c621533090a7c5113f5bdc52
- platform: web
create_revision: 7f20e5d18ce4cb80c621533090a7c5113f5bdc52
base_revision: 7f20e5d18ce4cb80c621533090a7c5113f5bdc52
- platform: windows
create_revision: 7f20e5d18ce4cb80c621533090a7c5113f5bdc52
base_revision: 7f20e5d18ce4cb80c621533090a7c5113f5bdc52

# 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'
3 changes: 3 additions & 0 deletions packages/altfire_tracker/example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# altfire_tracker_example

Demonstrates how to use the altfire_tracker plugin.
4 changes: 4 additions & 0 deletions packages/altfire_tracker/example/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include: package:altive_lints/altive_lints.yaml
analyzer:
exclude:
- "lib/firebase_options.dart"
13 changes: 13 additions & 0 deletions packages/altfire_tracker/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
73 changes: 73 additions & 0 deletions packages/altfire_tracker/example/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
id 'com.google.gms.google-services'
}

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 "jp.co.altive.altfire_tracker_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 "jp.co.altive.altfire_tracker_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
multiDexEnabled true
}

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 {
implementation 'com.android.support:multidex:2.0.1'
implementation platform('com.google.firebase:firebase-bom:32.7.1')
implementation 'com.google.firebase:firebase-analytics'
}
86 changes: 86 additions & 0 deletions packages/altfire_tracker/example/android/app/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{
"project_info": {
"project_number": "282061201204",
"project_id": "flutterfire-adapter",
"storage_bucket": "flutterfire-adapter.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:282061201204:android:11ddbb198d0efbb8b04f61",
"android_client_info": {
"package_name": "jp.co.altive.altfire_tracker_example"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyC-QqWrVIJNsh-DOmV4OY4gVAi1jXW4e6s"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:282061201204:android:bcdcfb126cd82050b04f61",
"android_client_info": {
"package_name": "jp.co.altive.altfireconfigurator.example"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyC-QqWrVIJNsh-DOmV4OY4gVAi1jXW4e6s"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:282061201204:android:5a74909eebf13701b04f61",
"android_client_info": {
"package_name": "jp.co.altive.flutterfire_tracker_example"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyC-QqWrVIJNsh-DOmV4OY4gVAi1jXW4e6s"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:282061201204:android:86708a3c3a298e18b04f61",
"android_client_info": {
"package_name": "jp.co.altive.flutterfireremoteparameterfetcher.example"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyC-QqWrVIJNsh-DOmV4OY4gVAi1jXW4e6s"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
}
],
"configuration_version": "1"
}
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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application android:label="altfire_tracker_example" android:name= "${applicationName}" android:icon="@mipmap/ic_launcher">
<activity android:name=".MainActivity" android:exported="true" android:launchMode="singleTop" android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data android:name="io.flutter.embedding.android.NormalTheme" android:resource="@style/NormalTheme" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data android:name="flutterEmbedding" android:value="2" />
</application>
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package jp.co.altive.altfire_tracker_example

import io.flutter.embedding.android.FlutterActivity

class MainActivity: FlutterActivity() {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package jp.co.altive.example

import io.flutter.embedding.android.FlutterActivity

class MainActivity: FlutterActivity() {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="?android:colorBackground" />

<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>
Loading

0 comments on commit 7547028

Please sign in to comment.