From d3f8299b26abde4780218a6743743ce445666449 Mon Sep 17 00:00:00 2001 From: LiquidatorCoder Date: Sat, 6 Jun 2020 01:43:42 +0530 Subject: [PATCH] minor issues fixed --- analysis_options.yaml | 5 +++++ lib/main.dart | 2 +- lib/main_page.dart | 5 +++-- lib/note_page.dart | 28 +++++++++++++++++----------- lib/picnote_page.dart | 8 +++++--- lib/staggered_page.dart | 2 +- lib/staggered_tile.dart | 4 ++-- 7 files changed, 34 insertions(+), 20 deletions(-) create mode 100644 analysis_options.yaml diff --git a/analysis_options.yaml b/analysis_options.yaml new file mode 100644 index 0000000..8750100 --- /dev/null +++ b/analysis_options.yaml @@ -0,0 +1,5 @@ +analyzer: + errors: + todo: ignore + must_call_super: ignore + missing_return: ignore \ No newline at end of file diff --git a/lib/main.dart b/lib/main.dart index 5193710..8f6e229 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -19,7 +19,7 @@ class MyApp extends StatelessWidget { iconTheme: IconThemeData(color: Colors.orange), textTheme: GoogleFonts.montserratTextTheme(), primaryTextTheme: TextTheme( - title: TextStyle(color: Colors.black), + headline6: TextStyle(color: Colors.black), ), primarySwatch: Colors.orange, ), diff --git a/lib/main_page.dart b/lib/main_page.dart index c7e1dc1..4c2a96b 100644 --- a/lib/main_page.dart +++ b/lib/main_page.dart @@ -234,8 +234,9 @@ class _MainPageState extends State { }, child: Text("Yes")), FlatButton( - onPressed: () => - {Navigator.of(context).pop()}, + onPressed: () { + Navigator.of(context).pop(); + }, child: Text("No")) ], ); diff --git a/lib/note_page.dart b/lib/note_page.dart index 35b293f..3e4cd62 100644 --- a/lib/note_page.dart +++ b/lib/note_page.dart @@ -135,7 +135,9 @@ class _NotePageState extends State { errorBorder: InputBorder.none, disabledBorder: InputBorder.none, contentPadding: EdgeInsets.fromLTRB(16, 0, 16, 0)), - onChanged: (str) => {updateNoteObject()}, + onChanged: (str) { + updateNoteObject(); + }, maxLines: null, controller: _titleController, focusNode: _titleFocus, @@ -166,7 +168,9 @@ class _NotePageState extends State { errorBorder: InputBorder.none, disabledBorder: InputBorder.none, contentPadding: EdgeInsets.fromLTRB(16, 0, 16, 0)), - onChanged: (str) => {updateNoteObject()}, + onChanged: (str) { + updateNoteObject(); + }, maxLines: 99999, // line limit extendable later controller: _contentController, @@ -343,7 +347,9 @@ class _NotePageState extends State { }, child: Text("Yes")), FlatButton( - onPressed: () => {Navigator.of(context).pop()}, + onPressed: () { + Navigator.of(context).pop(); + }, child: Text("No")) ], ); @@ -369,14 +375,14 @@ class _NotePageState extends State { } } - void _saveAndStartNewNote(BuildContext context) { - _persistenceTimer.cancel(); - var emptyNote = new Note( - -1, "", "", DateTime.now(), DateTime.now(), Colors.white, 0, 0, 0); - Navigator.of(context).pop(); - Navigator.push( - context, CupertinoPageRoute(builder: (ctx) => NotePage(emptyNote))); - } + // void _saveAndStartNewNote(BuildContext context) { + // _persistenceTimer.cancel(); + // var emptyNote = new Note( + // -1, "", "", DateTime.now(), DateTime.now(), Colors.white, 0, 0, 0); + // Navigator.of(context).pop(); + // Navigator.push( + // context, CupertinoPageRoute(builder: (ctx) => NotePage(emptyNote))); + // } Future _readyToPop() async { _persistenceTimer.cancel(); diff --git a/lib/picnote_page.dart b/lib/picnote_page.dart index d08656a..3f8992a 100644 --- a/lib/picnote_page.dart +++ b/lib/picnote_page.dart @@ -1,7 +1,7 @@ import 'dart:async'; -import 'dart:convert'; +// import 'dart:convert'; import 'dart:io'; -import 'dart:typed_data'; +// import 'dart:typed_data'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -425,7 +425,9 @@ class _PhotoPageState extends State { }, child: Text("Yes")), FlatButton( - onPressed: () => {Navigator.of(context).pop()}, + onPressed: () { + Navigator.of(context).pop(); + }, child: Text("No")) ], ); diff --git a/lib/staggered_page.dart b/lib/staggered_page.dart index 91bf8e6..065a241 100644 --- a/lib/staggered_page.dart +++ b/lib/staggered_page.dart @@ -89,7 +89,7 @@ class _StaggeredGridPageState extends State { EdgeInsets _paddingForView(BuildContext context) { double width = MediaQuery.of(context).size.width; double padding; - double top_bottom = 8; + // double top_bottom = 8; if (width > 500) { padding = (width) * 0.05; // 5% padding of width on both side } else { diff --git a/lib/staggered_tile.dart b/lib/staggered_tile.dart index 8c357dc..0a466f9 100644 --- a/lib/staggered_tile.dart +++ b/lib/staggered_tile.dart @@ -1,7 +1,7 @@ import 'dart:async'; -import 'dart:convert'; +// import 'dart:convert'; import 'dart:io'; -import 'dart:typed_data'; +// import 'dart:typed_data'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:auto_size_text/auto_size_text.dart';