refactor: Add Flutter lints
This commit is contained in:
parent
7a1eded1bb
commit
2b2b96872d
6 changed files with 16 additions and 12 deletions
|
|
@ -22,6 +22,7 @@ analyzer:
|
||||||
|
|
||||||
dart_code_linter:
|
dart_code_linter:
|
||||||
rules:
|
rules:
|
||||||
|
# Dart specific:
|
||||||
- avoid-dynamic
|
- avoid-dynamic
|
||||||
- avoid-redundant-async
|
- avoid-redundant-async
|
||||||
- avoid-unnecessary-type-assertions
|
- avoid-unnecessary-type-assertions
|
||||||
|
|
@ -47,4 +48,13 @@ dart_code_linter:
|
||||||
# message: 'Do not import Flutter Material Design library, we should not depend on it!'
|
# message: 'Do not import Flutter Material Design library, we should not depend on it!'
|
||||||
# - no-magic-number:
|
# - no-magic-number:
|
||||||
# allowed: [-1, 0, 1,2,4,6,8,12,16,32,40,56,64]
|
# allowed: [-1, 0, 1,2,4,6,8,12,16,32,40,56,64]
|
||||||
# allow-only-once: true
|
# allow-only-once: true
|
||||||
|
# Flutter specific:
|
||||||
|
- prefer-media-query-direct-access
|
||||||
|
- avoid-wrapping-in-padding
|
||||||
|
- prefer-correct-edge-insets-constructor
|
||||||
|
# TODO:
|
||||||
|
# - avoid-returning-widgets
|
||||||
|
# - prefer-single-widget-per-file:
|
||||||
|
# ignore-private-widgets: true
|
||||||
|
# - prefer-extracting-callbacks
|
||||||
|
|
@ -132,10 +132,7 @@ class ChatListViewBody extends StatelessWidget {
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 64,
|
height: 64,
|
||||||
child: ListView(
|
child: ListView(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.all(12.0),
|
||||||
horizontal: 12.0,
|
|
||||||
vertical: 12.0,
|
|
||||||
),
|
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
scrollDirection: Axis.horizontal,
|
scrollDirection: Axis.horizontal,
|
||||||
children:
|
children:
|
||||||
|
|
|
||||||
|
|
@ -124,10 +124,7 @@ class ChatMembersView extends StatelessWidget {
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 64,
|
height: 64,
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.all(12.0),
|
||||||
horizontal: 12.0,
|
|
||||||
vertical: 12.0,
|
|
||||||
),
|
|
||||||
scrollDirection: Axis.horizontal,
|
scrollDirection: Axis.horizontal,
|
||||||
itemCount: availableFilters.length,
|
itemCount: availableFilters.length,
|
||||||
itemBuilder: (context, i) => Padding(
|
itemBuilder: (context, i) => Padding(
|
||||||
|
|
|
||||||
|
|
@ -552,7 +552,7 @@ class MyCallingPage extends State<Calling> {
|
||||||
if (secondaryStreamViews.isNotEmpty) {
|
if (secondaryStreamViews.isNotEmpty) {
|
||||||
stackWidgets.add(
|
stackWidgets.add(
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.fromLTRB(0, 20, 0, 120),
|
padding: const EdgeInsets.only(top: 20, bottom: 120),
|
||||||
alignment: Alignment.bottomRight,
|
alignment: Alignment.bottomRight,
|
||||||
child: Container(
|
child: Container(
|
||||||
width: _localVideoWidth,
|
width: _localVideoWidth,
|
||||||
|
|
|
||||||
|
|
@ -120,7 +120,7 @@ class KeyVerificationPageState extends State<KeyVerificationDialog> {
|
||||||
final textEditingController = TextEditingController();
|
final textEditingController = TextEditingController();
|
||||||
String input;
|
String input;
|
||||||
body = Container(
|
body = Container(
|
||||||
margin: const EdgeInsets.only(left: 8.0, right: 8.0),
|
margin: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: .min,
|
mainAxisSize: .min,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ class LoginScaffold extends StatelessWidget {
|
||||||
),
|
),
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
if (!MediaQuery.of(context).disableAnimations)
|
if (!MediaQuery.disableAnimationsOf(context))
|
||||||
ParticleNetwork(
|
ParticleNetwork(
|
||||||
maxSpeed: 0.25,
|
maxSpeed: 0.25,
|
||||||
particleColor: theme.colorScheme.primary,
|
particleColor: theme.colorScheme.primary,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue