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

[shared_preferences] Add missing DartDoc #2296

Merged
merged 1 commit into from
Nov 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions packages/shared_preferences/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
## 0.5.4+6

* Add missing documentation and a lint to prevent further undocumented APIs.

## 0.5.4+5

* Update and migrate iOS example project by removing flutter_assets, change
"English" to "en", remove extraneous xcconfigs and framework outputs,
* Update and migrate iOS example project by removing flutter_assets, change
"English" to "en", remove extraneous xcconfigs and framework outputs,
update to Xcode 11 build settings, and remove ARCHS.

## 0.5.4+4
Expand Down
11 changes: 11 additions & 0 deletions packages/shared_preferences/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# This exists to add a lint for missing API docs just on this specific package,
# since not all packages have coverage for all their public members yet and
# adding it in would be non-trivial. `public_member_api_docs` should be applied
# to new packages going forward, and ideally the main `analysis_options.yaml`
# file as soon as possible.

include: ../../analysis_options.yaml

linter:
rules:
- public_member_api_docs
2 changes: 2 additions & 0 deletions packages/shared_preferences/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// ignore_for_file: public_member_api_docs

import 'dart:async';

import 'package:flutter/material.dart';
Expand Down
5 changes: 5 additions & 0 deletions packages/shared_preferences/lib/shared_preferences.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ class SharedPreferences {

static const String _prefix = 'flutter.';
static Completer<SharedPreferences> _completer;

/// Loads and parses the [SharedPreferences] for this app from disk.
///
/// Because this is reading from disk, it shouldn't be awaited in
/// performance-sensitive blocks.
static Future<SharedPreferences> getInstance() async {
if (_completer == null) {
_completer = Completer<SharedPreferences>();
Expand Down
2 changes: 1 addition & 1 deletion packages/shared_preferences/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Flutter plugin for reading and writing simple key-value pairs.
Wraps NSUserDefaults on iOS and SharedPreferences on Android.
author: Flutter Team <[email protected]>
homepage: https://github.com/flutter/plugins/tree/master/packages/shared_preferences
version: 0.5.4+5
version: 0.5.4+6

flutter:
plugin:
Expand Down