Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
docs: Improves READMEs styles (#919)
Browse files Browse the repository at this point in the history
  • Loading branch information
lennonjesus authored and amirh committed Nov 21, 2018
1 parent 54f9c4e commit 9a17c4f
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
14 changes: 7 additions & 7 deletions packages/firebase_admob/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ and setting up your App ID.
## Initializing the plugin
The AdMob plugin must be initialized with an AdMob App ID.

```
```dart
FirebaseAdMob.instance.initialize(appId: appId);
```
*Note Android*:
Starting in version 17.0.0, if you are an AdMob publisher you are now required to add your AdMob app ID in your **AndroidManifest.xml** file. Once you find your AdMob app ID in the AdMob UI, add it to your manifest adding the following tag:

```
```xml
<manifest>
<application>
<!-- TODO: Replace with your real AdMob app ID -->
Expand Down Expand Up @@ -90,7 +90,7 @@ InterstitialAd myInterstitial = InterstitialAd(
```

Ads must be loaded before they're shown.
```
```dart
myBanner
// typically this happens well before the ad is shown
..load()
Expand All @@ -102,7 +102,7 @@ myBanner
);
```

```
```dart
myInterstitial
..load()
..show(
Expand All @@ -124,7 +124,7 @@ listener can be used to detect when the ad has actually finished loading
Unlike banners and interstitials, rewarded video ads are loaded one at a time
via a singleton object, `RewardedVideoAd.instance`. Its `load` method takes an
AdMob ad unit ID and an instance of `MobileAdTargetingInfo`:
```
```dart
RewardedVideoAd.instance.load(myAdMobAdUnitId, targetingInfo);
```

Expand All @@ -135,13 +135,13 @@ function will be invoked whenever one of the events in the `RewardedVideAdEvent`
enum occurs. After a rewarded video ad loads, for example, the
`RewardedVideoAdEvent.loaded` is sent. Any time after that, apps can show the ad
by calling `show`:
```
```dart
RewardedVideoAd.instance.show();
```

When the AdMob SDK decides it's time to grant an in-app reward, it does so via
the `RewardedVideoAdEvent.rewarded` event:
```
```dart
RewardedVideoAd.instance.listener =
(RewardedVideoAdEvent event, [String rewardType, int rewardAmount]) {
if (event == RewardedVideoAdEvent.rewarded) {
Expand Down
2 changes: 1 addition & 1 deletion packages/firebase_ml_vision/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ To use this plugin, add `firebase_ml_vision` as a [dependency in your pubspec.ya
### Android
Optional but recommended: If you use the on-device API, configure your app to automatically download the ML model to the device after your app is installed from the Play Store. To do so, add the following declaration to your app's AndroidManifest.xml file:

```manifest
```xml
<application ...>
...
<meta-data
Expand Down
10 changes: 5 additions & 5 deletions packages/firebase_remote_config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ To use the firebase_remote_config plugin, follow the [plugin installation instru
Enable the Google services by configuring the Gradle scripts as such.

1. Add the classpath to the `[project]/android/build.gradle` file.
```
```gradle
dependencies {
// Example existing classpath
classpath 'com.android.tools.build:gradle:3.2.1'
Expand All @@ -28,7 +28,7 @@ dependencies {
```

2. Add the apply plugin to the `[project]/android/app/build.gradle` file.
```
```gradle
// ADD THIS AT THE BOTTOM
apply plugin: 'com.google.gms.google-services'
```
Expand All @@ -46,17 +46,17 @@ Otherwise you will not be able to use Firebase Remote Config.
### Use the plugin

Add the following imports to your Dart code:
```
```dart
import 'package:firebase_remote_config/firebase_remote_config.dart';
```

Initialize `RemoteConfig`:
```
```dart
final RemoteConfig remoteConfig = await RemoteConfig.instance;
```

You can now use the Firebase `remoteConfig` to fetch remote configurations in your Dart code, e.g.
```
```dart
final defaults = <String, dynamic>{'welcome': 'default welcome'};
await remoteConfig.setDefaults(defaults);
Expand Down
6 changes: 3 additions & 3 deletions packages/google_sign_in/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ enable the [Google People API](https://developers.google.com/people/).
4. A dialog will show up and ask you to select the targets, select the `Runner` target.
5. Then add the `CFBundleURLTypes` attributes below into the `[my_project]/ios/Runner/Info.plist` file.

```
```xml
<!-- Put me in the [my_project]/ios/Runner/Info.plist file -->
<!-- Google Sign-in Section -->
<key>CFBundleURLTypes</key>
Expand All @@ -53,7 +53,7 @@ To use this plugin, follow the [plugin installation instructions](https://pub.da
### Use the plugin
Add the following import to your Dart code:

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

Expand All @@ -71,7 +71,7 @@ GoogleSignIn _googleSignIn = GoogleSignIn(

You can now use the `GoogleSignIn` class to authenticate in your Dart code, e.g.

```
```dart
Future<void> _handleSignIn() async {
try {
await _googleSignIn.signIn();
Expand Down
4 changes: 2 additions & 2 deletions packages/local_auth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ try {
Note that this plugin works with both TouchID and FaceID. However, to use the latter,
you need to also add:

```
```xml
<key>NSFaceIDUsageDescription</key>
<string>Why is my app authenticating using face id?</string>
```
Expand All @@ -130,7 +130,7 @@ app has not been updated to use TouchID.
Update your project's `AndroidManifest.xml` file to include the
`USE_FINGERPRINT` permissions:

```
```xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.app">
<uses-permission android:name="android.permission.USE_FINGERPRINT"/>
Expand Down
2 changes: 1 addition & 1 deletion packages/shared_preferences/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ _incrementCounter() async {

You can populate `SharedPreferences` with initial values in your tests by running this code:

```
```dart
const MethodChannel('plugins.flutter.io/shared_preferences')
.setMockMethodCallHandler((MethodCall methodCall) async {
if (methodCall.method == 'getAll') {
Expand Down

0 comments on commit 9a17c4f

Please sign in to comment.