More prefer_const

It seems like flutter analyze might have some kind of cache
This commit is contained in:
Vishesh Handa
2019-10-20 01:21:22 +01:00
parent b8964625d4
commit d5f91cb898
6 changed files with 20 additions and 19 deletions

@ -304,7 +304,7 @@ class GitHostSetupScreenState extends State<GitHostSetupScreen> {
onWillPop: () async {
if (_currentPageIndex != 0) {
pageController.previousPage(
duration: Duration(milliseconds: 200),
duration: const Duration(milliseconds: 200),
curve: Curves.easeIn,
);
return false;
@ -318,7 +318,7 @@ class GitHostSetupScreenState extends State<GitHostSetupScreen> {
void _nextPage() {
pageController.nextPage(
duration: Duration(milliseconds: 200),
duration: const Duration(milliseconds: 200),
curve: Curves.easeIn,
);
}

@ -101,7 +101,7 @@ class OnBoardingScreenState extends State<OnBoardingScreen> {
padding: const EdgeInsets.all(16.0),
),
bottomNavigationBar: AnimatedSwitcher(
duration: Duration(milliseconds: 300),
duration: const Duration(milliseconds: 300),
child: bottomBar,
),
);
@ -116,7 +116,7 @@ class OnBoardingScreenState extends State<OnBoardingScreen> {
void _nextPage() {
pageController.nextPage(
duration: Duration(milliseconds: 200),
duration: const Duration(milliseconds: 200),
curve: Curves.easeIn,
);
}

@ -52,7 +52,7 @@ void showUndoDeleteSnackbar(
Flushbar(
message: "Note Deleted",
duration: Duration(seconds: 3),
duration: const Duration(seconds: 3),
mainButton: FlatButton(
child: Text(
"Undo",
@ -69,6 +69,6 @@ void showUndoDeleteSnackbar(
void showSnackbar(BuildContext context, String message) {
Flushbar(
message: message,
duration: Duration(seconds: 3),
duration: const Duration(seconds: 3),
).show(context);
}

@ -14,17 +14,17 @@ class NoteHeader extends StatelessWidget {
var bigNum = Text(
note.created.day.toString(),
style: TextStyle(fontSize: 40.0),
style: const TextStyle(fontSize: 40.0),
);
var dateText = Text(
dateStr,
style: TextStyle(fontSize: 18.0),
style: const TextStyle(fontSize: 18.0),
);
var timeText = Text(
timeStr,
style: TextStyle(fontSize: 18.0),
style: const TextStyle(fontSize: 18.0),
);
var w = Row(

@ -28,7 +28,7 @@ void main() {
await driver.tap(buttonFinder);
await driver.waitFor(
find.text("Success"),
timeout: Duration(seconds: 15),
timeout: const Duration(seconds: 15),
);
});
});

@ -33,7 +33,7 @@ void main() {
test('Anonymous GitClone works', () async {
// OnBoarding
var nextButton = find.text("Next");
await driver.waitFor(nextButton, timeout: Duration(seconds: 5));
await driver.waitFor(nextButton, timeout: const Duration(seconds: 5));
await _takeScreenshot();
await driver.tap(nextButton);
@ -47,15 +47,15 @@ void main() {
// Main Screen
final loadedFinder = find.text('Why not add your first\n Journal Entry?');
await driver.waitFor(loadedFinder, timeout: Duration(seconds: 5));
await driver.waitFor(loadedFinder, timeout: const Duration(seconds: 5));
await _takeScreenshot();
// Create a new note
var fab = find.byValueKey("FAB");
await driver.waitFor(fab, timeout: Duration(seconds: 2));
await driver.waitFor(fab, timeout: const Duration(seconds: 2));
await driver.tap(fab);
await driver.waitFor(find.text('Write here'),
timeout: Duration(seconds: 2));
timeout: const Duration(seconds: 2));
await _takeScreenshot();
await driver.enterText(
@ -64,28 +64,29 @@ void main() {
await driver.tap(find.byValueKey("NewEntry"));
// Create another note
await driver.waitFor(fab, timeout: Duration(seconds: 2));
await driver.waitFor(fab, timeout: const Duration(seconds: 2));
await driver.tap(fab);
await driver.waitFor(find.text('Write here'),
timeout: Duration(seconds: 2));
timeout: const Duration(seconds: 2));
await driver.enterText(
"Journaling is a great way to clear your mind and get all your throughts down into paper. Well, not literal paper, as this is an app, but I think you get the point.");
await _takeScreenshot();
await driver.tap(find.byValueKey("NewEntry"));
await Future.delayed(Duration(milliseconds: 500));
await Future.delayed(const Duration(milliseconds: 500));
await _takeScreenshot();
// Open the Drawer
final drawerButtonFinder = find.byValueKey("DrawerButton");
await driver.tap(drawerButtonFinder);
await Future.delayed(Duration(milliseconds: 500));
await Future.delayed(const Duration(milliseconds: 500));
await _takeScreenshot();
// The Git Host setup screen
await driver.tap(find.text("Setup Git Host"));
await driver.waitFor(find.text("GitHub"), timeout: Duration(seconds: 2));
await driver.waitFor(find.text("GitHub"),
timeout: const Duration(seconds: 2));
await _takeScreenshot();
// FIXME: This doesn't seem to work!
// await driver.tap(find.pageBack());