Skip to content

Commit

Permalink
fix: clean project
Browse files Browse the repository at this point in the history
  • Loading branch information
vaetas committed Nov 4, 2021
1 parent 9c9655e commit f3b0764
Show file tree
Hide file tree
Showing 43 changed files with 215 additions and 1,394 deletions.
2 changes: 1 addition & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include: package:pedantic/analysis_options.yaml
include: package:flutter_lints/flutter.yaml

analyzer:
exclude:
Expand Down
127 changes: 127 additions & 0 deletions example/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
include: package:flutter_lints/flutter.yaml

analyzer:
exclude:
- build/**
- lib/**.g.dart
- lib/**.freezed.dart
- lib/**.gr.dart
- lib/**.moor.dart
- lib/generated/** # Generated locale code by intl

# See https://dart.dev/guides/language/analysis-options#enabling-additional-type-checks
strong-mode:
# Type inference engine never implicitly casts to a more specific type.
implicit-casts: false

# Type inference engine never chooses the dynamic type when it can’t determine a static type.
implicit-dynamic: false

errors:
missing_required_param: warning
missing_return: warning

# For all rules see https://dart-lang.github.io/linter/lints/
linter:
rules:
- always_declare_return_types
- always_require_non_null_named_parameters
- annotate_overrides
- avoid_empty_else
- avoid_function_literals_in_foreach_calls
- avoid_init_to_null
- avoid_null_checks_in_equality_operators
- avoid_print
- avoid_relative_lib_imports
- avoid_renaming_method_parameters
- avoid_return_types_on_setters
- avoid_returning_null
- avoid_shadowing_type_parameters
- avoid_types_as_parameter_names
- avoid_unnecessary_containers
- avoid_unused_constructor_parameters
- avoid_void_async
- avoid_returning_null_for_void
- always_use_package_imports
- await_only_futures
- camel_case_extensions
- camel_case_types
- cancel_subscriptions
- cascade_invocations
- comment_references
- constant_identifier_names
- control_flow_in_finally
- directives_ordering
- empty_catches
- empty_constructor_bodies
- empty_statements
- hash_and_equals
- implementation_imports
- invariant_booleans
- iterable_contains_unrelated_type
- join_return_with_assignment
- library_names
- library_prefixes
- lines_longer_than_80_chars
- list_remove_unrelated_type
- no_adjacent_strings_in_list
- no_duplicate_case_values
- non_constant_identifier_names
- null_closures
- omit_local_variable_types
- only_throw_errors
- overridden_fields
- package_api_docs
- package_names
- package_prefixed_library_names
- prefer_adjacent_string_concatenation
- prefer_collection_literals
- prefer_conditional_assignment
- prefer_const_constructors
- prefer_const_declarations
- prefer_contains
- prefer_equal_for_default_values
- prefer_final_fields
- prefer_final_in_for_each
- prefer_final_locals
- prefer_for_elements_to_map_fromIterable
- prefer_generic_function_type_aliases
- prefer_if_elements_to_conditional_expressions
- prefer_if_null_operators
- prefer_initializing_formals
- prefer_interpolation_to_compose_strings
- prefer_is_empty
- prefer_is_not_empty
- prefer_iterable_whereType
- prefer_mixin
- prefer_single_quotes
- prefer_spread_collections
- prefer_typing_uninitialized_variables
- prefer_void_to_null
- recursive_getters
- sized_box_for_whitespace
- slash_for_doc_comments
- sort_constructors_first
- sort_unnamed_constructors_first
- sort_child_properties_last
- sort_pub_dependencies
- test_types_in_equals
- throw_in_finally
- type_init_formals
- unawaited_futures
- unnecessary_await_in_return
- unnecessary_brace_in_string_interps
- unnecessary_const
- unnecessary_getters_setters
- unnecessary_lambdas
- unnecessary_new
- unnecessary_null_aware_assignments
- unnecessary_null_in_if_null_operators
- unnecessary_statements
- unnecessary_string_interpolations
- unnecessary_this
- unrelated_type_equality_checks
- use_function_type_syntax_for_parameters
- use_rethrow_when_possible
- use_to_and_as_if_applicable
- valid_regexps
2 changes: 1 addition & 1 deletion example/ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>8.0</string>
<string>9.0</string>
</dict>
</plist>
54 changes: 44 additions & 10 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
// ignore_for_file: avoid_print
import 'package:flutter/material.dart';
import 'package:pressable/pressable.dart';

void main() {
runApp(MyApp());
runApp(const MyApp());
}

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

@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: HomeScreen(),
home: const HomeScreen(),
);
}
}
Expand All @@ -32,35 +35,66 @@ class HomeScreen extends StatelessWidget {
print('[HomeScreen.build] Builder pressed');
},
builder: (context, isPressed) {
return ExampleButton(
title: 'Builder',
return AnimatedContainer(
width: 150,
height: 50,
color: isPressed ? Colors.blue : const Color(0xFFd6d6d6),
duration: const Duration(milliseconds: 100),
child: const Center(
child: Text('Custom Builder'),
),
);
},
),
Pressable.ripple(
onPressed: () {
print('[HomeScreen.build] Ripple pressed');
},
child: ExampleButton(title: 'Ripple'),
child: const ExampleButton(title: 'Ripple'),
),
Pressable.scale(
onPressed: () {
print('[HomeScreen.build] Scale pressed');
},
child: ExampleButton(title: 'Scale'),
child: const ExampleButton(title: 'Scale'),
),
Pressable.opacity(
onPressed: () {
print('[HomeScreen.build] Opacity pressed');
},
child: ExampleButton(title: 'Opacity'),
child: const ExampleButton(title: 'Opacity'),
),
Pressable.fill(
onPressed: () {
print('[HomeScreen.build] Fill pressed');
},
fillColor: Colors.red.withOpacity(0.2),
child: ExampleButton(title: 'Fill'),
child: const ExampleButton(title: 'Fill'),
),
SizedBox(
width: 150,
child: Stack(
children: [
Pressable.scale(
onPressed: () {
print('[HomeScreen.build] Scale pressed');
},
child: Container(
width: 150,
height: 50,
color: Colors.black12,
child: const Center(child: Text('Test')),
),
),
Align(
alignment: Alignment.centerRight,
child: IconButton(
onPressed: () {},
icon: const Icon(Icons.bookmark),
),
),
],
),
),
],
),
Expand All @@ -86,10 +120,10 @@ class ExampleButton extends StatelessWidget {
child: Row(
children: [
Text(title),
Spacer(),
const Spacer(),
IconButton(
onPressed: () {},
icon: Icon(Icons.bookmark),
icon: const Icon(Icons.bookmark),
),
],
),
Expand Down
6 changes: 0 additions & 6 deletions example/macos/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion example/macos/Flutter/Flutter-Debug.xcconfig

This file was deleted.

1 change: 0 additions & 1 deletion example/macos/Flutter/Flutter-Release.xcconfig

This file was deleted.

10 changes: 0 additions & 10 deletions example/macos/Flutter/GeneratedPluginRegistrant.swift

This file was deleted.

Loading

0 comments on commit f3b0764

Please sign in to comment.