Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
dart_pdf
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
David PHAM-VAN
2019-11-07 07:03:55 -0500
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a695e2a4b18b98f67e19584b7e546362940c81b5
a695e2a4
1 parent
9bd97dae
Update Analysis options
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
59 additions
and
32 deletions
pdf/analysis_options.yaml
pdf/lib/src/document.dart
pdf/lib/src/names.dart
pdf/lib/widgets/geometry.dart
pdf/pubspec.yaml
pdf/test/orientation_test.dart
printing/analysis_options.yaml
printing/example/lib/main.dart
printing/example/pubspec.yaml
printing/pubspec.yaml
pdf/analysis_options.yaml
View file @
a695e2a
...
...
@@ -33,11 +33,11 @@ analyzer:
# Please see https://github.com/flutter/flutter/pull/24528 for details.
sdk_version_async_exported_from_core
:
ignore
exclude
:
-
'
bin/cache/**'
-
"
bin/cache/**"
# the following two are relative to the stocks example and the flutter package respectively
# see https://github.com/dart-lang/sdk/issues/28463
-
'
lib/i18n/stock_messages_*.dart'
-
'
lib/src/http/**'
-
"
lib/i18n/stock_messages_*.dart"
-
"
lib/src/http/**"
linter
:
rules
:
...
...
@@ -52,7 +52,7 @@ linter:
-
annotate_overrides
# - avoid_annotating_with_dynamic # conflicts with always_specify_types
-
avoid_as
# - avoid_bool_literals_in_conditional_expressions # not yet tested
-
avoid_bool_literals_in_conditional_expressions
# - avoid_catches_without_on_clauses # we do this commonly
# - avoid_catching_errors # we do this commonly
-
avoid_classes_with_only_static_members
...
...
@@ -90,6 +90,7 @@ linter:
# - constant_identifier_names # needs an opt-out https://github.com/dart-lang/linter/issues/204
-
control_flow_in_finally
# - curly_braces_in_flow_control_structures # not yet tested
# - diagnostic_describe_all_properties # not yet tested
-
directives_ordering
-
empty_catches
-
empty_constructor_bodies
...
...
@@ -120,7 +121,8 @@ linter:
# - parameter_assignments # we do this commonly
-
prefer_adjacent_string_concatenation
-
prefer_asserts_in_initializer_lists
# - prefer_collection_literals # temporary until all platforms support set literals
# - prefer_asserts_with_message # not yet tested
-
prefer_collection_literals
-
prefer_conditional_assignment
-
prefer_const_constructors
-
prefer_const_constructors_in_immutables
...
...
@@ -128,30 +130,39 @@ linter:
-
prefer_const_literals_to_create_immutables
# - prefer_constructors_over_static_methods # not yet tested
-
prefer_contains
# - prefer_double_quotes # opposite of prefer_single_quotes
-
prefer_equal_for_default_values
# - prefer_expression_function_bodies # conflicts with https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#consider-using--for-short-functions-and-methods
-
prefer_final_fields
# - prefer_final_in_for_each # not yet tested
-
prefer_final_locals
# - prefer_for_elements_to_map_fromIterable # not yet tested
-
prefer_foreach
# - prefer_function_declarations_over_variables # not yet tested
-
prefer_generic_function_type_aliases
-
prefer_if_elements_to_conditional_expressions
-
prefer_if_null_operators
-
prefer_initializing_formals
-
prefer_inlined_adds
# - prefer_int_literals # not yet tested
# - prefer_interpolation_to_compose_strings # not yet tested
-
prefer_is_empty
-
prefer_is_not_empty
-
prefer_iterable_whereType
# - prefer_mixin # https://github.com/dart-lang/language/issues/32
# - prefer_null_aware_operators # disable until NNBD, see https://github.com/flutter/flutter/pull/32711#issuecomment-492930932
-
prefer_single_quotes
-
prefer_spread_collections
-
prefer_typing_uninitialized_variables
-
prefer_void_to_null
# - provide_deprecation_message # not yet tested
# - public_member_api_docs # enabled on a case-by-case basis; see e.g. packages/analysis_options.yaml
-
recursive_getters
-
slash_for_doc_comments
# - sort_child_properties_last # not yet tested
-
sort_constructors_first
-
sort_pub_dependencies
-
sort_unnamed_constructors_first
# - super_goes_last # no longer needed w/ Dart 2
-
test_types_in_equals
-
throw_in_finally
# - type_annotate_public_apis # subset of always_specify_types
...
...
@@ -170,6 +181,8 @@ linter:
-
unnecessary_statements
-
unnecessary_this
-
unrelated_type_equality_checks
# - unsafe_html # not yet tested
-
use_full_hex_values_for_flutter_colors
# - use_function_type_syntax_for_parameters # not yet tested
-
use_rethrow_when_possible
# - use_setters_to_change_properties # not yet tested
...
...
pdf/lib/src/document.dart
View file @
a695e2a
...
...
@@ -63,7 +63,7 @@ class PdfDocument {
int
_objser
;
/// This vector contains each indirect object within the document.
final
Set
<
PdfObject
>
objects
=
Set
<
PdfObject
>()
;
final
Set
<
PdfObject
>
objects
=
<
PdfObject
>{}
;
/// This is the Catalog object, which is required by each Pdf Document
PdfCatalog
catalog
;
...
...
@@ -108,7 +108,7 @@ class PdfDocument {
];
/// This holds the current fonts
final
Set
<
PdfFont
>
fonts
=
Set
<
PdfFont
>()
;
final
Set
<
PdfFont
>
fonts
=
<
PdfFont
>{}
;
/// Generates the document ID
List
<
int
>
_documentID
;
...
...
pdf/lib/src/names.dart
View file @
a695e2a
...
...
@@ -39,9 +39,9 @@ class PdfNames extends PdfObject {
..
putArray
(<
PdfStream
>[
page
.
ref
(),
PdfStream
.
string
(
'/XYZ'
),
posX
==
null
?
PdfStream
.
string
(
'null'
)
:
PdfStream
.
num
(
posX
),
posY
==
null
?
PdfStream
.
string
(
'null'
)
:
PdfStream
.
num
(
posY
),
posZ
==
null
?
PdfStream
.
string
(
'null'
)
:
PdfStream
.
num
(
posZ
),
if
(
posX
==
null
)
PdfStream
.
string
(
'null'
)
else
PdfStream
.
num
(
posX
),
if
(
posY
==
null
)
PdfStream
.
string
(
'null'
)
else
PdfStream
.
num
(
posY
),
if
(
posZ
==
null
)
PdfStream
.
string
(
'null'
)
else
PdfStream
.
num
(
posZ
),
]),
}));
}
...
...
pdf/lib/widgets/geometry.dart
View file @
a695e2a
...
...
@@ -27,10 +27,10 @@ class BoxConstraints {
/// Creates box constraints that require the given width or height.
const
BoxConstraints
.
tightFor
({
double
width
,
double
height
})
:
minWidth
=
width
!=
null
?
width
:
0.0
,
maxWidth
=
width
!=
null
?
width
:
double
.
infinity
,
minHeight
=
height
!=
null
?
height
:
0.0
,
maxHeight
=
height
!=
null
?
height
:
double
.
infinity
;
:
minWidth
=
width
??
0.0
,
maxWidth
=
width
??
double
.
infinity
,
minHeight
=
height
??
0.0
,
maxHeight
=
height
??
double
.
infinity
;
/// Creates box constraints that is respected only by the given size.
BoxConstraints
.
tight
(
PdfPoint
size
)
...
...
@@ -41,10 +41,10 @@ class BoxConstraints {
/// Creates box constraints that expand to fill another box constraints.
const
BoxConstraints
.
expand
({
double
width
,
double
height
})
:
minWidth
=
width
!=
null
?
width
:
double
.
infinity
,
maxWidth
=
width
!=
null
?
width
:
double
.
infinity
,
minHeight
=
height
!=
null
?
height
:
double
.
infinity
,
maxHeight
=
height
!=
null
?
height
:
double
.
infinity
;
:
minWidth
=
width
??
double
.
infinity
,
maxWidth
=
width
??
double
.
infinity
,
minHeight
=
height
??
double
.
infinity
,
maxHeight
=
height
??
double
.
infinity
;
const
BoxConstraints
.
tightForFinite
({
double
width
=
double
.
infinity
,
...
...
pdf/pubspec.yaml
View file @
a695e2a
...
...
@@ -7,7 +7,7 @@ issue_tracker: https://github.com/DavBfr/dart_pdf/issues
version
:
1.3.24
environment
:
sdk
:
"
>=2.
1
.0
<3.0.0"
sdk
:
"
>=2.
3
.0
<3.0.0"
dependencies
:
meta
:
"
^1.1.5"
...
...
pdf/test/orientation_test.dart
View file @
a695e2a
...
...
@@ -45,7 +45,7 @@ List<Widget> contentMultiPage(Context context) {
height:
20
,
child:
Text
(
'Hello World
$n
!'
,
style:
TextStyle
(
fontSize:
15
),
style:
const
TextStyle
(
fontSize:
15
),
)),
);
}
...
...
printing/analysis_options.yaml
View file @
a695e2a
...
...
@@ -33,11 +33,11 @@ analyzer:
# Please see https://github.com/flutter/flutter/pull/24528 for details.
sdk_version_async_exported_from_core
:
ignore
exclude
:
-
'
bin/cache/**'
-
"
bin/cache/**"
# the following two are relative to the stocks example and the flutter package respectively
# see https://github.com/dart-lang/sdk/issues/28463
-
'
lib/i18n/stock_messages_*.dart'
-
'
lib/src/http/**'
-
"
lib/i18n/stock_messages_*.dart"
-
"
lib/src/http/**"
linter
:
rules
:
...
...
@@ -52,7 +52,7 @@ linter:
-
annotate_overrides
# - avoid_annotating_with_dynamic # conflicts with always_specify_types
-
avoid_as
# - avoid_bool_literals_in_conditional_expressions # not yet tested
-
avoid_bool_literals_in_conditional_expressions
# - avoid_catches_without_on_clauses # we do this commonly
# - avoid_catching_errors # we do this commonly
-
avoid_classes_with_only_static_members
...
...
@@ -90,6 +90,7 @@ linter:
# - constant_identifier_names # needs an opt-out https://github.com/dart-lang/linter/issues/204
-
control_flow_in_finally
# - curly_braces_in_flow_control_structures # not yet tested
# - diagnostic_describe_all_properties # not yet tested
-
directives_ordering
-
empty_catches
-
empty_constructor_bodies
...
...
@@ -120,7 +121,8 @@ linter:
# - parameter_assignments # we do this commonly
-
prefer_adjacent_string_concatenation
-
prefer_asserts_in_initializer_lists
# - prefer_collection_literals # temporary until all platforms support set literals
# - prefer_asserts_with_message # not yet tested
-
prefer_collection_literals
-
prefer_conditional_assignment
-
prefer_const_constructors
-
prefer_const_constructors_in_immutables
...
...
@@ -128,30 +130,39 @@ linter:
-
prefer_const_literals_to_create_immutables
# - prefer_constructors_over_static_methods # not yet tested
-
prefer_contains
# - prefer_double_quotes # opposite of prefer_single_quotes
-
prefer_equal_for_default_values
# - prefer_expression_function_bodies # conflicts with https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#consider-using--for-short-functions-and-methods
-
prefer_final_fields
# - prefer_final_in_for_each # not yet tested
-
prefer_final_locals
# - prefer_for_elements_to_map_fromIterable # not yet tested
-
prefer_foreach
# - prefer_function_declarations_over_variables # not yet tested
-
prefer_generic_function_type_aliases
-
prefer_if_elements_to_conditional_expressions
-
prefer_if_null_operators
-
prefer_initializing_formals
-
prefer_inlined_adds
# - prefer_int_literals # not yet tested
# - prefer_interpolation_to_compose_strings # not yet tested
-
prefer_is_empty
-
prefer_is_not_empty
-
prefer_iterable_whereType
# - prefer_mixin # https://github.com/dart-lang/language/issues/32
# - prefer_null_aware_operators # disable until NNBD, see https://github.com/flutter/flutter/pull/32711#issuecomment-492930932
-
prefer_single_quotes
-
prefer_spread_collections
-
prefer_typing_uninitialized_variables
-
prefer_void_to_null
# - provide_deprecation_message # not yet tested
# - public_member_api_docs # enabled on a case-by-case basis; see e.g. packages/analysis_options.yaml
-
recursive_getters
-
slash_for_doc_comments
# - sort_child_properties_last # not yet tested
-
sort_constructors_first
-
sort_pub_dependencies
-
sort_unnamed_constructors_first
# - super_goes_last # no longer needed w/ Dart 2
-
test_types_in_equals
-
throw_in_finally
# - type_annotate_public_apis # subset of always_specify_types
...
...
@@ -170,6 +181,8 @@ linter:
-
unnecessary_statements
-
unnecessary_this
-
unrelated_type_equality_checks
# - unsafe_html # not yet tested
-
use_full_hex_values_for_flutter_colors
# - use_function_type_syntax_for_parameters # not yet tested
-
use_rethrow_when_possible
# - use_setters_to_change_properties # not yet tested
...
...
printing/example/lib/main.dart
View file @
a695e2a
...
...
@@ -201,8 +201,8 @@ class MyAppState extends State<MyApp> {
RaisedButton
(
child:
const
Text
(
'Print Markdown'
),
onPressed:
_printMarkdown
),
canDebug
?
Row
(
if
(
canDebug
)
Row
(
mainAxisSize:
MainAxisSize
.
min
,
children:
<
Widget
>[
const
Text
(
'Debug'
),
...
...
@@ -216,7 +216,8 @@ class MyAppState extends State<MyApp> {
),
],
)
:
const
SizedBox
(),
else
const
SizedBox
(),
],
),
),
...
...
printing/example/pubspec.yaml
View file @
a695e2a
...
...
@@ -4,7 +4,7 @@ description: Pdf Printing Example
version
:
1.0.0+1
environment
:
sdk
:
"
>=2.
1
.0
<3.0.0"
sdk
:
"
>=2.
3
.0
<3.0.0"
dependencies
:
flutter
:
...
...
printing/pubspec.yaml
View file @
a695e2a
...
...
@@ -7,7 +7,7 @@ issue_tracker: https://github.com/DavBfr/dart_pdf/issues
version
:
2.1.8
environment
:
sdk
:
"
>=2.
1
.0
<3.0.0"
sdk
:
"
>=2.
3
.0
<3.0.0"
flutter
:
"
^1.7.0"
dependencies
:
...
...
Please
register
or
login
to post a comment