From de7a0901df6577a07fd47d18d6b6477fd21641a2 Mon Sep 17 00:00:00 2001 From: devanandhhh Date: Mon, 15 Jan 2024 11:59:31 +0530 Subject: [PATCH] create ui of add notes --- lib/main.dart | 4 +- lib/screens/a_ascreen.dart | 13 ---- lib/screens/addNotes/add_notes.dart | 76 ++++++++++++++++++++ lib/screens/addNotes/create_notes.dart | 80 ++++++++++++++++++++++ lib/screens/home/home_screen.dart | 28 ++++++-- lib/screens/view_details/reuse/reuse.dart | 2 +- lib/screens/view_details/view_details.dart | 3 +- 7 files changed, 182 insertions(+), 24 deletions(-) delete mode 100644 lib/screens/a_ascreen.dart create mode 100644 lib/screens/addNotes/add_notes.dart create mode 100644 lib/screens/addNotes/create_notes.dart diff --git a/lib/main.dart b/lib/main.dart index b55bb5f..e5940d1 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -14,9 +14,9 @@ class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { - return const MaterialApp( + return MaterialApp(theme: ThemeData(primaryColor: Colors.teal,primarySwatch: Colors.amber), title: 'tournament app', - home: SplashScreen(), + home:const SplashScreen(), debugShowCheckedModeBanner: false, ); } diff --git a/lib/screens/a_ascreen.dart b/lib/screens/a_ascreen.dart deleted file mode 100644 index b2dbec5..0000000 --- a/lib/screens/a_ascreen.dart +++ /dev/null @@ -1,13 +0,0 @@ -import 'package:flutter/material.dart'; - - -class DetailsOfTournament extends StatelessWidget { - const DetailsOfTournament({super.key}); - - @override - Widget build(BuildContext context) { - return Scaffold( - - ); - } -} \ No newline at end of file diff --git a/lib/screens/addNotes/add_notes.dart b/lib/screens/addNotes/add_notes.dart new file mode 100644 index 0000000..a7762e8 --- /dev/null +++ b/lib/screens/addNotes/add_notes.dart @@ -0,0 +1,76 @@ +import 'package:flutter/material.dart'; +import 'package:tournament_creator/screens/addNotes/create_notes.dart'; +//import 'package:tournament_creator/screens/addNotes/create_notes.dart'; +import 'package:tournament_creator/screens/create_tounament/reuse_widgets/reuse_widgets.dart'; + +// ignore: must_be_immutable +class AddNotes extends StatefulWidget { + AddNotes({super.key}); + + @override + State createState() => _AddNotesState(); +} + +class _AddNotesState extends State { + TextEditingController titleController = TextEditingController(); + + TextEditingController contentController = TextEditingController(); +Future createNote(MapnewNote)async{ + +} + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: appbardecorations(name: 'Notes '), + backgroundColor: Colors.yellow[100], + floatingActionButton: Padding( + padding: const EdgeInsets.all(8.0), + child: FloatingActionButton( + child: Icon(Icons.add), + backgroundColor: Colors.teal, + onPressed: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => CreateNotes())); + }), + ), + ); + } + + // showForm(BuildContext ctx, int? iteamkey) async { + // showModalBottomSheet( + // context: ctx, + // builder: (_) { + // return Container( + // padding: EdgeInsets.only( + // bottom: MediaQuery.of(ctx).viewInsets.bottom, + // top: 15, + // left: 15, + // right: 15), + // child: Column( + // mainAxisSize: MainAxisSize.min, + // crossAxisAlignment: CrossAxisAlignment.end, + // children: [ + // TextField( + // controller: titleController, + // decoration: InputDecoration(hintText: 'Title'), + // ), + // sizedbox10(), + // TextField( + // controller: contentController, + // decoration: InputDecoration(hintText: 'Type here....'), + // ),sizedbox10(), + // ElevatedButton(onPressed: ()async{ + // createNote({'title':titleController,'content':contentController}); + // titleController.clear(); + // contentController.clear(); + // Navigator.of(ctx).pop(); + // }, + // child: Text('Save')) + // ], + // ), + // ); + // }); + // } +} diff --git a/lib/screens/addNotes/create_notes.dart b/lib/screens/addNotes/create_notes.dart new file mode 100644 index 0000000..d1e586e --- /dev/null +++ b/lib/screens/addNotes/create_notes.dart @@ -0,0 +1,80 @@ +import 'package:flutter/material.dart'; +import 'package:tournament_creator/screens/create_tounament/reuse_widgets/reuse_widgets.dart'; + +class CreateNotes extends StatelessWidget { + CreateNotes({super.key}); + String? title; + String? note; + final titleController = TextEditingController(); + final noteController = TextEditingController(); + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: appbardecorations( + name: "Create Notes", + ), + backgroundColor: Colors.yellow[100], + body: Padding( + padding: const EdgeInsets.all(8.0), + child: SingleChildScrollView( + child: Column(children: [ + sizedbox10(), + Container( + height: 620, + width: 380, + decoration: BoxDecoration( + // color: Colors.amber[100], + border: Border.all(width: 3, color: Colors.grey), + borderRadius: BorderRadius.circular(10)), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + TextField( + controller: titleController, + style: TextStyle(fontSize: 30), + maxLines: null, + decoration: InputDecoration( + hintText: 'Title', + hintStyle: const TextStyle(fontSize: 30), + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(10), + borderSide: BorderSide.none)), + ), + TextField( + controller: noteController, + style: TextStyle(fontSize: 20), + maxLines: null, + decoration: InputDecoration( + hintText: 'Add Notes Here.....', + hintStyle: TextStyle(fontSize: 20), + border: OutlineInputBorder( + borderSide: BorderSide.none)), + ), + ], + ), + )), + SizedBox( + height: 40, + ), + InkWell( + onTap: (){ + + }, + child: Container( + height: 70, + width: 330, + decoration: BoxDecoration( + color: Colors.teal, borderRadius: BorderRadius.circular(35)), + child: Center(child: Text('Save',style: TextStyle(color: Colors.white,fontSize: 22,fontWeight: FontWeight.bold ),)), + ), + ) + ]), + ), + ), + ); + } + savedata(){ + + } +} diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index da83b15..db0be9b 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:tournament_creator/fav_screen/fav_screen.dart'; +import 'package:tournament_creator/screens/addNotes/add_notes.dart'; import 'package:tournament_creator/screens/create_tounament/create_tournament.dart'; import 'package:tournament_creator/screens/create_tounament/reuse_widgets/reuse_widgets.dart'; import 'package:tournament_creator/screens/list_Tournament/list_tournify.dart'; @@ -22,12 +23,25 @@ class HomeScreen extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ headingtext(text: 'Tournament Creator'), - InkWell( - onTap: () { - navigatorPush( - ctx: context, screen: const FavouiteScreen()); - }, - child: iconSize30(icondata: Icons.favorite_border), + Row( + children: [ + InkWell( + onTap: () { + navigatorPush( + ctx: context, screen: const FavouiteScreen()); + }, + child: iconSize30(icondata: Icons.favorite_border), + ), + const SizedBox( + width: 15, + ), + InkWell( + onTap: () { + navigatorPush(ctx: context, screen: AddNotes()); + }, + child: iconSize30(icondata: Icons.edit), + ) + ], ) ]), ), @@ -69,7 +83,7 @@ class HomeScreen extends StatelessWidget { }, child: containerButtons(name: "Create Tournament"), ), - sizedbox30(), + sizedbox30(), InkWell( onTap: () { navigatorPush( diff --git a/lib/screens/view_details/reuse/reuse.dart b/lib/screens/view_details/reuse/reuse.dart index e70ef86..c132a38 100644 --- a/lib/screens/view_details/reuse/reuse.dart +++ b/lib/screens/view_details/reuse/reuse.dart @@ -4,5 +4,5 @@ stylefont(){ return const TextStyle(fontSize: 20,fontWeight: FontWeight.bold ); } styleTeal(){ - return const TextStyle(color: Colors.teal,fontWeight: FontWeight.bold); + return const TextStyle(color: Colors.teal,fontWeight: FontWeight.bold,fontSize: 18); } \ No newline at end of file diff --git a/lib/screens/view_details/view_details.dart b/lib/screens/view_details/view_details.dart index d421136..d163767 100644 --- a/lib/screens/view_details/view_details.dart +++ b/lib/screens/view_details/view_details.dart @@ -2,9 +2,10 @@ import 'dart:io'; import 'package:flutter/material.dart'; import 'package:tournament_creator/screens/create_tounament/reuse_widgets/reuse_widgets.dart'; -import 'package:tournament_creator/screens/home/reuse_widgets/refactoring.dart'; + import 'package:tournament_creator/screens/view_details/reuse/reuse.dart'; +// ignore: must_be_immutable class ViewTournamentDetails extends StatelessWidget { ViewTournamentDetails( {super.key,