-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from mrunix00/new-note-screen
Add new note screen
- Loading branch information
Showing
11 changed files
with
154 additions
and
22 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import 'package:go_router/go_router.dart'; | ||
import 'package:noteapp/screens/new_note_screen.dart'; | ||
|
||
import '../screens/home_screen.dart'; | ||
|
||
GoRouter appRouter = GoRouter( | ||
initialLocation: '/', | ||
routes: [ | ||
GoRoute( | ||
path: '/', | ||
redirect: (_, __) => '/HomeScreen', | ||
), | ||
GoRoute( | ||
path: '/HomeScreen', | ||
builder: (context, state) => const HomeScreen(), | ||
), | ||
GoRoute( | ||
path: '/NewNote', | ||
builder: (context, state) => const NewNoteScreen(), | ||
), | ||
], | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,19 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter/services.dart'; | ||
|
||
import 'notes_app.dart'; | ||
import 'core/go_router.dart'; | ||
import 'theme.dart'; | ||
|
||
void main() { | ||
runApp(const NotesApp()); | ||
WidgetsFlutterBinding.ensureInitialized(); | ||
SystemChrome.setSystemUIOverlayStyle( | ||
const SystemUiOverlayStyle(systemNavigationBarColor: Color(0xff252525)), | ||
); | ||
runApp( | ||
MaterialApp.router( | ||
title: 'Notes', | ||
theme: themeData, | ||
routerConfig: appRouter, | ||
), | ||
); | ||
} | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,4 +24,4 @@ class AboutNotesAppDialog extends StatelessWidget { | |
), | ||
); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:noteapp/widgets/square_icon_button.dart'; | ||
|
||
import '../widgets/go_back_button.dart'; | ||
|
||
class NewNoteScreen extends StatelessWidget { | ||
const NewNoteScreen({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: AppBar( | ||
leadingWidth: 75, | ||
leading: const GoBackButton(), | ||
actions: [ | ||
SquareIconButton( | ||
icon: const Icon(Icons.visibility_outlined), | ||
onPressed: () {}, | ||
), | ||
const SizedBox(width: 25), | ||
SquareIconButton( | ||
icon: const Icon(Icons.save_outlined), | ||
onPressed: () {}, | ||
), | ||
const SizedBox(width: 25), | ||
], | ||
), | ||
body: Container( | ||
margin: const EdgeInsets.symmetric(horizontal: 32), | ||
child: SingleChildScrollView( | ||
child: Column( | ||
children: <Widget>[ | ||
const SizedBox(height: 40), | ||
TextField( | ||
decoration: const InputDecoration( | ||
hintText: 'Title', | ||
border: InputBorder.none, | ||
), | ||
maxLines: null, | ||
style: Theme.of(context).textTheme.titleLarge, | ||
), | ||
const SizedBox(height: 40), | ||
TextField( | ||
decoration: const InputDecoration( | ||
hintText: 'Note', | ||
border: InputBorder.none, | ||
), | ||
style: Theme.of(context).textTheme.bodyLarge, | ||
maxLines: null, | ||
), | ||
], | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import 'package:flutter/widgets.dart'; | ||
import 'package:flutter_svg/flutter_svg.dart'; | ||
import 'package:go_router/go_router.dart'; | ||
|
||
import 'square_icon_button.dart'; | ||
|
||
class GoBackButton extends StatelessWidget { | ||
const GoBackButton({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Padding( | ||
padding: const EdgeInsets.only(left: 20), | ||
child: SquareIconButton( | ||
icon: SvgPicture.asset("assets/back.svg"), | ||
onPressed: () => context.pop(), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters