Skip to content

Commit e5911ef

Browse files
refactor: merge instabug_dio_interceptor
1 parent ffd3eed commit e5911ef

File tree

77 files changed

+2234
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+2234
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
version: 2
2+
jobs:
3+
test:
4+
docker:
5+
- image: cirrusci/flutter
6+
steps:
7+
- checkout
8+
- run: flutter doctor
9+
- run: flutter pub get
10+
- run: flutter pub run build_runner build --delete-conflicting-outputs
11+
- run: flutter test
12+
- run: flutter analyze .
13+
- run: flutter pub publish --dry-run
14+
15+
release:
16+
docker:
17+
- image: cirrusci/flutter
18+
steps:
19+
- checkout
20+
- run: ./release.sh
21+
22+
workflows:
23+
version: 2
24+
build-test:
25+
jobs:
26+
- test
27+
- hold:
28+
type: approval
29+
requires:
30+
- test
31+
filters:
32+
branches:
33+
only: master
34+
- release:
35+
requires:
36+
- hold
37+
filters:
38+
branches:
39+
only: master
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## Description of the change
2+
> Description goes here
3+
## Type of change
4+
- [ ] Bug fix (non-breaking change that fixes an issue)
5+
- [ ] New feature (non-breaking change that adds functionality)
6+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
7+
## Related issues
8+
> Issue links go here
9+
## Checklists
10+
### Development
11+
- [ ] Lint rules pass locally
12+
- [ ] The code changed/added as part of this pull request has been covered with tests
13+
### Code review
14+
- [ ] This pull request has a descriptive title and information useful to a reviewer
15+
- [ ] Issue from task tracker has a link to this pull request
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Generated files
2+
*.mocks.dart
3+
4+
# Miscellaneous
5+
*.class
6+
*.lock
7+
*.log
8+
*.pyc
9+
*.swp
10+
.DS_Store
11+
.atom/
12+
.buildlog/
13+
.history
14+
.svn/
15+
16+
# IntelliJ related
17+
*.iml
18+
*.ipr
19+
*.iws
20+
.idea/
21+
22+
# Visual Studio Code related
23+
.vscode/
24+
25+
# Flutter/Dart/Pub related
26+
**/doc/api/
27+
.dart_tool/
28+
.flutter-plugins
29+
.packages
30+
.flutter-plugins-dependencies
31+
.pub-cache/
32+
.pub/
33+
build/
34+
35+
# Android related
36+
**/android/**/gradle-wrapper.jar
37+
**/android/.gradle
38+
**/android/captures/
39+
**/android/gradlew
40+
**/android/gradlew.bat
41+
**/android/local.properties
42+
**/android/**/GeneratedPluginRegistrant.java
43+
44+
# iOS/XCode related
45+
**/ios/**/*.mode1v3
46+
**/ios/**/*.mode2v3
47+
**/ios/**/*.moved-aside
48+
**/ios/**/*.pbxuser
49+
**/ios/**/*.perspectivev3
50+
**/ios/**/*sync/
51+
**/ios/**/.sconsign.dblite
52+
**/ios/**/.tags*
53+
**/ios/**/.vagrant/
54+
**/ios/**/DerivedData/
55+
**/ios/**/Icon?
56+
**/ios/**/Pods/
57+
**/ios/**/.symlinks/
58+
**/ios/**/profile
59+
**/ios/**/xcuserdata
60+
**/ios/.generated/
61+
**/ios/Flutter/App.framework
62+
**/ios/Flutter/Flutter.framework
63+
**/ios/Flutter/Generated.xcconfig
64+
**/ios/Flutter/app.flx
65+
**/ios/Flutter/app.zip
66+
**/ios/Flutter/flutter_assets/
67+
**/ios/ServiceDefinitions.json
68+
**/ios/Runner/GeneratedPluginRegistrant.*
69+
70+
# Exceptions to above rules.
71+
!**/ios/**/default.mode1v3
72+
!**/ios/**/default.mode2v3
73+
!**/ios/**/default.pbxuser
74+
!**/ios/**/default.perspectivev3
75+
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Changelog
2+
3+
## Unreleased
4+
5+
### Added
6+
7+
- Add support for Instabug Flutter SDK v12 ([#26](https://github.com/Instabug/Instabug-Dio-Interceptor/pull/26)), closes [#25](https://github.com/Instabug/Instabug-Dio-Interceptor/issues/25).
8+
9+
## v2.2.0 (2022-03-14)
10+
11+
- Adds support for Dio v5
12+
- Relaxes dependencies version constraints
13+
14+
## v2.1.1 (2022-08-01)
15+
16+
- Bumps [instabug_flutter](https://pub.dev/packages/instabug_flutter) to v11
17+
18+
## v2.1.0 (2022-01-06)
19+
20+
- Fixes network log compilation error.
21+
- Adds payload size for network log.
22+
23+
## v2.0.1 (2021-09-29)
24+
25+
- Fixes an issue with APM network logger not reporting to the dashboard
26+
27+
## v2.0.0 (2021-09-20)
28+
29+
- Adds support for Dio v4.0
30+
- Upgrades to null safety
31+
32+
## v1.0.0 (2019-07-29)
33+
34+
- Updates instabug_flutter dependency name
35+
36+
## v0.0.1 (2019-07-22)
37+
38+
- Initial release
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) Instabug
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Instabug Dio Interceptor
2+
3+
[![CircleCI](https://circleci.com/gh/Instabug/Instabug-Dio-Interceptor.svg?style=svg)](https://circleci.com/gh/Instabug/Instabug-Dio-Interceptor)
4+
[![pub package](https://img.shields.io/pub/v/instabug_dio_interceptor.svg)](https://pub.dev/packages/instabug_dio_interceptor)
5+
6+
This package is an add on to [Instabug-Flutter](https://github.com/Instabug/Instabug-Flutter).
7+
8+
It intercepts any requests performed with `Dio` Package and sends them to the report that will be sent to the dashboard.
9+
10+
## Integration
11+
12+
To enable network logging, simply add the `InstabugDioInterceptor` to the dio object interceptors as follows:
13+
14+
```dart
15+
var dio = new Dio();
16+
dio.interceptors.add(InstabugDioInterceptor());
17+
```
Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
# Specify analysis options.
2+
#
3+
# Until there are meta linter rules, each desired lint must be explicitly enabled.
4+
# See: https://github.com/dart-lang/linter/issues/288
5+
#
6+
# For a list of lints, see: http://dart-lang.github.io/linter/lints/
7+
# See the configuration guide for more
8+
# https://github.com/dart-lang/sdk/tree/master/pkg/analyzer#configuring-the-analyzer
9+
#
10+
# There are other similar analysis options files in the flutter repos,
11+
# which should be kept in sync with this file:
12+
#
13+
# - analysis_options.yaml (this file)
14+
# - packages/flutter/lib/analysis_options_user.yaml
15+
# - https://github.com/flutter/plugins/blob/master/analysis_options.yaml
16+
# - https://github.com/flutter/engine/blob/master/analysis_options.yaml
17+
#
18+
# This file contains the analysis options used by Flutter tools, such as IntelliJ,
19+
# Android Studio, and the `flutter analyze` command.
20+
21+
analyzer:
22+
strong-mode:
23+
implicit-dynamic: false
24+
errors:
25+
# treat missing required parameters as a warning (not a hint)
26+
missing_required_param: warning
27+
# treat missing returns as a warning (not a hint)
28+
missing_return: warning
29+
# allow having TODOs in the code
30+
todo: ignore
31+
# Ignore analyzer hints for updating pubspecs when using Future or
32+
# Stream and not importing dart:async
33+
# Please see https://github.com/flutter/flutter/pull/24528 for details.
34+
sdk_version_async_exported_from_core: ignore
35+
exclude:
36+
- 'bin/cache/**'
37+
# the following two are relative to the stocks example and the flutter package respectively
38+
# see https://github.com/dart-lang/sdk/issues/28463
39+
- 'lib/i18n/stock_messages_*.dart'
40+
- 'lib/src/http/**'
41+
42+
linter:
43+
rules:
44+
# these rules are documented on and in the same order as
45+
# the Dart Lint rules page to make maintenance easier
46+
# https://github.com/dart-lang/linter/blob/master/example/all.yaml
47+
- always_declare_return_types
48+
- always_put_control_body_on_new_line
49+
# - always_put_required_named_parameters_first # we prefer having parameters in the same order as fields https://github.com/flutter/flutter/issues/10219
50+
- always_require_non_null_named_parameters
51+
- always_specify_types
52+
- annotate_overrides
53+
# - avoid_annotating_with_dynamic # conflicts with always_specify_types
54+
# - avoid_bool_literals_in_conditional_expressions # not yet tested
55+
# - avoid_catches_without_on_clauses # we do this commonly
56+
# - avoid_catching_errors # we do this commonly
57+
- avoid_classes_with_only_static_members
58+
# - avoid_double_and_int_checks # only useful when targeting JS runtime
59+
- avoid_empty_else
60+
- avoid_field_initializers_in_const_classes
61+
- avoid_function_literals_in_foreach_calls
62+
# - avoid_implementing_value_types # not yet tested
63+
- avoid_init_to_null
64+
# - avoid_js_rounded_ints # only useful when targeting JS runtime
65+
- avoid_null_checks_in_equality_operators
66+
# - avoid_positional_boolean_parameters # not yet tested
67+
# - avoid_private_typedef_functions # we prefer having typedef (discussion in https://github.com/flutter/flutter/pull/16356)
68+
- avoid_relative_lib_imports
69+
- avoid_renaming_method_parameters
70+
- avoid_return_types_on_setters
71+
# - avoid_returning_null # there are plenty of valid reasons to return null
72+
# - avoid_returning_null_for_future # not yet tested
73+
- avoid_returning_null_for_void
74+
# - avoid_returning_this # there are plenty of valid reasons to return this
75+
# - avoid_setters_without_getters # not yet tested
76+
# - avoid_shadowing_type_parameters # not yet tested
77+
# - avoid_single_cascade_in_expression_statements # not yet tested
78+
- avoid_slow_async_io
79+
- avoid_types_as_parameter_names
80+
# - avoid_types_on_closure_parameters # conflicts with always_specify_types
81+
- avoid_unused_constructor_parameters
82+
- avoid_void_async
83+
- await_only_futures
84+
- camel_case_types
85+
- cancel_subscriptions
86+
# - cascade_invocations # not yet tested
87+
# - close_sinks # not reliable enough
88+
# - comment_references # blocked on https://github.com/flutter/flutter/issues/20765
89+
# - constant_identifier_names # needs an opt-out https://github.com/dart-lang/linter/issues/204
90+
- control_flow_in_finally
91+
# - curly_braces_in_flow_control_structures # not yet tested
92+
- directives_ordering
93+
- empty_catches
94+
- empty_constructor_bodies
95+
- empty_statements
96+
# - file_names # not yet tested
97+
- flutter_style_todos
98+
- hash_and_equals
99+
- implementation_imports
100+
# - invariant_booleans # too many false positives: https://github.com/dart-lang/linter/issues/811
101+
- iterable_contains_unrelated_type
102+
# - join_return_with_assignment # not yet tested
103+
- library_names
104+
- library_prefixes
105+
# - lines_longer_than_80_chars # not yet tested
106+
- list_remove_unrelated_type
107+
# - literal_only_boolean_expressions # too many false positives: https://github.com/dart-lang/sdk/issues/34181
108+
- no_adjacent_strings_in_list
109+
- no_duplicate_case_values
110+
- non_constant_identifier_names
111+
# - null_closures # not yet tested
112+
# - omit_local_variable_types # opposite of always_specify_types
113+
# - one_member_abstracts # too many false positives
114+
# - only_throw_errors # https://github.com/flutter/flutter/issues/5792
115+
- overridden_fields
116+
- package_api_docs
117+
- package_names
118+
- package_prefixed_library_names
119+
# - parameter_assignments # we do this commonly
120+
- prefer_adjacent_string_concatenation
121+
- prefer_asserts_in_initializer_lists
122+
- prefer_collection_literals
123+
- prefer_conditional_assignment
124+
- prefer_const_constructors
125+
- prefer_const_constructors_in_immutables
126+
- prefer_const_declarations
127+
- prefer_const_literals_to_create_immutables
128+
# - prefer_constructors_over_static_methods # not yet tested
129+
- prefer_contains
130+
- prefer_equal_for_default_values
131+
# - prefer_expression_function_bodies # conflicts with https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#consider-using--for-short-functions-and-methods
132+
- prefer_final_fields
133+
- prefer_final_locals
134+
- prefer_foreach
135+
# - prefer_function_declarations_over_variables # not yet tested
136+
- prefer_generic_function_type_aliases
137+
- prefer_initializing_formals
138+
# - prefer_int_literals # not yet tested
139+
# - prefer_interpolation_to_compose_strings # not yet tested
140+
- prefer_is_empty
141+
- prefer_is_not_empty
142+
- prefer_iterable_whereType
143+
# - prefer_mixin # https://github.com/dart-lang/language/issues/32
144+
- prefer_single_quotes
145+
- prefer_typing_uninitialized_variables
146+
- prefer_void_to_null
147+
# - public_member_api_docs # enabled on a case-by-case basis; see e.g. packages/analysis_options.yaml
148+
- recursive_getters
149+
- slash_for_doc_comments
150+
- sort_constructors_first
151+
- sort_pub_dependencies
152+
- sort_unnamed_constructors_first
153+
# - super_goes_last # no longer needed w/ Dart 2
154+
- test_types_in_equals
155+
- throw_in_finally
156+
# - type_annotate_public_apis # subset of always_specify_types
157+
- type_init_formals
158+
# - unawaited_futures # too many false positives
159+
# - unnecessary_await_in_return # not yet tested
160+
- unnecessary_brace_in_string_interps
161+
- unnecessary_const
162+
- unnecessary_getters_setters
163+
# - unnecessary_lambdas # has false positives: https://github.com/dart-lang/linter/issues/498
164+
- unnecessary_new
165+
- unnecessary_null_aware_assignments
166+
- unnecessary_null_in_if_null_operators
167+
- unnecessary_overrides
168+
- unnecessary_parenthesis
169+
- unnecessary_statements
170+
- unnecessary_this
171+
- unrelated_type_equality_checks
172+
# - use_function_type_syntax_for_parameters # not yet tested
173+
- use_rethrow_when_possible
174+
# - use_setters_to_change_properties # not yet tested
175+
# - use_string_buffers # has false positives: https://github.com/dart-lang/sdk/issues/34182
176+
# - use_to_and_as_if_applicable # has false positives, so we prefer to catch this by code-review
177+
- valid_regexps
178+
# - void_checks # not yet tested

0 commit comments

Comments
 (0)