From 7f88684d8c55c9fea3acf9067fbf7bd0beeb339e Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Fri, 8 Oct 2021 21:12:22 +0100 Subject: [PATCH] linter warning --- .../simplex_app/lib/animations/bottom_animation.dart | 4 ++-- .../lib/views/contacts/add_contact_view.dart | 10 +++++----- .../simplex_app/lib/views/group/add_group_view.dart | 2 +- .../simplex_app/lib/views/home/home_view_widget.dart | 2 +- packages/simplex_app/lib/views/setup_profile_view.dart | 2 +- packages/simplex_app/lib/widgets/custom_btn.dart | 3 ++- 6 files changed, 12 insertions(+), 11 deletions(-) diff --git a/packages/simplex_app/lib/animations/bottom_animation.dart b/packages/simplex_app/lib/animations/bottom_animation.dart index 6c1f28e361..ace0a0ef63 100644 --- a/packages/simplex_app/lib/animations/bottom_animation.dart +++ b/packages/simplex_app/lib/animations/bottom_animation.dart @@ -6,7 +6,7 @@ class Animator extends StatefulWidget { final Widget child; final Duration time; - const Animator(this.child, this.time); + const Animator(this.child, this.time, {Key? key}): super(key: key); @override _AnimatorState createState() => _AnimatorState(); @@ -69,7 +69,7 @@ Duration wait() { class WidgetAnimator extends StatelessWidget { final Widget? child; - const WidgetAnimator({this.child}); + const WidgetAnimator({this.child, Key? key}): super(key: key); @override Widget build(BuildContext context) { diff --git a/packages/simplex_app/lib/views/contacts/add_contact_view.dart b/packages/simplex_app/lib/views/contacts/add_contact_view.dart index 6c2eb9a488..91dbdbbcdf 100644 --- a/packages/simplex_app/lib/views/contacts/add_contact_view.dart +++ b/packages/simplex_app/lib/views/contacts/add_contact_view.dart @@ -51,7 +51,7 @@ class _AddContactViewState extends State { }, ), onPressed: () async { - _qrViewController?.toggleFlash(); + await _qrViewController?.toggleFlash(); setState(() {}); }, ), @@ -63,13 +63,13 @@ class _AddContactViewState extends State { }, ), onPressed: () async { - _qrViewController?.flipCamera(); + await _qrViewController?.flipCamera(); setState(() {}); }, ), ], ), - body: Container( + body: SizedBox( height: MediaQuery.of(context).size.height, child: Stack( children: [ @@ -107,7 +107,7 @@ class _AddContactViewState extends State { controller.scannedDataStream.listen((scanData) { setState(() async { result = scanData; - controller.pauseCamera(); + await controller.pauseCamera(); if (result != null) { await Navigator.push( context, @@ -117,7 +117,7 @@ class _AddContactViewState extends State { ), ), ); - controller.resumeCamera(); + await controller.resumeCamera(); } }); }); diff --git a/packages/simplex_app/lib/views/group/add_group_view.dart b/packages/simplex_app/lib/views/group/add_group_view.dart index f85881747d..750bfa7aad 100644 --- a/packages/simplex_app/lib/views/group/add_group_view.dart +++ b/packages/simplex_app/lib/views/group/add_group_view.dart @@ -113,7 +113,7 @@ class _GroupDPState extends State { @override Widget build(BuildContext context) { - return Container( + return SizedBox( height: 180.0, width: 180.0, child: Stack( diff --git a/packages/simplex_app/lib/views/home/home_view_widget.dart b/packages/simplex_app/lib/views/home/home_view_widget.dart index 99cdab1a7e..359e161b75 100644 --- a/packages/simplex_app/lib/views/home/home_view_widget.dart +++ b/packages/simplex_app/lib/views/home/home_view_widget.dart @@ -63,7 +63,7 @@ class _HomeViewWidgetState extends State { ), const SizedBox(height: 10.0), !_haveConnections - ? Container( + ? SizedBox( height: MediaQuery.of(context).size.height * 0.7, child: Center( child: Column( diff --git a/packages/simplex_app/lib/views/setup_profile_view.dart b/packages/simplex_app/lib/views/setup_profile_view.dart index 7e52382e2b..368a98797d 100644 --- a/packages/simplex_app/lib/views/setup_profile_view.dart +++ b/packages/simplex_app/lib/views/setup_profile_view.dart @@ -133,7 +133,7 @@ class _UserProfilePicState extends State { @override Widget build(BuildContext context) { - return Container( + return SizedBox( height: 180.0, width: 180.0, child: Stack( diff --git a/packages/simplex_app/lib/widgets/custom_btn.dart b/packages/simplex_app/lib/widgets/custom_btn.dart index fbe85c9e70..34d3c5cc6e 100644 --- a/packages/simplex_app/lib/widgets/custom_btn.dart +++ b/packages/simplex_app/lib/widgets/custom_btn.dart @@ -7,7 +7,8 @@ class CustomButton extends StatelessWidget { @required this.onPressed, @required this.color, @required this.child, - }); + Key? key + }): super(key: key); final double? width; final double? height; final void Function()? onPressed;