diff --git a/lib/ui/add_note_screen.dart b/lib/ui/add_note_screen.dart index 2de3b6f..36bd3da 100644 --- a/lib/ui/add_note_screen.dart +++ b/lib/ui/add_note_screen.dart @@ -14,7 +14,7 @@ class NoteAddScreen extends StatelessWidget { NoteAddScreen({super.key}); final _titleController = TextEditingController(); - final _bodyController = QuillController.basic(); + final _bodyController = TextEditingController(); @override Widget build(BuildContext context) { @@ -26,11 +26,11 @@ class NoteAddScreen extends StatelessWidget { stream: colorCubit.stream, builder: (context, snapshot) { return Scaffold( - bottomSheet: QuillToolbarWidget(_bodyController), appBar: AddNoteAppBar( color: colorCubit.state.noteColor, onSavePress: () => saveNote(notesCubit, colorCubit, context), onDeletPressed: () async { + if (_bodyController.text.isNotEmpty) { showDialog( context: context, builder: (BuildContext context) { @@ -68,7 +68,9 @@ class NoteAddScreen extends StatelessWidget { ], ); }, - ); + );} else { + Navigator.pop(context); + } }, onColorChangePress: () => changeColor(context, colorCubit), ), @@ -94,7 +96,19 @@ class NoteAddScreen extends StatelessWidget { fontFamily: "Nothing"), ), const SizedBox(height: 14), - quillEditorPropertys(_bodyController) + TextField( + controller: _bodyController, + textCapitalization: TextCapitalization.sentences, + keyboardType: TextInputType.multiline, + maxLines: null, + decoration: const InputDecoration( + hintText: 'Text', + fillColor: CustomColors.backgroundColor, + ), + style: const TextStyle( + color: Colors.white, + fontSize: 16,), + ), ], ), ), @@ -154,7 +168,7 @@ class NoteAddScreen extends StatelessWidget { if (_titleController.text.isNotEmpty) { cubit.addNote( _titleController.text, - jsonEncode(_bodyController.document.toDelta().toJson()), + _bodyController.text, colorCubit.state.noteColor); Navigator.pop(context); break; diff --git a/lib/ui/main_screen_with_content_grid.dart b/lib/ui/main_screen_with_content_grid.dart index 6ab123a..8f6f302 100644 --- a/lib/ui/main_screen_with_content_grid.dart +++ b/lib/ui/main_screen_with_content_grid.dart @@ -112,9 +112,7 @@ class MainScreenWithContentGridView extends StatelessWidget { fontFamily: "Nothing"), ), subtitle: Text( - Document.fromJson( - json.decode(notes[index].content)) - .toPlainText(), + notes[index].content, overflow: TextOverflow.ellipsis, maxLines: 2, style: TextStyle( @@ -131,7 +129,7 @@ class MainScreenWithContentGridView extends StatelessWidget { } Color textColor(Color indexColor) { - if (indexColor == const Color.fromRGBO(239, 239, 239, 1.0)) { + if (indexColor == const Color.fromRGBO(231,233,233, 1.0)) { return Colors.black54; } else { return Colors.white54; @@ -139,7 +137,7 @@ Color textColor(Color indexColor) { } Color titleColor(Color indexColor) { - if (indexColor == const Color.fromRGBO(239, 239, 239, 1.0)) { + if (indexColor == const Color.fromRGBO(231,233,233, 1.0)) { return Colors.black; } else { return Colors.white; @@ -154,9 +152,9 @@ Widget addNoteButton(BuildContext context) { Navigator.pushNamed(context, '/add'), }, elevation: 24, - backgroundColor: CustomColors.red, + backgroundColor: CustomColors.lightGrey, shape: RoundedRectangleBorder( - side: const BorderSide(color: CustomColors.lightGrey, width: 2), + side: const BorderSide( width: 0), borderRadius: BorderRadius.circular( 40, ), diff --git a/lib/ui/show_note_screen.dart b/lib/ui/show_note_screen.dart index d6d0222..7cbbb84 100644 --- a/lib/ui/show_note_screen.dart +++ b/lib/ui/show_note_screen.dart @@ -15,7 +15,7 @@ class ShowNoteScreen extends StatelessWidget { ShowNoteScreen({super.key}); final _titleController = TextEditingController(); - final _bodyController = QuillController.basic(); + final _bodyController = TextEditingController(); @override Widget build(BuildContext context) { @@ -26,14 +26,13 @@ class ShowNoteScreen extends StatelessWidget { colorCubit.changeColor(note.color); _titleController.text = note.title; - _bodyController.document = Document.fromJson(json.decode(note.content)); + _bodyController.text = note.content; return StreamBuilder( stream: colorCubit.stream, initialData: colorCubit.state, builder: (context, snapshot) { return Scaffold( - bottomSheet: QuillToolbarWidget(_bodyController), appBar: ShowNoteAppBar( onBackPressed: () async { await saveChanges(context, cubit, colorCubit, note); @@ -96,7 +95,18 @@ class ShowNoteScreen extends StatelessWidget { fontFamily: "Nothing"), ), const SizedBox(height: 14), - quillEditorPropertys(_bodyController) + TextField( + controller: _bodyController, + textCapitalization: TextCapitalization.sentences, + keyboardType: TextInputType.multiline, + maxLines: null, + decoration: const InputDecoration( + fillColor: CustomColors.backgroundColor, + ), + style: const TextStyle( + color: Colors.white, + fontSize: 16,), + ), ], ), ), @@ -157,9 +167,7 @@ class ShowNoteScreen extends StatelessWidget { cubit.updateNote(Note( id: note.id, title: _titleController.text, - content: jsonEncode( - _bodyController.document.toDelta().toJson(), - ), + content: _bodyController.text, color: colorCubit.state.noteColor)); Navigator.pop(context); return false; diff --git a/lib/ui/tasks_screen.dart b/lib/ui/tasks_screen.dart index ea7f504..38ad71b 100644 --- a/lib/ui/tasks_screen.dart +++ b/lib/ui/tasks_screen.dart @@ -1,4 +1,5 @@ import 'package:app_client/ui/theme/custom_colors.dart'; +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:sqflite/sqflite.dart'; import 'package:path/path.dart'; @@ -27,8 +28,8 @@ class _TaskListScreenState extends State { ) { return FloatingActionButton( shape: const CircleBorder( - side: BorderSide(width: 3, color: CustomColors.lightGrey)), - backgroundColor: CustomColors.whiteMain, + side: BorderSide()), + backgroundColor: CustomColors.lightGrey, onPressed: () { _addTask(context); }, @@ -98,9 +99,10 @@ class _TaskListScreenState extends State { alignment: Alignment.centerRight, decoration: BoxDecoration( border: Border.all( + color: CustomColors.backgroundColor, width: 2, ), - borderRadius: const BorderRadius.all(Radius.circular(20))), + borderRadius: const BorderRadius.all(Radius.circular(14))), child: const Padding( padding: EdgeInsets.all(10), child: Icon( @@ -124,37 +126,33 @@ class _TaskListScreenState extends State { width: 2, ), borderRadius: - const BorderRadius.all(Radius.circular(50))), + const BorderRadius.all(Radius.circular(14))), child: Container( padding: taskPadding(sublistNR), decoration: const BoxDecoration(), child: CheckboxListTile( checkboxShape: const CircleBorder( side: BorderSide( - color: CustomColors.lightGrey, + color: CustomColors.backgroundColor, )), - title: Text(tasks[index].task, - style: const TextStyle( - color: CustomColors.backgroundColor)), + title: Row(children: [ + Text(tasks[index].task, + style: const TextStyle( + color: CustomColors.backgroundColor)), + addTask(sublistNR, _taskWidget( + task, + context, + ptId, + sublistNR, + )) + + ],), value: tasks[index].isDone == 1, onChanged: (bool? value) { _toggleTask(tasks[index]); }, ), )), - Visibility( - visible: (sublistNR < 2), - child: Padding( - padding: const EdgeInsets.only(bottom: 10), - child: Container( - child: _taskWidget( - task, - context, - ptId, - sublistNR, - )), - ), - ), ], ); }, @@ -175,9 +173,17 @@ class _TaskListScreenState extends State { } } + Widget addTask(int sublistNR,Widget TaskW ){ + if (sublistNR < 2){ + return TaskW;}else{ + return Container(); + } + + } + EdgeInsets taskPadding(int sublistNR) { if (sublistNR == 0) { - return const EdgeInsets.all(10); + return const EdgeInsets.all(3); } else { return const EdgeInsets.all(0); } @@ -217,8 +223,8 @@ class _TaskListScreenState extends State { if (subtasks.isNotEmpty && task.isDone == 0) { return ExpansionTile( shape: const RoundedRectangleBorder( - side: BorderSide(color: CustomColors.greyHint, width: 5), - borderRadius: BorderRadius.all(Radius.circular((50))), + side: BorderSide( width: 5), + borderRadius: BorderRadius.all(Radius.circular((30))), ), backgroundColor: CustomColors.greyHint, childrenPadding: const EdgeInsets.symmetric(horizontal: 20), @@ -228,7 +234,7 @@ class _TaskListScreenState extends State { title: InkWell( splashColor: CustomColors.whiteMain, customBorder: RoundedRectangleBorder( - side: const BorderSide(color: CustomColors.lightGrey, width: 2), + side: const BorderSide( width: 2), borderRadius: BorderRadius.circular( 40, ), @@ -283,7 +289,7 @@ class _TaskListScreenState extends State { borderRadius: const BorderRadius.all(Radius.circular(50))), child: InkWell( customBorder: RoundedRectangleBorder( - side: const BorderSide(color: CustomColors.lightGrey, width: 2), + side: const BorderSide( width: 2), borderRadius: BorderRadius.circular( 40, ), @@ -304,21 +310,6 @@ class _TaskListScreenState extends State { padding: const EdgeInsets.symmetric(horizontal: 0), child: const Icon(Icons.add, color: CustomColors.lightGrey), ), - Container( - decoration: BoxDecoration( - color: CustomColors.whiteMain, - border: Border.all( - width: 2, - ), - borderRadius: - const BorderRadius.all(Radius.circular(50))), - padding: const EdgeInsets.symmetric(horizontal: 20), - child: const Text( - 'Add Subtask', - style: - TextStyle(color: CustomColors.lightGrey, fontSize: 16), - ), - ), ], ), ), @@ -392,13 +383,15 @@ class _TaskListScreenState extends State { context: context, builder: (BuildContext context) { return AlertDialog( + surfaceTintColor: Colors.black, + backgroundColor: CustomColors.lightGrey, title: const Text( 'Add Task', style: TextStyle(fontSize: 20), ), content: TextField( decoration: InputDecoration( - fillColor: CustomColors.greyHint, + fillColor: CustomColors.backgroundColor, border: OutlineInputBorder( borderRadius: BorderRadius.circular(20), borderSide: const BorderSide( diff --git a/pubspec.yaml b/pubspec.yaml index b8bef95..c9cdf9d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: A new Flutter project. publish_to: 'none' -version: 0.3.1+1 +version: 0.3.2 environment: sdk: ">=2.17.5 <3.7.0"