diff --git a/analysis_options.yaml b/analysis_options.yaml index f96bdc15..894cdcee 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -82,8 +82,8 @@ linter: # - parameter_assignments # we do this commonly - prefer_adjacent_string_concatenation - prefer_collection_literals - # - prefer_conditional_assignment # not yet tested - # - prefer_const_constructors + - prefer_conditional_assignment + - prefer_const_constructors # - prefer_constructors_over_static_methods # not yet tested - prefer_contains - prefer_equal_for_default_values @@ -107,7 +107,7 @@ linter: - unnecessary_brace_in_string_interps # - unnecessary_const - unnecessary_getters_setters - # - unnecessary_lambdas # https://github.com/dart-lang/linter/issues/498 + - unnecessary_lambdas - unnecessary_new - unnecessary_null_aware_assignments - unnecessary_null_in_if_null_operators diff --git a/lib/app.dart b/lib/app.dart index 51a2b0934..a81029a6 100644 --- a/lib/app.dart +++ b/lib/app.dart @@ -113,7 +113,7 @@ class JournalApp extends StatelessWidget { } return MaterialApp( - key: ValueKey("App"), + key: const ValueKey("App"), title: 'GitJournal', theme: themeData, navigatorObservers: [JournalApp.observer], diff --git a/lib/gitapp.dart b/lib/gitapp.dart index cee46bf0..879803ea 100644 --- a/lib/gitapp.dart +++ b/lib/gitapp.dart @@ -15,7 +15,7 @@ class GitApp extends StatelessWidget { home: Scaffold( key: _scaffoldKey, appBar: AppBar( - title: Text('Git Test'), + title: const Text('Git Test'), ), body: Column( children: _buildGitButtons(), @@ -48,12 +48,12 @@ class GitApp extends StatelessWidget { return [ RaisedButton( - child: Text("Generate Keys"), + child: const Text("Generate Keys"), onPressed: () { generateSSHKeys(comment: "Git Sample App"); }), RaisedButton( - child: Text("Git Clone"), + child: const Text("Git Clone"), onPressed: () async { try { await GitRepo.clone(basePath, cloneUrl); @@ -65,25 +65,25 @@ class GitApp extends StatelessWidget { }, ), RaisedButton( - child: Text("Git Pull"), + child: const Text("Git Pull"), onPressed: () async { gitRepo.pull(); }, ), RaisedButton( - child: Text("Git Add"), + child: const Text("Git Add"), onPressed: () async { gitRepo.add("."); }, ), RaisedButton( - child: Text("Git Push"), + child: const Text("Git Push"), onPressed: () async { gitRepo.push(); }, ), RaisedButton( - child: Text("Git Commit"), + child: const Text("Git Commit"), onPressed: () async { gitRepo.commit( message: "Default message from GitJournal", @@ -92,13 +92,13 @@ class GitApp extends StatelessWidget { }, ), RaisedButton( - child: Text("Git Reset Last"), + child: const Text("Git Reset Last"), onPressed: () async { gitRepo.resetLast(); }, ), RaisedButton( - child: Text("Git Migrate"), + child: const Text("Git Migrate"), onPressed: () async { var baseGitPath = await getGitBaseDirectory(); await migrateGitRepo( diff --git a/lib/note.dart b/lib/note.dart index f3ed5aaf..eb88d354 100644 --- a/lib/note.dart +++ b/lib/note.dart @@ -72,9 +72,7 @@ class Note implements Comparable { } } - if (_created == null) { - _created = DateTime(0, 0, 0, 0, 0, 0, 0, 0); - } + _created ??= DateTime(0, 0, 0, 0, 0, 0, 0, 0); } bool hasValidDate() { diff --git a/lib/oauthapp.dart b/lib/oauthapp.dart index 48f519b1..a9ada6fc 100644 --- a/lib/oauthapp.dart +++ b/lib/oauthapp.dart @@ -35,17 +35,17 @@ class OAuthAppState extends State { title: 'OAuth App', home: Scaffold( appBar: AppBar( - title: Text('OAuth Test'), + title: const Text('OAuth Test'), ), body: Column(children: [ RaisedButton( - child: Text("Open OAuth URL"), + child: const Text("Open OAuth URL"), onPressed: () { githost.launchOAuthScreen(); }, ), RaisedButton( - child: Text("List Repos"), + child: const Text("List Repos"), onPressed: () async { try { var repos = await githost.listRepos(); @@ -58,7 +58,7 @@ class OAuthAppState extends State { }, ), RaisedButton( - child: Text("Create Repo"), + child: const Text("Create Repo"), onPressed: () async { try { var repo = await githost.createRepo("journal_test2"); @@ -69,7 +69,7 @@ class OAuthAppState extends State { }, ), RaisedButton( - child: Text("Add Deploy Key"), + child: const Text("Add Deploy Key"), onPressed: () async { try { await githost.addDeployKey(key, "vhanda/journal_test2"); diff --git a/lib/screens/githostsetup_autoconfigure.dart b/lib/screens/githostsetup_autoconfigure.dart index 83915d3f..45d15af1 100644 --- a/lib/screens/githostsetup_autoconfigure.dart +++ b/lib/screens/githostsetup_autoconfigure.dart @@ -140,24 +140,24 @@ class GitHostSetupAutoConfigureState extends State { 'We need permission to perform the following steps:', style: Theme.of(context).textTheme.title, ), - SizedBox(height: 32.0), + const SizedBox(height: 32.0), // Step 1 Text( "1. Create a new private repo called 'journal' or use the existing one", style: Theme.of(context).textTheme.body2, ), - SizedBox(height: 8.0), + const SizedBox(height: 8.0), Text( "2. Generate an SSH Key on this device", style: Theme.of(context).textTheme.body2, ), - SizedBox(height: 8.0), + const SizedBox(height: 8.0), Text( "3. Add the key as a deploy key with write access to the created repo", style: Theme.of(context).textTheme.body2, ), - SizedBox(height: 32.0), + const SizedBox(height: 32.0), GitHostSetupButton( text: "Authorize GitJournal", diff --git a/lib/screens/githostsetup_clone_url.dart b/lib/screens/githostsetup_clone_url.dart index 17112df0..75e857f0 100644 --- a/lib/screens/githostsetup_clone_url.dart +++ b/lib/screens/githostsetup_clone_url.dart @@ -83,12 +83,12 @@ class GitCloneUrlPageState extends State { style: Theme.of(context).textTheme.headline, ), ), - SizedBox(height: 16.0), + const SizedBox(height: 16.0), Padding( padding: const EdgeInsets.all(8.0), child: inputForm, ), - SizedBox(height: 8.0), + const SizedBox(height: 8.0), GitHostSetupButton( text: "Next", onPressed: formSubmitted, @@ -178,28 +178,28 @@ class GitCloneUrlKnownProviderPageState 'Please create a new git repository -', style: Theme.of(context).textTheme.title, ), - SizedBox(height: 32.0), + const SizedBox(height: 32.0), // Step 1 Text( '1. Go to the website, create a repo and copy its git clone URL', style: Theme.of(context).textTheme.subtitle, ), - SizedBox(height: 8.0), + const SizedBox(height: 8.0), GitHostSetupButton( text: "Open Create New Repo Webpage", onPressed: widget.launchCreateUrlPage, ), - SizedBox(height: 16.0), + const SizedBox(height: 16.0), // Step 2 Text( '2. Enter the Git clone URL', style: Theme.of(context).textTheme.subtitle, ), - SizedBox(height: 8.0), + const SizedBox(height: 8.0), inputForm, - SizedBox(height: 16.0), + const SizedBox(height: 16.0), GitHostSetupButton( text: "Next", onPressed: formSubmitted, diff --git a/lib/screens/githostsetup_folder.dart b/lib/screens/githostsetup_folder.dart index 81be94ec..e3846817 100644 --- a/lib/screens/githostsetup_folder.dart +++ b/lib/screens/githostsetup_folder.dart @@ -24,12 +24,12 @@ class GitHostSetupFolderPage extends StatelessWidget { 'Would you like to store your journal entries in an existing folder?', style: Theme.of(context).textTheme.title, ), - SizedBox(height: 32.0), + const SizedBox(height: 32.0), FolderListWidget( folders: folders, onSelected: subFolderSelected, ), - SizedBox(height: 16.0), + const SizedBox(height: 16.0), GitHostSetupButton( text: "Ignore", onPressed: rootFolderSelected, diff --git a/lib/screens/githostsetup_loading.dart b/lib/screens/githostsetup_loading.dart index 9654cc4a..ee9f92c3 100644 --- a/lib/screens/githostsetup_loading.dart +++ b/lib/screens/githostsetup_loading.dart @@ -15,9 +15,9 @@ class GitHostSetupLoadingPage extends StatelessWidget { style: Theme.of(context).textTheme.display1, ), ), - SizedBox(height: 8.0), - Padding( - padding: const EdgeInsets.all(8.0), + const SizedBox(height: 8.0), + const Padding( + padding: EdgeInsets.all(8.0), child: CircularProgressIndicator( value: null, ), diff --git a/lib/screens/githostsetup_screens.dart b/lib/screens/githostsetup_screens.dart index 7ce6bb00..e0587a34 100644 --- a/lib/screens/githostsetup_screens.dart +++ b/lib/screens/githostsetup_screens.dart @@ -281,7 +281,7 @@ class GitHostSetupScreenState extends State { ), ], ), - padding: EdgeInsets.all(16.0), + padding: const EdgeInsets.all(16.0), ); var scaffold = Scaffold( @@ -292,7 +292,7 @@ class GitHostSetupScreenState extends State { InkWell( child: Container( child: Icon(Icons.arrow_back, size: 32.0), - padding: EdgeInsets.all(8.0), + padding: const EdgeInsets.all(8.0), ), onTap: () => Navigator.of(context).pop(), ), @@ -505,7 +505,7 @@ class GitHostChoicePage extends StatelessWidget { "Select a Git Hosting Provider -", style: Theme.of(context).textTheme.headline, ), - SizedBox(height: 16.0), + const SizedBox(height: 16.0), GitHostSetupButton( text: "GitHub", iconUrl: 'assets/icon/github-icon.png', @@ -513,7 +513,7 @@ class GitHostChoicePage extends StatelessWidget { onKnownGitHost(GitHostType.GitHub); }, ), - SizedBox(height: 8.0), + const SizedBox(height: 8.0), GitHostSetupButton( text: "GitLab", iconUrl: 'assets/icon/gitlab-icon.png', @@ -521,7 +521,7 @@ class GitHostChoicePage extends StatelessWidget { onKnownGitHost(GitHostType.GitLab); }, ), - SizedBox(height: 8.0), + const SizedBox(height: 8.0), GitHostSetupButton( text: "Custom", onPressed: () async { @@ -555,14 +555,14 @@ class GitHostAutoConfigureChoicePage extends StatelessWidget { "How do you want to do this?", style: Theme.of(context).textTheme.headline, ), - SizedBox(height: 16.0), + const SizedBox(height: 16.0), GitHostSetupButton( text: "Setup Automatically", onPressed: () { onDone(GitHostSetupType.Auto); }, ), - SizedBox(height: 8.0), + const SizedBox(height: 8.0), GitHostSetupButton( text: "Let me do it manually", onPressed: () async { diff --git a/lib/screens/githostsetup_sshkey.dart b/lib/screens/githostsetup_sshkey.dart index 03164e8f..6246e4ca 100644 --- a/lib/screens/githostsetup_sshkey.dart +++ b/lib/screens/githostsetup_sshkey.dart @@ -32,40 +32,40 @@ class GitHostSetupSshKeyKnownProvider extends StatelessWidget { 'In order to access this repository, this public key must be copied as a deploy key', style: Theme.of(context).textTheme.title, ), - SizedBox(height: 32.0), + const SizedBox(height: 32.0), // Step 1 Text( '1. Copy the key', style: Theme.of(context).textTheme.subtitle, ), - SizedBox(height: 8.0), + const SizedBox(height: 8.0), PublicKeyWidget(publicKey), - SizedBox(height: 8.0), + const SizedBox(height: 8.0), GitHostSetupButton( text: "Copy Key", onPressed: () => copyKeyFunction(context), ), - SizedBox(height: 16.0), + const SizedBox(height: 16.0), // Step 2 Text( '2. Open webpage, and paste the deploy key. Make sure it is given Write Access. ', style: Theme.of(context).textTheme.subtitle, ), - SizedBox(height: 8.0), + const SizedBox(height: 8.0), GitHostSetupButton( text: "Open Deploy Key Webpage", onPressed: openDeployKeyPage, ), - SizedBox(height: 16.0), + const SizedBox(height: 16.0), // Step 3 Text( '3. Try Cloning ..', style: Theme.of(context).textTheme.subtitle, ), - SizedBox(height: 8.0), + const SizedBox(height: 8.0), GitHostSetupButton( text: "Clone Repo", onPressed: doneFunction, @@ -106,35 +106,35 @@ class GitHostSetupSshKeyUnknownProvider extends StatelessWidget { 'In order to access this repository, this public key must be copied as a deploy key', style: Theme.of(context).textTheme.title, ), - SizedBox(height: 32.0), + const SizedBox(height: 32.0), // Step 1 Text( '1. Copy the key', style: Theme.of(context).textTheme.subtitle, ), - SizedBox(height: 8.0), + const SizedBox(height: 8.0), PublicKeyWidget(publicKey), - SizedBox(height: 8.0), + const SizedBox(height: 8.0), GitHostSetupButton( text: "Copy Key", onPressed: () => copyKeyFunction(context), ), - SizedBox(height: 16.0), + const SizedBox(height: 16.0), // Step 2 Text( '2. Give this SSH Key access to the git repo. (You need to figure it out yourself)', style: Theme.of(context).textTheme.subtitle, ), - SizedBox(height: 16.0), + const SizedBox(height: 16.0), // Step 3 Text( '3. Try Cloning ..', style: Theme.of(context).textTheme.subtitle, ), - SizedBox(height: 8.0), + const SizedBox(height: 8.0), GitHostSetupButton( text: "Clone Repo", onPressed: doneFunction, diff --git a/lib/screens/home_screen.dart b/lib/screens/home_screen.dart index d18cc9d3..273250c1 100644 --- a/lib/screens/home_screen.dart +++ b/lib/screens/home_screen.dart @@ -18,7 +18,7 @@ class HomeScreen extends StatelessWidget { final appState = container.appState; var createButton = FloatingActionButton( - key: ValueKey("FAB"), + key: const ValueKey("FAB"), onPressed: () => _newPost(context), child: Icon(Icons.add), ); @@ -40,7 +40,7 @@ class HomeScreen extends StatelessWidget { bool shouldShowBadge = !appState.remoteGitRepoConfigured && appState.hasJournalEntries; var appBarMenuButton = BadgeIconButton( - key: ValueKey("DrawerButton"), + key: const ValueKey("DrawerButton"), icon: const Icon(Icons.menu), itemCount: shouldShowBadge ? 1 : 0, onPressed: () { @@ -51,7 +51,7 @@ class HomeScreen extends StatelessWidget { return Scaffold( key: _scaffoldKey, appBar: AppBar( - title: Text('GitJournal'), + title: const Text('GitJournal'), leading: appBarMenuButton, actions: [ IconButton( diff --git a/lib/screens/note_editor.dart b/lib/screens/note_editor.dart index eb860e72..b7b32aab 100644 --- a/lib/screens/note_editor.dart +++ b/lib/screens/note_editor.dart @@ -60,7 +60,7 @@ class NoteEditorState extends State { appBar: AppBar( title: Text(title), leading: IconButton( - key: ValueKey("NewEntry"), + key: const ValueKey("NewEntry"), icon: Icon(Icons.check), onPressed: () { _saveNote(context); @@ -102,7 +102,7 @@ class NoteEditorState extends State { ), PopupMenuItem( value: NoteEditorDropDownChoices.SwitchEditor, - child: rawEditor ? Text('Rich Editor') : Text('Raw Editor'), + child: rawEditor ? const Text('Rich Editor') : const Text('Raw Editor'), ), ], ), diff --git a/lib/screens/note_viewer.dart b/lib/screens/note_viewer.dart index 65ee71c5..d1e22344 100644 --- a/lib/screens/note_viewer.dart +++ b/lib/screens/note_viewer.dart @@ -49,7 +49,7 @@ class NoteBrowsingScreenState extends State { return Scaffold( appBar: AppBar( - title: Text('TIMELINE'), + title: const Text('TIMELINE'), actions: [ IconButton( icon: Icon(Icons.delete), @@ -106,14 +106,14 @@ class NoteBrowsingScreenState extends State { actions: [ FlatButton( onPressed: () => Navigator.pop(context), - child: Text('Cancel'), + child: const Text('Cancel'), ), FlatButton( onPressed: () { Navigator.pop(context); // Alert box _deleteNote(context); }, - child: Text('Delete'), + child: const Text('Delete'), ), ], ); @@ -142,7 +142,7 @@ class NoteViewer extends StatelessWidget { data: note.body, styleSheet: MarkdownStyleSheet.fromTheme(theme), ), - SizedBox(height: 64.0), + const SizedBox(height: 64.0), // _buildFooter(context), ], crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/screens/onboarding_screens.dart b/lib/screens/onboarding_screens.dart index 5b5d40ab..d697e0cd 100644 --- a/lib/screens/onboarding_screens.dart +++ b/lib/screens/onboarding_screens.dart @@ -42,7 +42,7 @@ class OnBoardingScreenState extends State { var row = Row( children: [ OnBoardingBottomButton( - key: ValueKey("Skip"), + key: const ValueKey("Skip"), text: "Skip", onPressed: _finish, ), @@ -61,7 +61,7 @@ class OnBoardingScreenState extends State { ), ), OnBoardingBottomButton( - key: ValueKey("Next"), + key: const ValueKey("Next"), text: "Next", onPressed: _nextPage, ), @@ -81,7 +81,7 @@ class OnBoardingScreenState extends State { width: double.infinity, height: _bottomBarHeight, child: RaisedButton( - key: ValueKey("GetStarted"), + key: const ValueKey("GetStarted"), child: Text( "Get Started", textAlign: TextAlign.center, @@ -98,7 +98,7 @@ class OnBoardingScreenState extends State { width: double.infinity, height: double.infinity, child: pageView, - padding: EdgeInsets.all(16.0), + padding: const EdgeInsets.all(16.0), ), bottomNavigationBar: AnimatedSwitcher( duration: Duration(milliseconds: 300), @@ -161,7 +161,7 @@ class OnBoardingPage1 extends StatelessWidget { height: 200, fit: BoxFit.fill, ), - SizedBox(height: 16.0), + const SizedBox(height: 16.0), Text( "GitJournal", style: headerTextStyle, @@ -173,7 +173,7 @@ class OnBoardingPage1 extends StatelessWidget { child: Column( children: [ Center(child: header), - SizedBox(height: 64.0), + const SizedBox(height: 64.0), AutoSizeText( "A Journaling App focused on\nOpenness and Data Privacy", style: textTheme.headline, @@ -201,7 +201,7 @@ class OnBoardingPage2 extends StatelessWidget { //height: 200, fit: BoxFit.fill, ), - SizedBox(height: 16.0), + const SizedBox(height: 16.0), ], ); @@ -209,7 +209,7 @@ class OnBoardingPage2 extends StatelessWidget { child: Column( children: [ Center(child: header), - SizedBox(height: 64.0), + const SizedBox(height: 64.0), AutoSizeText( "Your Journal Entries are stored in a\nstandard Markdown + YAML\nHeader format", style: textTheme.headline, @@ -237,7 +237,7 @@ class OnBoardingPage3 extends StatelessWidget { //height: 200, fit: BoxFit.fill, ), - SizedBox(height: 16.0), + const SizedBox(height: 16.0), ], ); @@ -245,7 +245,7 @@ class OnBoardingPage3 extends StatelessWidget { child: Column( children: [ Center(child: header), - SizedBox(height: 64.0), + const SizedBox(height: 64.0), AutoSizeText( "Sync your Local Git Repo\nwith any provider", style: textTheme.headline, diff --git a/lib/screens/settings_screen.dart b/lib/screens/settings_screen.dart index e581b703..f9570139 100644 --- a/lib/screens/settings_screen.dart +++ b/lib/screens/settings_screen.dart @@ -9,7 +9,7 @@ class SettingsScreen extends StatelessWidget { Widget build(BuildContext context) { return Scaffold( appBar: AppBar( - title: Text('Settings'), + title: const Text('Settings'), leading: IconButton( icon: Icon(Icons.arrow_back), onPressed: () { @@ -124,7 +124,7 @@ class SettingsListState extends State { }, ), ListTile( - title: Text("Font Size"), + title: const Text("Font Size"), subtitle: Text(settings.noteFontSize.toPublicString()), onTap: () async { var fontSize = await showDialog( @@ -142,7 +142,7 @@ class SettingsListState extends State { SettingsHeader("Git Author Settings"), ListTile(title: gitAuthorForm), ListTile(title: gitAuthorEmailForm), - SizedBox(height: 16.0), + const SizedBox(height: 16.0), SettingsHeader("Storage"), ListPreference( title: "File Name", @@ -156,7 +156,7 @@ class SettingsListState extends State { setState(() {}); }, ), - SizedBox(height: 16.0), + const SizedBox(height: 16.0), SettingsHeader("Analytics"), BoolPreference( title: "Collect Anonymous Usage Statistics", @@ -188,7 +188,7 @@ class SettingsHeader extends StatelessWidget { @override Widget build(BuildContext context) { return Padding( - padding: EdgeInsets.only(left: 16.0, bottom: 0.0, top: 20.0), + padding: const EdgeInsets.only(left: 16.0, bottom: 0.0, top: 20.0), child: Text( text, style: TextStyle( @@ -256,10 +256,10 @@ class FontSizeSettingsDialog extends StatelessWidget { children: sizes, ), ), - contentPadding: EdgeInsets.all(0.0), + contentPadding: const EdgeInsets.all(0.0), actions: [ FlatButton( - child: Text('CANCEL'), + child: const Text('CANCEL'), onPressed: () { Navigator.of(context).pop(); }, @@ -326,10 +326,10 @@ class ListPreference extends StatelessWidget { children: children, ), ), - contentPadding: EdgeInsets.all(0.0), + contentPadding: const EdgeInsets.all(0.0), actions: [ FlatButton( - child: Text('CANCEL'), + child: const Text('CANCEL'), onPressed: () { Navigator.of(context).pop(); }, diff --git a/lib/themes.dart b/lib/themes.dart index bc5d87ed..26775395 100644 --- a/lib/themes.dart +++ b/lib/themes.dart @@ -3,15 +3,15 @@ import 'package:flutter/material.dart'; class Themes { static final light = ThemeData( brightness: Brightness.light, - primaryColor: Color(0xFF66bb6a), - primaryColorLight: Color(0xFF98ee99), - primaryColorDark: Color(0xFF338a3e), - accentColor: Color(0xff6d4c41), + primaryColor: const Color(0xFF66bb6a), + primaryColorLight: const Color(0xFF98ee99), + primaryColorDark: const Color(0xFF338a3e), + accentColor: const Color(0xff6d4c41), ); static final dark = ThemeData( brightness: Brightness.dark, - primaryColor: Color(0xff212121), - accentColor: Color(0xff689f38), + primaryColor: const Color(0xff212121), + accentColor: const Color(0xff689f38), ); } diff --git a/lib/widgets/app_drawer.dart b/lib/widgets/app_drawer.dart index e18f43b2..dfe8944f 100644 --- a/lib/widgets/app_drawer.dart +++ b/lib/widgets/app_drawer.dart @@ -50,7 +50,7 @@ class AppDrawer extends StatelessWidget { child: DecoratedBox( decoration: BoxDecoration( image: DecorationImage( - image: AssetImage('assets/icon/icon.png'), + image: const AssetImage('assets/icon/icon.png'), ), ), ), diff --git a/lib/widgets/icon_dismissable.dart b/lib/widgets/icon_dismissable.dart index e74fdaa6..99325ad6 100644 --- a/lib/widgets/icon_dismissable.dart +++ b/lib/widgets/icon_dismissable.dart @@ -19,7 +19,7 @@ class IconDismissable extends Dismissible { color: backgroundColor, alignment: AlignmentDirectional.centerStart, child: Padding( - padding: EdgeInsets.fromLTRB(16.0, 0.0, 0.0, 0.0), + padding: const EdgeInsets.fromLTRB(16.0, 0.0, 0.0, 0.0), child: Icon( Icons.delete, color: Colors.white, @@ -30,7 +30,7 @@ class IconDismissable extends Dismissible { color: backgroundColor, alignment: AlignmentDirectional.centerEnd, child: Padding( - padding: EdgeInsets.fromLTRB(0.0, 0.0, 16.0, 0.0), + padding: const EdgeInsets.fromLTRB(0.0, 0.0, 16.0, 0.0), child: Icon( Icons.delete, color: Colors.white, diff --git a/lib/widgets/journal_list.dart b/lib/widgets/journal_list.dart index 9e49ef74..cca868d3 100644 --- a/lib/widgets/journal_list.dart +++ b/lib/widgets/journal_list.dart @@ -86,13 +86,13 @@ class JournalList extends StatelessWidget { var children = []; if (time.isNotEmpty) { children.addAll([ - SizedBox(height: 4.0), + const SizedBox(height: 4.0), Text(time, style: textTheme.body1), ]); } children.addAll([ - SizedBox(height: 4.0), + const SizedBox(height: 4.0), Text( body, maxLines: 3, @@ -115,7 +115,7 @@ class JournalList extends StatelessWidget { ); return Padding( - padding: EdgeInsets.only(top: 8.0, bottom: 8.0), + padding: const EdgeInsets.only(top: 8.0, bottom: 8.0), child: tile, ); } diff --git a/lib/widgets/note_header.dart b/lib/widgets/note_header.dart index 9d9f29f0..1b0d8975 100644 --- a/lib/widgets/note_header.dart +++ b/lib/widgets/note_header.dart @@ -30,7 +30,7 @@ class NoteHeader extends StatelessWidget { var w = Row( children: [ bigNum, - SizedBox(width: 8.0), + const SizedBox(width: 8.0), Column( children: [ dateText, @@ -43,7 +43,7 @@ class NoteHeader extends StatelessWidget { ); return Padding( - padding: EdgeInsets.only(top: 8.0, bottom: 18.0), + padding: const EdgeInsets.only(top: 8.0, bottom: 18.0), child: w, ); }