Skip to content

Commit

Permalink
doc: update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Atul Kumar committed Feb 18, 2020
1 parent ff7ca12 commit 7986f91
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 29 deletions.
1 change: 1 addition & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 23 additions & 18 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## 0.0.1

* Get GAID in android and IDFA in ios.
* Initial release: Get GAID in android and IDFA in ios.
82 changes: 74 additions & 8 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,82 @@
# flutter_advertising_id_example
# flutter_advertising_id

Flutter plugin to get GAID android and IDFA ios.

Demonstrates how to use the flutter_advertising_id plugin.

## Usage
To use this plugin, add `flutter_advertising_id` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/).

## Getting Started

This project is a starting point for a Flutter application.
Check out the `example` directory for a sample app using flutter advertising id.

In your flutter project add the dependency:

```yml
dependencies:
...
 flutter_advertising_id: ^0.0.1
```
For help getting started with Flutter, view the online
[documentation](https://flutter.io/).
## Usage example
import `package:flutter_advertising_id/flutter_advertising_id.dart;`

```dart
import 'package:flutter_advertising_id/flutter_advertising_id.dart';
```

```$xslt
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
String _advertisingId = 'Unknown';
@override
void initState() {
super.initState();
initPlatformState();
}
// AdvertisingId are asynchronous, so we initialize in an async method.
Future<void> initPlatformState() async {
String advertisingId;
// Advertising id may fail, so we use a try/catch PlatformException.
try {
advertisingId = await FlutterAdvertisingId.advertisingId;
} on PlatformException {
advertisingId = 'Failed to get platform version.';
}
// If the widget was removed from the tree while the asynchronous platform
// message was in flight, we want to discard the reply rather than calling
// setState to update our non-existent appearance.
if (!mounted) return;
A few resources to get you started if this is your first Flutter project:
setState(() {
_advertisingId = advertisingId;
});
}
- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: Center(
child: Text('Running on: $_advertisingId\n'),
),
),
);
}
}
For help getting started with Flutter, view our
[online documentation](https://flutter.dev/docs), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
```
2 changes: 1 addition & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class _MyAppState extends State<MyApp> {
initPlatformState();
}

// Platform messages are asynchronous, so we initialize in an async method.
// AdvertisingId are asynchronous, so we initialize in an async method.
Future<void> initPlatformState() async {
String advertisingId;
// Advertising id may fail, so we use a try/catch PlatformException.
Expand Down
12 changes: 12 additions & 0 deletions flutter_advertising_id.iml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@
<excludeFolder url="file://$MODULE_DIR$/example/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/example/.pub" />
<excludeFolder url="file://$MODULE_DIR$/example/build" />
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_advertising_id/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_advertising_id/.pub" />
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_advertising_id/build" />
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_advertising_id/example/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_advertising_id/example/.pub" />
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_advertising_id/example/build" />
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_advertising_id/example/build/app/intermediates/flutter/debug/android-arm/flutter_assets/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_advertising_id/example/build/app/intermediates/flutter/debug/android-arm64/flutter_assets/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_advertising_id/example/build/app/intermediates/flutter/debug/android-x86/flutter_assets/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_advertising_id/example/build/app/intermediates/merged_assets/debug/mergeDebugAssets/out/flutter_assets/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_advertising_id/example/ios/Flutter/App.framework/flutter_assets/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/ios/Flutter/App.framework/flutter_assets/packages" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Dart SDK" level="project" />
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: flutter_advertising_id
description: A new Flutter project.
version: 0.0.1
author: Atul kumar <[email protected]>
homepage:
homepage: https://github.com/iamatulkumar/flutter_advertising_id

environment:
sdk: ">=2.1.0 <3.0.0"
Expand Down

0 comments on commit 7986f91

Please sign in to comment.