Skip to content

Commit

Permalink
added keyboard dismiss on tapping
Browse files Browse the repository at this point in the history
  • Loading branch information
keshav-space committed Jul 20, 2021
1 parent cf03e36 commit f6518fe
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 41 deletions.
2 changes: 1 addition & 1 deletion android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.notes">
package="com.trisven.safenotes">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.notes
package com.trisven.safenotes

import io.flutter.embedding.android.FlutterActivity

Expand Down
Binary file removed assets/icon.png
Binary file not shown.
6 changes: 4 additions & 2 deletions lib/page/edit_safe_note_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ class _AddEditNotePageState extends State<AddEditNotePage> {
}

@override
Widget build(BuildContext context) => Scaffold(
Widget build(BuildContext context) => GestureDetector(
onTap: () => FocusScope.of(context).unfocus(),
child: Scaffold(
appBar: AppBar(
actions: [buildButton()],
),
Expand All @@ -42,7 +44,7 @@ class _AddEditNotePageState extends State<AddEditNotePage> {
setState(() => this.description = description),
),
),
);
));

Widget buildButton() {
final isFormValid = title.isNotEmpty && description.isNotEmpty;
Expand Down
6 changes: 4 additions & 2 deletions lib/page/login_page/encryption_phrase_login_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ class _EncryptionPhraseLoginPageState extends State<EncryptionPhraseLoginPage> {
}

@override
Widget build(BuildContext context) => Scaffold(
Widget build(BuildContext context) => GestureDetector(
onTap: () => FocusScope.of(context).unfocus(),
child: Scaffold(
resizeToAvoidBottomInset: false,
appBar: AppBar(
title: Text(AppInfo.getLoginPageName()),
Expand Down Expand Up @@ -55,7 +57,7 @@ class _EncryptionPhraseLoginPageState extends State<EncryptionPhraseLoginPage> {
),
],
),
);
));

Widget columnAllowNonDecrypt() => Column(
children: [
Expand Down
69 changes: 36 additions & 33 deletions lib/page/login_page/set_encryption_phrase_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,42 +29,45 @@ class _SetEncryptionPhrasePageState extends State<SetEncryptionPhrasePage> {
@override
Widget build(BuildContext context) {
final node = FocusScope.of(context);
return Scaffold(
resizeToAvoidBottomInset: false,
appBar: AppBar(
title: Text(AppInfo.getFirstLoginPageName()),
centerTitle: true,
),
body: Column(
children: [
Padding(
padding: const EdgeInsets.only(top: 90.0),
child: Center(
child: Container(
width: 200,
height: 200,
child: Image.asset(AppInfo.getAppLogoPath())),
return GestureDetector(
onTap: () => FocusScope.of(context).unfocus(),
child: Scaffold(
resizeToAvoidBottomInset: false,
appBar: AppBar(
title: Text(AppInfo.getFirstLoginPageName()),
centerTitle: true,
),
body: Column(
children: [
Padding(
padding: const EdgeInsets.only(top: 90.0),
child: Center(
child: Container(
width: 200,
height: 200,
child: Image.asset(AppInfo.getAppLogoPath())),
),
),
),
Form(
key: formKey,
child: SingleChildScrollView(
padding: EdgeInsets.all(16),
child: Column(
children: [
inputFieldFirst(node),
const SizedBox(height: 10),
inputFieldSecond(),
buildForgotPassword(),
//const SizedBox(height: 16),
buildButton(),
//buildNoAccount(),
],
Form(
key: formKey,
child: SingleChildScrollView(
padding: EdgeInsets.all(16),
child: Column(
children: [
inputFieldFirst(node),
const SizedBox(height: 10),
inputFieldSecond(),
buildForgotPassword(),
//const SizedBox(height: 16),
buildButton(),
//buildNoAccount(),
],
),
),
),
),
],
));
],
)),
);
}

Widget inputFieldFirst(node) => TextFormField(
Expand Down
6 changes: 4 additions & 2 deletions lib/page/safe_notes_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ class _NotesPageState extends State<NotesPage> {
}

@override
Widget build(BuildContext context) => Scaffold(
Widget build(BuildContext context) => GestureDetector(
onTap: () => FocusScope.of(context).unfocus(),
child: Scaffold(
drawer: UnDecryptedLoginControl.getNoDecryptionFlag()
? null
: navigatioDrawerWidget(context),
Expand Down Expand Up @@ -115,7 +117,7 @@ class _NotesPageState extends State<NotesPage> {
refreshNotes();
},
),
);
));

Widget buildSearch() => SearchWidget(
text: query,
Expand Down

0 comments on commit f6518fe

Please sign in to comment.