Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if (flutterVersionCode == null) {

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '4.0.0'
flutterVersionName = '5.0.1'
}

android {
Expand Down
2 changes: 1 addition & 1 deletion debian/debian.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ flutter_app:

control:
Package: notelytask
Version: 4.0.0
Version: 5.0.1
Architecture: amd64
Priority: optional
Depends: libgtk-3-0, libblkid1, liblzma5
Expand Down
5 changes: 4 additions & 1 deletion lib/cubit/notes_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'package:notelytask/cubit/local_folder_cubit.dart';
import 'package:notelytask/models/file_data.dart';
import 'package:notelytask/models/note.dart';
import 'package:notelytask/models/notes_state.dart';
import 'package:notelytask/util/quill_utils.dart';
import 'package:notelytask/util/update_widget.dart';
import 'package:notelytask/utils.dart';

Expand Down Expand Up @@ -211,7 +212,9 @@ class NotesCubit extends HydratedCubit<NotesState> {
final index = state.notes.indexWhere((element) => element.id == note.id);
List<Note> updatedNotes = List<Note>.from(state.notes);

if (note.title.isEmpty && note.text.isEmpty && note.fileDataList.isEmpty) {
if (note.title.isEmpty &&
note.fileDataList.isEmpty &&
extractPlainTextFromDelta(note.text).trim().isEmpty) {
if (index != -1) {
updatedNotes.removeAt(index);
emit(state.copyWith(notes: updatedNotes));
Expand Down
4 changes: 4 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import 'package:notelytask/screens/privacy_policy_page.dart';
import 'package:notelytask/screens/settings_page.dart';
import 'package:notelytask/service/navigation_service.dart';
import 'package:notelytask/theme.dart';
import 'package:flutter_quill/flutter_quill.dart';
import 'package:path_provider/path_provider.dart';
import 'package:get_storage/get_storage.dart';
import 'package:get_it/get_it.dart';
Expand Down Expand Up @@ -72,6 +73,9 @@ class App extends StatelessWidget {
return MaterialApp(
title: 'NotelyTask',
theme: getThemeData(settingsState.selectedTheme),
localizationsDelegates: const [
FlutterQuillLocalizations.delegate,
],
navigatorKey: getIt<NavigationService>().navigatorKey,
initialRoute: '/',
onGenerateRoute: (RouteSettings settings) {
Expand Down
2 changes: 0 additions & 2 deletions lib/models/settings_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class SettingsState extends Equatable {

factory SettingsState.fromJson(Map<String, dynamic> json) {
return SettingsState(
selectedNoteId: json['selectedNoteId'] as String?,
selectedTheme: AppTheme.values.firstWhere(
(theme) => theme.toString() == json['selectedTheme'],
orElse: () => AppTheme.defaultDark,
Expand All @@ -23,7 +22,6 @@ class SettingsState extends Equatable {
}

Map<String, dynamic> toJson() => {
'selectedNoteId': selectedNoteId,
'selectedTheme': selectedTheme.toString(),
};

Expand Down
25 changes: 2 additions & 23 deletions lib/screens/deleted_list_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,36 +21,15 @@ class _DeletedListPageState extends State<DeletedListPage> {

@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final colorScheme = theme.colorScheme;
final colorScheme = Theme.of(context).colorScheme;

return Scaffold(
backgroundColor: colorScheme.surface,
appBar: AppBar(
backgroundColor: colorScheme.surface,
elevation: 0,
leading: IconButton(
icon: const Icon(Icons.arrow_back_rounded),
onPressed: () => Navigator.of(context).pop(),
color: colorScheme.onSurface,
),
title: Row(
children: [
Icon(
Icons.delete_rounded,
color: colorScheme.error,
size: 24,
),
const SizedBox(width: 12),
Text(
'Deleted Notes',
style: theme.textTheme.titleLarge?.copyWith(
fontWeight: FontWeight.w600,
color: colorScheme.onSurface,
),
),
],
),
title: const Text('Deleted Notes'),
actions: [
BlocBuilder<NotesCubit, dynamic>(
builder: (context, state) {
Expand Down
29 changes: 3 additions & 26 deletions lib/screens/details_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ class _DetailsPageState extends State<DetailsPage> {

@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final colorScheme = theme.colorScheme;

var layout = SafeArea(
child: DetailsForm(
key: Key((note.id)),
Expand All @@ -55,36 +52,16 @@ class _DetailsPageState extends State<DetailsPage> {

if (widget.withAppBar) {
return Scaffold(
backgroundColor: colorScheme.surface,
appBar: AppBar(
backgroundColor: colorScheme.surface,
elevation: 0,
leading: IconButton(
icon: const Icon(Icons.arrow_back_rounded),
onPressed: () => Navigator.of(context).pop(),
color: colorScheme.onSurface,
),
title: Row(
children: [
Icon(
widget.isDeletedList
? Icons.visibility_rounded
: Icons.edit_note_rounded,
color: colorScheme.primary,
size: 24,
),
const SizedBox(width: 12),
Text(
widget.isDeletedList ? 'View Note' : 'Edit Note',
style: theme.textTheme.titleLarge?.copyWith(
fontWeight: FontWeight.w600,
color: colorScheme.onSurface,
),
),
],
title: Text(
widget.isDeletedList ? 'View Note' : 'Edit Note',
),
bottom: const PreferredSize(
preferredSize: Size(double.infinity, 4),
preferredSize: Size(double.infinity, 2),
child: StateLoader(),
),
),
Expand Down
32 changes: 5 additions & 27 deletions lib/screens/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,48 +49,26 @@ class _HomePageState extends State<HomePage> {

@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final colorScheme = theme.colorScheme;
final colorScheme = Theme.of(context).colorScheme;

return Scaffold(
backgroundColor: colorScheme.surface,
appBar: AppBar(
backgroundColor: colorScheme.surface,
elevation: 0,
title: Row(
children: [
Image.asset(
'assets/foreground.png',
width: 40,
height: 40,
color: colorScheme.primary,
),
const SizedBox(width: 12),
Text(
'NotelyTask',
style: theme.textTheme.headlineMedium?.copyWith(
fontWeight: FontWeight.w600,
color: colorScheme.onSurface,
),
),
],
),
title: const Text('NotelyTask'),
actions: [
IconButton(
icon: const Icon(Icons.delete_rounded),
icon: const Icon(Icons.delete_outline_rounded),
tooltip: 'Deleted Notes',
onPressed: _navigateToDeletedList,
color: colorScheme.onSurface,
),
IconButton(
icon: const Icon(Icons.settings_rounded),
tooltip: 'Settings',
onPressed: () => getIt<NavigationService>().pushNamed('/settings'),
color: colorScheme.onSurface,
),
const SizedBox(width: 4),
],
bottom: const PreferredSize(
preferredSize: Size(double.infinity, 4),
preferredSize: Size(double.infinity, 2),
child: StateLoader(),
),
),
Expand Down
24 changes: 6 additions & 18 deletions lib/screens/settings_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class _SettingsPageState extends State<SettingsPage> {
String version = '';
Future<String> getVersion() async {
final packageInfo = await PackageInfo.fromPlatform();
return '${packageInfo.version}+${packageInfo.buildNumber}';
return '${packageInfo.version}${packageInfo.buildNumber.isNotEmpty ? '+':''}${packageInfo.buildNumber}';
}

@override
Expand Down Expand Up @@ -62,20 +62,11 @@ class _SettingsPageState extends State<SettingsPage> {
final colorScheme = theme.colorScheme;

return Scaffold(
backgroundColor: colorScheme.surface,
appBar: AppBar(
backgroundColor: colorScheme.surface,
title: Text(
'Settings',
style: theme.textTheme.headlineMedium?.copyWith(
fontWeight: FontWeight.w600,
color: colorScheme.onSurface,
),
),
title: const Text('Settings'),
leading: IconButton(
icon: const Icon(Icons.arrow_back_rounded),
onPressed: () => Navigator.of(context).pop(),
color: colorScheme.onSurface,
),
),
body: SingleChildScrollView(
Expand All @@ -89,7 +80,6 @@ class _SettingsPageState extends State<SettingsPage> {
BlocBuilder<LocalFolderCubit, LocalFolderState>(
builder: (context, folderState) {
return Card(
color: colorScheme.surface,
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(
Expand Down Expand Up @@ -248,7 +238,6 @@ class _SettingsPageState extends State<SettingsPage> {
BlocBuilder<SettingsCubit, SettingsState>(
builder: (context, settingsState) {
return Card(
color: colorScheme.surface,
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(
Expand Down Expand Up @@ -443,13 +432,12 @@ class _SettingsPageState extends State<SettingsPage> {

Widget _buildSectionHeader(BuildContext context, String title) {
final theme = Theme.of(context);
final colorScheme = theme.colorScheme;

return Text(
title,
style: theme.textTheme.titleLarge?.copyWith(
fontWeight: FontWeight.w700,
color: colorScheme.onSurface,
style: theme.textTheme.titleSmall?.copyWith(
fontWeight: FontWeight.w600,
color: theme.colorScheme.primary,
letterSpacing: 0.8,
),
);
}
Expand Down
Loading