From 14e4496de4138c317791030215803e7d57ec85bc Mon Sep 17 00:00:00 2001 From: davidpkj Date: Sun, 5 Mar 2023 13:05:25 +0100 Subject: Refactored according to flutter lint --- lib/views/recipe_view.dart | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'lib/views/recipe_view.dart') diff --git a/lib/views/recipe_view.dart b/lib/views/recipe_view.dart index f512770..faaa0ca 100644 --- a/lib/views/recipe_view.dart +++ b/lib/views/recipe_view.dart @@ -28,10 +28,10 @@ class RecipeView extends StatefulWidget { final Function? showToastCallback; @override - _RecipeViewState createState() => _RecipeViewState(); + RecipeViewState createState() => RecipeViewState(); } -class _RecipeViewState extends State { +class RecipeViewState extends State { final GlobalKey _formKey = GlobalKey(); final GlobalKey _scaffoldKey = GlobalKey(); final TextEditingController _controller1 = TextEditingController(); @@ -170,7 +170,7 @@ class _RecipeViewState extends State { Widget _buildUtilityRow() { if (widget.remote) { - return SizedBox( + return const SizedBox( height: 10.0, width: double.infinity, ); @@ -248,11 +248,11 @@ class _RecipeViewState extends State { Widget _buildDescriptionInput() { return Padding( padding: const EdgeInsets.all(18.0), - child: _isEditModeEnabled ? _buildInputDescriptuion() : _buildMarkdownDescription(), + child: _isEditModeEnabled ? _buildInputDescription() : _buildMarkdownDescription(), ); } - TextField _buildInputDescriptuion() { + TextField _buildInputDescription() { return TextField( expands: true, maxLines: null, @@ -263,7 +263,7 @@ class _RecipeViewState extends State { focusNode: _detailsTextFocus, style: cRecipeDescriptionStyle, enableInteractiveSelection: true, - toolbarOptions: ToolbarOptions( + toolbarOptions: const ToolbarOptions( copy: true, cut: true, paste: true, @@ -276,7 +276,7 @@ class _RecipeViewState extends State { return MarkdownBody( data: _controller2.text, selectable: true, - onTapLink: (text, href, title) => null, + onTapLink: (text, href, title) => {}, imageBuilder: (uri, title, alt) => Container(), // styleSheet: CustomMarkdownStyle(), ); @@ -333,7 +333,7 @@ class _RecipeViewState extends State { List _remoteDownloadAction = [ IconButton( - icon: Icon(Icons.save_alt_rounded), + icon: const Icon(Icons.save_alt_rounded), onPressed: () { downloadRecipe(context, recipe); }, @@ -341,7 +341,7 @@ class _RecipeViewState extends State { ]; List _remoteLookupAction = [ - IconButton( + const IconButton( icon: Icon(Icons.menu_open_rounded), onPressed: null, ), @@ -361,7 +361,7 @@ class _RecipeViewState extends State { return AppBar( title: Text(_title), leading: IconButton( - icon: Icon(Icons.close), + icon: const Icon(Icons.close), onPressed: () { Navigator.pop(context); }, @@ -373,12 +373,12 @@ class _RecipeViewState extends State { Widget _buildAppBarCheckActions() { if (_isEditModeEnabled) { return IconButton( - icon: Icon(Icons.check), + icon: const Icon(Icons.check), onPressed: _addRecipe, ); } else { return IconButton( - icon: Icon(Icons.edit), + icon: const Icon(Icons.edit), onPressed: () { _isEditModeEnabled = true; -- cgit v1.2.3