diff --git a/.idea/vcs.xml b/.idea/vcs.xml
index b2bdec2..fdf1fc8 100644
--- a/.idea/vcs.xml
+++ b/.idea/vcs.xml
@@ -2,5 +2,6 @@
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 6be0df3..bb6465c 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -615,6 +615,11 @@
+
+
+
+
+
@@ -627,7 +632,7 @@
-
+
@@ -679,7 +684,7 @@
1582011433049
-
+
@@ -690,45 +695,45 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8b02c54..ea171bb 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -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.
diff --git a/example/README.md b/example/README.md
index e5e737a..28b6ba1 100644
--- a/example/README.md
+++ b/example/README.md
@@ -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 {
+ String _advertisingId = 'Unknown';
+
+ @override
+ void initState() {
+ super.initState();
+ initPlatformState();
+ }
+
+ // AdvertisingId are asynchronous, so we initialize in an async method.
+ Future 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.
+```
diff --git a/example/lib/main.dart b/example/lib/main.dart
index 6655d67..9413307 100644
--- a/example/lib/main.dart
+++ b/example/lib/main.dart
@@ -20,7 +20,7 @@ class _MyAppState extends State {
initPlatformState();
}
- // Platform messages are asynchronous, so we initialize in an async method.
+ // AdvertisingId are asynchronous, so we initialize in an async method.
Future initPlatformState() async {
String advertisingId;
// Advertising id may fail, so we use a try/catch PlatformException.
diff --git a/flutter_advertising_id.iml b/flutter_advertising_id.iml
index 54882b9..41eaadb 100644
--- a/flutter_advertising_id.iml
+++ b/flutter_advertising_id.iml
@@ -9,6 +9,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pubspec.yaml b/pubspec.yaml
index b09875a..344de99 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -2,7 +2,7 @@ name: flutter_advertising_id
description: A new Flutter project.
version: 0.0.1
author: Atul kumar
-homepage:
+homepage: https://github.com/iamatulkumar/flutter_advertising_id
environment:
sdk: ">=2.1.0 <3.0.0"