Skip to content

Commit

Permalink
[connectivity] Lint for public DartDocs (flutter#2269)
Browse files Browse the repository at this point in the history
Missing DartDocs were recently added to this plugin. Add a
package-specific analysis options to make sure that they don't regress
going forward.
  • Loading branch information
Michael Klimushyn authored Nov 13, 2019
1 parent e87ef4c commit 3c59297
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 7 deletions.
4 changes: 4 additions & 0 deletions packages/connectivity/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.4.5+5

* Add an analyzer check for the public documentation.

## 0.4.5+4

* Stability and Maintainability: update documentations.
Expand Down
11 changes: 11 additions & 0 deletions packages/connectivity/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/connectivity/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 'dart:io';

Expand Down
17 changes: 11 additions & 6 deletions packages/connectivity/lib/connectivity.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@ import 'dart:io';
import 'package:flutter/services.dart';
import 'package:meta/meta.dart';

/// Connection Status Check Result
///
/// WiFi: Device connected via Wi-Fi
/// Mobile: Device connected to cellular network
/// None: Device not connected to any network
enum ConnectivityResult { wifi, mobile, none }
/// Connection status check result.
enum ConnectivityResult {
/// WiFi: Device connected via Wi-Fi
wifi,

/// Mobile: Device connected to cellular network
mobile,

/// None: Device not connected to any network
none
}

/// Discover network connectivity configurations: Distinguish between WI-FI and cellular, check WI-FI status and more.
class Connectivity {
Expand Down
2 changes: 1 addition & 1 deletion packages/connectivity/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Flutter plugin for discovering the state of the network (WiFi &
mobile/cellular) connectivity on Android and iOS.
author: Flutter Team <[email protected]>
homepage: https://github.com/flutter/plugins/tree/master/packages/connectivity
version: 0.4.5+4
version: 0.4.5+5

flutter:
plugin:
Expand Down

0 comments on commit 3c59297

Please sign in to comment.