Skip to content

Commit

Permalink
Flutter lints
Browse files Browse the repository at this point in the history
  • Loading branch information
jpeiffer committed Nov 3, 2023
1 parent 8e8b4b2 commit 042eafa
Show file tree
Hide file tree
Showing 13 changed files with 166 additions and 68 deletions.
5 changes: 5 additions & 0 deletions annotation/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## [1.0.2] - November 2nd, 2023

* Updated [flutter_lints](https://pub.dev/packages/flutter_lints) to `3.0.0`


## [1.0.1+1] - August 29, 2023

* Automated dependency updates
Expand Down
21 changes: 21 additions & 0 deletions annotation/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
include: package:flutter_lints/flutter.yaml

linter:
rules:
- always_declare_return_types
- avoid_equals_and_hash_code_on_mutable_classes
- avoid_escaping_inner_quotes
- avoid_slow_async_io
- cancel_subscriptions
- close_sinks
- directives_ordering
- empty_constructor_bodies
- omit_local_variable_types
- prefer_final_locals
- prefer_single_quotes
- sort_child_properties_last
- sort_constructors_first
- sort_pub_dependencies
- sort_unnamed_constructors_first
- unawaited_futures
- use_full_hex_values_for_flutter_colors
14 changes: 7 additions & 7 deletions annotation/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
name: 'json_theme_annotation'
description: 'Simple package holding the annotations needed by the JsonTheme code generator.'
homepage: 'https://github.com/peiffer-innovations/json_theme'
version: '1.0.1+1'
version: '1.0.2'

environment:
environment:
sdk: '>=3.0.0 <4.0.0'

analyzer:
exclude:
analyzer:
exclude:
- 'lib/generated/**'
- 'lib/**/*.g.dart'


dev_dependencies:
dev_dependencies:
flutter_lints: '^3.0.0'
test: '^1.24.6'

ignore_updates:
ignore_updates:
- 'archive'
- 'async'
- 'boolean_selector'
Expand Down
5 changes: 5 additions & 0 deletions codegen/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## [1.1.2] - November 2nd, 2023

* Updated [flutter_lints](https://pub.dev/packages/flutter_lints) to `3.0.0`


## [1.1.1] - September 3rd, 2023

* Dependency updates
Expand Down
21 changes: 21 additions & 0 deletions codegen/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
include: package:flutter_lints/flutter.yaml

linter:
rules:
- always_declare_return_types
- avoid_equals_and_hash_code_on_mutable_classes
- avoid_escaping_inner_quotes
- avoid_slow_async_io
- cancel_subscriptions
- close_sinks
- directives_ordering
- empty_constructor_bodies
- omit_local_variable_types
- prefer_final_locals
- prefer_single_quotes
- sort_child_properties_last
- sort_constructors_first
- sort_pub_dependencies
- sort_unnamed_constructors_first
- unawaited_futures
- use_full_hex_values_for_flutter_colors
3 changes: 2 additions & 1 deletion codegen/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: 'json_theme_codegen'
description: 'A library to generate the mapping of decoders to the class names they decode'
homepage: 'https://github.com/peiffer-innovations/json_theme'
version: '1.1.1'
version: '1.1.2'

environment:
sdk: '>=3.0.0 <4.0.0'
Expand All @@ -21,6 +21,7 @@ dependencies:
source_gen: '^1.4.0'

dev_dependencies:
flutter_lints: '^3.0.0'
test: '^1.24.6'

dependency_overrides:
Expand Down
5 changes: 5 additions & 0 deletions json_theme/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## [6.3.1] - November 2nd, 2023

* Updated [flutter_lints](https://pub.dev/packages/flutter_lints) to `3.0.0`


## [6.3.0] - September 27th, 2023

* Added codecs for:
Expand Down
29 changes: 18 additions & 11 deletions json_theme/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ void main() {

class MyApp extends StatelessWidget {
const MyApp({
Key? key,
}) : super(key: key);
super.key,
});

@override
Widget build(BuildContext context) {
Expand All @@ -23,11 +23,16 @@ class MyApp extends StatelessWidget {
}
}

class RootPage extends StatelessWidget {
class RootPage extends StatefulWidget {
const RootPage({
Key? key,
}) : super(key: key);
super.key,
});

@override
State createState() => _RootPageState();
}

class _RootPageState extends State<RootPage> {
static const _themes = [
'default',
'big_red',
Expand All @@ -44,13 +49,15 @@ class RootPage extends StatelessWidget {
) ??
ThemeData();

await Navigator.of(context).push(
MaterialPageRoute(
builder: (BuildContext context) => ThemePage(
theme: theme,
if (mounted) {
await Navigator.of(context).push(
MaterialPageRoute(
builder: (BuildContext context) => ThemePage(
theme: theme,
),
),
),
);
);
}
}

@override
Expand Down
10 changes: 5 additions & 5 deletions json_theme/example/lib/src/example_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import 'package:flutter/material.dart';
import 'package:form_validation/form_validation.dart';

class ExampleForm extends StatefulWidget {
ExampleForm({
Key? key,
}) : super(key: key);
const ExampleForm({
super.key,
});

@override
_ExampleFormState createState() => _ExampleFormState();
State createState() => _ExampleFormState();
}

class _ExampleFormState extends State<ExampleForm> {
Expand Down Expand Up @@ -511,7 +511,7 @@ class _ExampleFormState extends State<ExampleForm> {
}

List<String> _createCountryList() {
final str = '''Afghanistan
const str = '''Afghanistan
Albania
Algeria
Andorra
Expand Down
7 changes: 3 additions & 4 deletions json_theme/example/lib/src/theme_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ import 'package:flutter/material.dart';

class ThemePage extends StatelessWidget {
ThemePage({
Key? key,
super.key,
ThemeData? theme,
}) : theme = theme ?? ThemeData(),
super(key: key);
}) : theme = theme ?? ThemeData();

final ThemeData theme;

Expand All @@ -19,7 +18,7 @@ class ThemePage extends StatelessWidget {
appBar: AppBar(
title: const Text('Themed Page'),
),
body: SingleChildScrollView(
body: const SingleChildScrollView(
child: ExampleForm(),
),
),
Expand Down
48 changes: 20 additions & 28 deletions json_theme/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,50 +3,42 @@ description: 'Example application for the JSON Theme'
publish_to: 'none'
version: '1.0.0+36'

environment:
environment:
sdk: '>=3.0.0 <4.0.0'

dependencies:
flutter:
dependencies:
flutter:
sdk: 'flutter'
form_validation: '^3.0.2+2'
google_fonts: '^5.1.0'
intl: '^0.18.1'
json_theme:
json_theme:
path: '../'
meta: '^1.9.1'

dev_dependencies:
flutter_test:
dev_dependencies:
flutter_lints: '^3.0.0'
flutter_test:
sdk: 'flutter'


flutter:
flutter:
uses-material-design: true
assets:
assets:
- 'assets/themes/'
fonts:
-
family: 'lato'
fonts:
-
asset: 'assets/fonts/Lato-Regular.ttf'

-
family: 'metal'
fonts:
-
asset: 'assets/fonts/MetalMania-Regular.ttf'

-
family: 'MaterialIcons'
fonts:
-
asset: 'assets/fonts/MaterialIcons-Regular.ttf'
fonts:
- family: 'lato'
fonts:
- asset: 'assets/fonts/Lato-Regular.ttf'

- family: 'metal'
fonts:
- asset: 'assets/fonts/MetalMania-Regular.ttf'

- family: 'MaterialIcons'
fonts:
- asset: 'assets/fonts/MaterialIcons-Regular.ttf'

ignore_updates:
ignore_updates:
- 'archive'
- 'async'
- 'boolean_selector'
Expand Down
4 changes: 2 additions & 2 deletions json_theme/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: 'json_theme'
description: 'A library to dynamically generate a ThemeData object from a JSON file or dynamic map object'
homepage: 'https://github.com/peiffer-innovations/json_theme'
version: '6.3.0'
version: '6.3.1'

environment:
sdk: '>=3.0.0 <4.0.0'
Expand All @@ -25,7 +25,7 @@ dev_dependencies:
build: '^2.4.1'
build_runner: '^2.4.6'
code_builder: '^4.7.0'
flutter_lints: '^2.0.2'
flutter_lints: '^3.0.0'
flutter_test:
sdk: 'flutter'
json_theme_codegen: '^1.1.0'
Expand Down
Loading

0 comments on commit 042eafa

Please sign in to comment.