diff --git a/packages/cloud_firestore/README.md b/packages/cloud_firestore/README.md index acf3aa6350b0..379a5a820924 100755 --- a/packages/cloud_firestore/README.md +++ b/packages/cloud_firestore/README.md @@ -44,15 +44,15 @@ Binding a `CollectionReference` to a `ListView`: class BookList extends StatelessWidget { @override Widget build(BuildContext context) { - return new StreamBuilder( + return StreamBuilder( stream: Firestore.instance.collection('books').snapshots(), builder: (BuildContext context, AsyncSnapshot snapshot) { - if (!snapshot.hasData) return new Text('Loading...'); - return new ListView( + if (!snapshot.hasData) return Text('Loading...'); + return ListView( children: snapshot.data.documents.map((DocumentSnapshot document) { - return new ListTile( - title: new Text(document['title']), - subtitle: new Text(document['author']), + return ListTile( + title: Text(document['title']), + subtitle: Text(document['author']), ); }).toList(), ); diff --git a/packages/firebase_admob/README.md b/packages/firebase_admob/README.md index cb3bfb65d418..662f934076af 100644 --- a/packages/firebase_admob/README.md +++ b/packages/firebase_admob/README.md @@ -16,21 +16,21 @@ FirebaseAdMob.instance.initialize(appId: appId); ``` ## Using banners and interstitials -Banner and interstitial ads can be configured with target information. +Banner and interstitial ads can be configured with target information. And in the example below, the ads are given test ad unit IDs for a quick start. -``` -MobileAdTargetingInfo targetingInfo = new MobileAdTargetingInfo( +```dart +MobileAdTargetingInfo targetingInfo = MobileAdTargetingInfo( keywords: ['flutterio', 'beautiful apps'], contentUrl: 'https://flutter.io', - birthday: new DateTime.now(), + birthday: DateTime.now(), childDirected: false, designedForFamilies: false, gender: MobileAdGender.male, // or MobileAdGender.female, MobileAdGender.unknown testDevices: [], // Android emulators are considered test devices ); -BannerAd myBanner = new BannerAd( +BannerAd myBanner = BannerAd( // Replace the testAdUnitId with an ad unit id from the AdMob dash. // https://developers.google.com/admob/android/test-ads // https://developers.google.com/admob/ios/test-ads @@ -42,7 +42,7 @@ BannerAd myBanner = new BannerAd( }, ); -InterstitialAd myInterstitial = new InterstitialAd( +InterstitialAd myInterstitial = InterstitialAd( // Replace the testAdUnitId with an ad unit id from the AdMob dash. // https://developers.google.com/admob/android/test-ads // https://developers.google.com/admob/ios/test-ads diff --git a/packages/firebase_admob/lib/firebase_admob.dart b/packages/firebase_admob/lib/firebase_admob.dart index 258840df3b5d..7b7ad9eb9900 100644 --- a/packages/firebase_admob/lib/firebase_admob.dart +++ b/packages/firebase_admob/lib/firebase_admob.dart @@ -404,7 +404,7 @@ class RewardedVideoAd { /// /// Apps can create, load, and show mobile ads. For example: /// ``` -/// BannerAd myBanner = new BannerAd(unitId: myBannerAdUnitId) +/// BannerAd myBanner = BannerAd(unitId: myBannerAdUnitId) /// ..load() /// ..show(); /// ``` diff --git a/packages/firebase_analytics/README.md b/packages/firebase_analytics/README.md index f4528b1206dd..41f3f01403c9 100755 --- a/packages/firebase_analytics/README.md +++ b/packages/firebase_analytics/README.md @@ -18,12 +18,12 @@ To track `PageRoute` transitions, add a `FirebaseAnalyticsObserver` to the list ```dart -FirebaseAnalytics analytics = new FirebaseAnalytics(); +FirebaseAnalytics analytics = FirebaseAnalytics(); MaterialApp( - home: new MyAppHome(), + home: MyAppHome(), navigatorObservers: [ - new FirebaseAnalyticsObserver(analytics: analytics), + FirebaseAnalyticsObserver(analytics: analytics), ], ); ``` diff --git a/packages/firebase_analytics/lib/firebase_analytics.dart b/packages/firebase_analytics/lib/firebase_analytics.dart index 5d121d6e7ce5..034968f03261 100755 --- a/packages/firebase_analytics/lib/firebase_analytics.dart +++ b/packages/firebase_analytics/lib/firebase_analytics.dart @@ -36,7 +36,7 @@ class FirebaseAnalytics { /// /// Example: /// - /// FirebaseAnalytics analytics = new FirebaseAnalytics(); + /// FirebaseAnalytics analytics = FirebaseAnalytics(); /// analytics.android?.setMinimumSessionDuration(200000); final FirebaseAnalyticsAndroid android; diff --git a/packages/firebase_analytics/lib/observer.dart b/packages/firebase_analytics/lib/observer.dart index 5bcc907b7435..e3ed99fce031 100644 --- a/packages/firebase_analytics/lib/observer.dart +++ b/packages/firebase_analytics/lib/observer.dart @@ -27,9 +27,9 @@ String defaultNameExtractor(RouteSettings settings) => settings.name; /// ```dart /// Navigator.pushNamed(context, '/contact/123'); /// -/// Navigator.push(context, new MaterialPageRoute( -/// settings: new RouteSettings(name: '/contact/123', -/// builder: new ContactDetail(123)))), +/// Navigator.push(context, MaterialPageRoute( +/// settings: RouteSettings(name: '/contact/123', +/// builder: ContactDetail(123)))), /// /// Navigator.pop(context); /// ``` @@ -38,9 +38,9 @@ String defaultNameExtractor(RouteSettings settings) => settings.name; /// you're using a [MaterialApp]: /// ```dart /// MaterialApp( -/// home: new MyAppHome(), +/// home: MyAppHome(), /// navigatorObservers: [ -/// new FirebaseAnalyticsObserver(analytics: service.analytics), +/// FirebaseAnalyticsObserver(analytics: service.analytics), /// ], /// ); /// ``` diff --git a/packages/firebase_dynamic_links/README.md b/packages/firebase_dynamic_links/README.md index 56f62afed5fb..423a8133fd97 100644 --- a/packages/firebase_dynamic_links/README.md +++ b/packages/firebase_dynamic_links/README.md @@ -29,28 +29,28 @@ https://example.page.link/WXYZ You can create a Dynamic Link programmatically by setting the following parameters and using the `DynamicLinkParameters.buildUrl()` method. ```dart -final DynamicLinkParameters parameters = new DynamicLinkParameters( +final DynamicLinkParameters parameters = DynamicLinkParameters( domain: 'abc123.app.goo.gl', link: Uri.parse('https://example.com/'), - androidParameters: new AndroidParameters( + androidParameters: AndroidParameters( packageName: 'com.example.android', minimumVersion: 125, ), - iosParameters: new IosParameters( + iosParameters: IosParameters( bundleId: 'com.example.ios', minimumVersion: '1.0.1', appStoreId: '123456789', ), - googleAnalyticsParameters: new GoogleAnalyticsParameters( + googleAnalyticsParameters: GoogleAnalyticsParameters( campaign: 'example-promo', medium: 'social', source: 'orkut', ), - itunesConnectAnalyticsParameters: new ItunesConnectAnalyticsParameters( + itunesConnectAnalyticsParameters: ItunesConnectAnalyticsParameters( providerToken: '123456', campaignToken: 'example-promo', ), - socialMetaTagParameters: new SocialMetaTagParameters( + socialMetaTagParameters: SocialMetaTagParameters( title: 'Example of a Dynamic Link', description: 'This link works whether app is installed or not!', ), @@ -71,7 +71,7 @@ To shorten a long Dynamic Link, use the DynamicLinkParameters.shortenUrl method. ```dart final ShortDynamicLink shortenedLink = await DynamicLinkParameters.shortenUrl( Uri.parse('https://example.page.link/?link=https://example.com/&apn=com.example.android&ibn=com.example.ios'), - new DynamicLinkParametersOptions(ShortDynamicLinkPathLength.unguessable), + DynamicLinkParametersOptions(ShortDynamicLinkPathLength.unguessable), ); final Uri shortUrl = shortenedLink.shortUrl; @@ -101,11 +101,11 @@ applinks:YOUR_SUBDOMAIN.page.link ```dart void main() { - runApp(new MaterialApp( + runApp(MaterialApp( title: 'Dynamic Links Example', routes: { - '/': (BuildContext context) => new MyHomeWidget(), // Default home route - '/helloworld': (BuildContext context) => new MyHelloWorldWidget(), + '/': (BuildContext context) => MyHomeWidget(), // Default home route + '/helloworld': (BuildContext context) => MyHelloWorldWidget(), }, )); } diff --git a/packages/firebase_messaging/README.md b/packages/firebase_messaging/README.md index 0ff91ef58dab..9952edb3a9b4 100644 --- a/packages/firebase_messaging/README.md +++ b/packages/firebase_messaging/README.md @@ -52,7 +52,7 @@ From your Dart code, you need to import the plugin and instantiate it: ```dart import 'package:firebase_messaging/firebase_messaging.dart'; -final FirebaseMessaging _firebaseMessaging = new FirebaseMessaging(); +final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); ``` Next, you should probably request permissions for receiving Push Notifications. For this, call `_firebaseMessaging.requestNotificationPermissions()`. This will bring up a permissions dialog for the user to confirm on iOS. It's a no-op on Android. Last, but not least, register `onMessage`, `onResume`, and `onLaunch` callbacks via `_firebaseMessaging.configure()` to listen for incoming messages (see table below for more information). diff --git a/packages/firebase_performance/README.md b/packages/firebase_performance/README.md index 1563ac79e532..961c7f017623 100644 --- a/packages/firebase_performance/README.md +++ b/packages/firebase_performance/README.md @@ -70,11 +70,10 @@ class _MyAppState extends State { . . Future testHttpMetric() async { - final _MetricHttpClient metricHttpClient = - new _MetricHttpClient(new Client()); + final _MetricHttpClient metricHttpClient = _MetricHttpClient(Client()); final Request request = - new Request("SEND", Uri.parse("https://www.google.com")); + Request("SEND", Uri.parse("https://www.google.com")); metricHttpClient.send(request); }