This commit is contained in:
Vishesh Handa
2020-07-21 10:46:03 +02:00
parent a6fba3d2e7
commit 5d7f616c6e
11 changed files with 31 additions and 27 deletions

View File

@ -367,7 +367,11 @@ class _ChecklistItemTileState extends State<ChecklistItemTile> {
dense: true,
leading: Row(
children: <Widget>[
Container(height: 24.0, width: 24.0, child: Icon(Icons.drag_handle)),
Container(
height: 24.0,
width: 24.0,
child: const Icon(Icons.drag_handle),
),
const SizedBox(width: 8.0),
SizedBox(
height: 24.0,

View File

@ -43,7 +43,7 @@ class EditorAppBar extends StatelessWidget implements PreferredSizeWidget {
@required this.editorState,
@required this.noteModified,
this.extraButton,
}) : preferredSize = Size.fromHeight(kToolbarHeight),
}) : preferredSize = const Size.fromHeight(kToolbarHeight),
super(key: key);
@override
@ -97,7 +97,7 @@ class EditorBottomBar extends StatelessWidget {
@override
Widget build(BuildContext context) {
var addIcon = IconButton(
icon: Icon(Icons.attach_file),
icon: const Icon(Icons.attach_file),
onPressed: () {
showModalBottomSheet(
context: context,
@ -108,7 +108,7 @@ class EditorBottomBar extends StatelessWidget {
);
var menuIcon = IconButton(
icon: Icon(Icons.more_vert),
icon: const Icon(Icons.more_vert),
onPressed: () {
showModalBottomSheet(
context: context,
@ -133,7 +133,7 @@ class EditorBottomBar extends StatelessWidget {
),
Expanded(
child: FlatButton.icon(
icon: Icon(Icons.folder),
icon: const Icon(Icons.folder),
label: Text(parentFolder.publicName),
onPressed: () {
var note = editorState.getNote();
@ -159,7 +159,7 @@ Widget _buildAddBottomSheet(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
ListTile(
leading: Icon(Icons.camera),
leading: const Icon(Icons.camera),
title: Text(tr('editors.common.takePhoto')),
onTap: () async {
try {
@ -177,7 +177,7 @@ Widget _buildAddBottomSheet(
},
),
ListTile(
leading: Icon(Icons.image),
leading: const Icon(Icons.image),
title: Text(tr('editors.common.addImage')),
onTap: () async {
try {
@ -213,7 +213,7 @@ Widget _buildBottomMenuSheet(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
ListTile(
leading: Icon(Icons.undo),
leading: const Icon(Icons.undo),
title: Text(tr('editors.common.discard')),
onTap: () {
var note = editorState.getNote();
@ -224,7 +224,7 @@ Widget _buildBottomMenuSheet(
enabled: editorState.noteModified,
),
ListTile(
leading: Icon(Icons.share),
leading: const Icon(Icons.share),
title: Text(tr('editors.common.share')),
onTap: () {
var note = editorState.getNote();

View File

@ -108,7 +108,7 @@ class FileSystemView extends StatelessWidget {
Widget _buildFolderTile(NotesFolderFS folder) {
return ListTile(
leading: Icon(Icons.folder),
leading: const Icon(Icons.folder),
title: Text(folder.name),
dense: true,
onTap: () => onFolderSelected(folder),
@ -117,7 +117,7 @@ class FileSystemView extends StatelessWidget {
Widget _buildNoteTile(Note note) {
return ListTile(
leading: Icon(Icons.note),
leading: const Icon(Icons.note),
title: Text(note.fileName),
dense: true,
onTap: () => onNoteSelected(note),
@ -127,7 +127,7 @@ class FileSystemView extends StatelessWidget {
Widget _buildIgnoredFileTile(IgnoredFile ignoredFile) {
// FIXME: Paint with Ignored colours
return ListTile(
leading: Icon(Icons.broken_image),
leading: const Icon(Icons.broken_image),
title: Text(ignoredFile.fileName),
dense: true,
enabled: true,

View File

@ -132,7 +132,7 @@ class _FolderViewState extends State<FolderView> {
),
if (appState.remoteGitRepoConfigured) SyncButton(),
IconButton(
icon: Icon(Icons.search),
icon: const Icon(Icons.search),
onPressed: () {
showSearch(
context: context,

View File

@ -66,7 +66,7 @@ class SettingsListState extends State<SettingsList> {
key: gitAuthorKey,
style: Theme.of(context).textTheme.headline6,
decoration: InputDecoration(
icon: Icon(Icons.person),
icon: const Icon(Icons.person),
hintText: tr('settings.author.hint'),
labelText: tr('settings.author.label'),
),
@ -99,7 +99,7 @@ class SettingsListState extends State<SettingsList> {
style: Theme.of(context).textTheme.headline6,
keyboardType: TextInputType.emailAddress,
decoration: InputDecoration(
icon: Icon(Icons.email),
icon: const Icon(Icons.email),
hintText: tr('settings.email.hint'),
labelText: tr('settings.email.label'),
),

View File

@ -141,7 +141,7 @@ class GitHostSetupRepoSelectorState extends State<GitHostSetupRepoSelector> {
border: const OutlineInputBorder(),
suffixIcon: IconButton(
onPressed: () => _textController.clear(),
icon: Icon(Icons.clear),
icon: const Icon(Icons.clear),
),
),
);

View File

@ -27,7 +27,7 @@ class AppDrawer extends StatelessWidget {
setupGitButton = ListTile(
leading: Icon(Icons.sync, color: textStyle.color),
title: Text('Setup Git Host', style: textStyle),
trailing: Icon(
trailing: const Icon(
Icons.info,
color: Colors.red,
),

View File

@ -18,8 +18,8 @@ class IconDismissable extends Dismissible {
background: Container(
color: backgroundColor,
alignment: AlignmentDirectional.centerStart,
child: Padding(
padding: const EdgeInsets.fromLTRB(16.0, 0.0, 0.0, 0.0),
child: const Padding(
padding: EdgeInsets.fromLTRB(16.0, 0.0, 0.0, 0.0),
child: Icon(
Icons.delete,
color: Colors.white,
@ -29,8 +29,8 @@ class IconDismissable extends Dismissible {
secondaryBackground: Container(
color: backgroundColor,
alignment: AlignmentDirectional.centerEnd,
child: Padding(
padding: const EdgeInsets.fromLTRB(0.0, 0.0, 16.0, 0.0),
child: const Padding(
padding: EdgeInsets.fromLTRB(0.0, 0.0, 16.0, 0.0),
child: Icon(
Icons.delete,
color: Colors.white,

View File

@ -30,7 +30,7 @@ class NoteSearchDelegate extends SearchDelegate<Note> {
List<Widget> buildActions(BuildContext context) {
return [
IconButton(
icon: Icon(Icons.close),
icon: const Icon(Icons.close),
onPressed: () {
if (query.isEmpty) {
close(context, null);

View File

@ -202,7 +202,7 @@ class _PurchaseWidgetState extends State<PurchaseWidget> {
Row(
children: <Widget>[
_PurchaseSliderButton(
icon: Icon(Icons.arrow_left),
icon: const Icon(Icons.arrow_left),
onPressed: () {
setState(() {
_selectedOffering = _prevOffering();
@ -211,7 +211,7 @@ class _PurchaseWidgetState extends State<PurchaseWidget> {
),
Expanded(child: slider),
_PurchaseSliderButton(
icon: Icon(Icons.arrow_right),
icon: const Icon(Icons.arrow_right),
onPressed: () {
setState(() {
_selectedOffering = _nextOffering();

View File

@ -44,7 +44,7 @@ class _SyncButtonState extends State<SyncButton> {
if (_connectivity == ConnectivityResult.none) {
return GitPendingChangesBadge(
child: IconButton(
icon: Icon(Icons.signal_wifi_off),
icon: const Icon(Icons.signal_wifi_off),
onPressed: () async {
_syncRepo();
},
@ -55,7 +55,7 @@ class _SyncButtonState extends State<SyncButton> {
return BlinkingIcon(
child: GitPendingChangesBadge(
child: IconButton(
icon: Icon(Icons.cloud_download),
icon: const Icon(Icons.cloud_download),
onPressed: () {},
),
),
@ -66,7 +66,7 @@ class _SyncButtonState extends State<SyncButton> {
return BlinkingIcon(
child: GitPendingChangesBadge(
child: IconButton(
icon: Icon(Icons.cloud_upload),
icon: const Icon(Icons.cloud_upload),
onPressed: () {},
),
),