minor fixes and additions
This commit is contained in:
parent
55049114c5
commit
5911153f1c
|
@ -23,7 +23,7 @@ if (flutterVersionName == null) {
|
|||
}
|
||||
|
||||
android {
|
||||
namespace "com.example.easytodo"
|
||||
namespace "me.aiquiral.easytodo"
|
||||
compileSdk flutter.compileSdkVersion
|
||||
ndkVersion flutter.ndkVersion
|
||||
|
||||
|
@ -42,7 +42,7 @@ android {
|
|||
|
||||
defaultConfig {
|
||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||
applicationId "com.example.easytodo"
|
||||
applicationId "me.aiquiral.easytodo"
|
||||
// You can update the following values to match your application needs.
|
||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
||||
minSdkVersion flutter.minSdkVersion
|
||||
|
|
BIN
dist/1.0.1/easytodo-1.0.1+1.0.1-android.apk
vendored
Normal file
BIN
dist/1.0.1/easytodo-1.0.1+1.0.1-android.apk
vendored
Normal file
Binary file not shown.
BIN
dist/1.0.1/easytodo-1.0.1+1.0.1-linux.rpm
vendored
Normal file
BIN
dist/1.0.1/easytodo-1.0.1+1.0.1-linux.rpm
vendored
Normal file
Binary file not shown.
BIN
dist/1.0.1/easytodo-1.0.1.AppImage
vendored
Executable file
BIN
dist/1.0.1/easytodo-1.0.1.AppImage
vendored
Executable file
Binary file not shown.
12
distribute_options.yaml
Normal file
12
distribute_options.yaml
Normal file
|
@ -0,0 +1,12 @@
|
|||
output: dist/
|
||||
releases:
|
||||
- name: release
|
||||
jobs:
|
||||
- name: linux-rpm
|
||||
package:
|
||||
platform: linux
|
||||
target: rpm
|
||||
- name: android-apk
|
||||
package:
|
||||
platform: android
|
||||
target: apk
|
|
@ -1,8 +0,0 @@
|
|||
icons_launcher:
|
||||
image_path: "assets/ic_logo_border.png"
|
||||
platforms:
|
||||
android:
|
||||
enable: true
|
||||
linux:
|
||||
enable: true
|
||||
|
|
@ -1,9 +1,12 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:hive_flutter/hive_flutter.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import '../data/database.dart';
|
||||
import '../util/dialog_box.dart';
|
||||
import '../util/todo_tile.dart';
|
||||
|
||||
Uri _url = Uri.parse('https://git.aiquiral.me/aiquiral/easytodo');
|
||||
|
||||
class HomePage extends StatefulWidget {
|
||||
const HomePage({super.key});
|
||||
|
||||
|
@ -12,27 +15,24 @@ class HomePage extends StatefulWidget {
|
|||
}
|
||||
|
||||
class _HomePageState extends State<HomePage> {
|
||||
// reference the hive box
|
||||
final _myBox = Hive.box('mybox');
|
||||
ToDoDataBase db = ToDoDataBase();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
// if this is the 1st time ever openin the app, then create default data
|
||||
// initial data
|
||||
if (_myBox.get("TODOLIST") == null) {
|
||||
db.createInitialData();
|
||||
} else {
|
||||
// there already exists data
|
||||
// load data
|
||||
db.loadData();
|
||||
}
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
// text controller
|
||||
final _controller = TextEditingController();
|
||||
|
||||
// checkbox was tapped
|
||||
void checkBoxChanged(bool? value, int index) {
|
||||
setState(() {
|
||||
db.toDoList[index][1] = !db.toDoList[index][1];
|
||||
|
@ -40,7 +40,6 @@ class _HomePageState extends State<HomePage> {
|
|||
db.updateDataBase();
|
||||
}
|
||||
|
||||
// save new task
|
||||
void saveNewTask() {
|
||||
setState(() {
|
||||
db.toDoList.add([_controller.text, false]);
|
||||
|
@ -50,7 +49,6 @@ class _HomePageState extends State<HomePage> {
|
|||
db.updateDataBase();
|
||||
}
|
||||
|
||||
// create a new task
|
||||
void createNewTask() {
|
||||
showDialog(
|
||||
context: context,
|
||||
|
@ -58,13 +56,17 @@ class _HomePageState extends State<HomePage> {
|
|||
return DialogBox(
|
||||
controller: _controller,
|
||||
onSave: saveNewTask,
|
||||
onCancel: () => Navigator.of(context).pop(),
|
||||
onCancel: () {
|
||||
setState(() {
|
||||
_controller.clear();
|
||||
});
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
// delete task
|
||||
void deleteTask(int index) {
|
||||
setState(() {
|
||||
db.toDoList.removeAt(index);
|
||||
|
@ -99,9 +101,21 @@ class _HomePageState extends State<HomePage> {
|
|||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return const AlertDialog(
|
||||
title: Text("About"),
|
||||
content: Text("Made by Anuj K."),
|
||||
);
|
||||
title: Text("About"),
|
||||
content: SizedBox(
|
||||
height: 100,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Text(
|
||||
"This application is made by Anuj Kaushik (a.k.a. Aiqurial).\nLicensed under AGPLv3."),
|
||||
TextButton(
|
||||
onPressed: _launchUrl,
|
||||
child: Text("View Source Code"))
|
||||
],
|
||||
)));
|
||||
});
|
||||
})
|
||||
]),
|
||||
|
@ -128,3 +142,9 @@ class _HomePageState extends State<HomePage> {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _launchUrl() async {
|
||||
if (!await launchUrl(_url)) {
|
||||
throw Exception('Could not launch $_url');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import 'my_button.dart';
|
|||
|
||||
// ignore: must_be_immutable
|
||||
class DialogBox extends StatelessWidget {
|
||||
// ignore: prefer_typing_uninitialized_variables
|
||||
final controller;
|
||||
VoidCallback onSave;
|
||||
VoidCallback onCancel;
|
||||
|
|
|
@ -6,6 +6,10 @@
|
|||
|
||||
#include "generated_plugin_registrant.h"
|
||||
|
||||
#include <url_launcher_linux/url_launcher_plugin.h>
|
||||
|
||||
void fl_register_plugins(FlPluginRegistry* registry) {
|
||||
g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
|
||||
fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
|
||||
url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#
|
||||
|
||||
list(APPEND FLUTTER_PLUGIN_LIST
|
||||
url_launcher_linux
|
||||
)
|
||||
|
||||
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
||||
|
|
6
linux/packaging/appimage/make_config.yaml
Normal file
6
linux/packaging/appimage/make_config.yaml
Normal file
|
@ -0,0 +1,6 @@
|
|||
display_name: Easy ToDo
|
||||
icon: assets/ic_logo_border.png
|
||||
generic_name: Easy ToDo
|
||||
categories:
|
||||
- Utility
|
||||
startup_notify: true
|
17
linux/packaging/deb/make_config.yaml
Normal file
17
linux/packaging/deb/make_config.yaml
Normal file
|
@ -0,0 +1,17 @@
|
|||
display_name: easytodo
|
||||
package_name: easytodo
|
||||
maintainer:
|
||||
name: Anuj K
|
||||
email: development@aiquiral.me
|
||||
priority: optional
|
||||
section: x11
|
||||
installed_size: 6604
|
||||
essential: false
|
||||
icon: assets/ic_logo_border.png
|
||||
|
||||
postinstall_scripts:
|
||||
- echo "Easy Todo installed."
|
||||
postuninstall_scripts:
|
||||
- echo "Easy ToDo removed."
|
||||
|
||||
startup_notify: true
|
11
linux/packaging/rpm/make_config.yaml
Normal file
11
linux/packaging/rpm/make_config.yaml
Normal file
|
@ -0,0 +1,11 @@
|
|||
icon: assets/ic_logo_border.png
|
||||
summary: An easy to use ToDo List app.
|
||||
group: Application/Productivity
|
||||
vendor: Anuj K
|
||||
packager: Anuj K
|
||||
packagerEmail: development@aiquiral.me
|
||||
license: AGPLv3
|
||||
|
||||
display_name: Easy ToDo
|
||||
|
||||
startup_notify: true
|
|
@ -6,7 +6,9 @@ import FlutterMacOS
|
|||
import Foundation
|
||||
|
||||
import path_provider_foundation
|
||||
import url_launcher_macos
|
||||
|
||||
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
||||
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
|
||||
}
|
||||
|
|
71
pubspec.lock
71
pubspec.lock
|
@ -243,6 +243,11 @@ packages:
|
|||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
flutter_web_plugins:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
frontend_server_client:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -656,6 +661,70 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.2.2"
|
||||
url_launcher:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: url_launcher
|
||||
sha256: "0ecc004c62fd3ed36a2ffcbe0dd9700aee63bd7532d0b642a488b1ec310f492e"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.2.5"
|
||||
url_launcher_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: url_launcher_android
|
||||
sha256: d4ed0711849dd8e33eb2dd69c25db0d0d3fdc37e0a62e629fe32f57a22db2745
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.3.0"
|
||||
url_launcher_ios:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: url_launcher_ios
|
||||
sha256: "9149d493b075ed740901f3ee844a38a00b33116c7c5c10d7fb27df8987fb51d5"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.2.5"
|
||||
url_launcher_linux:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: url_launcher_linux
|
||||
sha256: ab360eb661f8879369acac07b6bb3ff09d9471155357da8443fd5d3cf7363811
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.1.1"
|
||||
url_launcher_macos:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: url_launcher_macos
|
||||
sha256: b7244901ea3cf489c5335bdacda07264a6e960b1c1b1a9f91e4bc371d9e68234
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.1.0"
|
||||
url_launcher_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: url_launcher_platform_interface
|
||||
sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.3.2"
|
||||
url_launcher_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: url_launcher_web
|
||||
sha256: "3692a459204a33e04bc94f5fb91158faf4f2c8903281ddd82915adecdb1a901d"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.3.0"
|
||||
url_launcher_windows:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: url_launcher_windows
|
||||
sha256: ecf9725510600aa2bb6d7ddabe16357691b6d2805f66216a97d1b881e21beff7
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.1.1"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -730,4 +799,4 @@ packages:
|
|||
version: "3.1.2"
|
||||
sdks:
|
||||
dart: ">=3.3.1 <4.0.0"
|
||||
flutter: ">=3.10.0"
|
||||
flutter: ">=3.19.0"
|
||||
|
|
|
@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
|||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||
# In Windows, build-name is used as the major, minor, and patch parts
|
||||
# of the product and file versions while build-number is used as the build suffix.
|
||||
version: 1.0.0
|
||||
version: 1.0.1
|
||||
|
||||
environment:
|
||||
sdk: '>=3.3.1 <4.0.0'
|
||||
|
@ -33,6 +33,7 @@ dependencies:
|
|||
flutter_slidable: ^3.1.0
|
||||
hive: ^2.2.3
|
||||
hive_flutter: ^1.1.0
|
||||
url_launcher:
|
||||
|
||||
# The following adds the Cupertino Icons font to your application.
|
||||
# Use with the CupertinoIcons class for iOS style icons.
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
// This is a basic Flutter widget test.
|
||||
//
|
||||
// To perform an interaction with a widget in your test, use the WidgetTester
|
||||
// utility in the flutter_test package. For example, you can send tap and scroll
|
||||
// gestures. You can also use WidgetTester to find child widgets in the widget
|
||||
// tree, read text, and verify that the values of widget properties are correct.
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
import 'package:easytodo/main.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
|
||||
// Build our app and trigger a frame.
|
||||
await tester.pumpWidget(const MyApp());
|
||||
|
||||
// Verify that our counter starts at 0.
|
||||
expect(find.text('0'), findsOneWidget);
|
||||
expect(find.text('1'), findsNothing);
|
||||
|
||||
// Tap the '+' icon and trigger a frame.
|
||||
await tester.tap(find.byIcon(Icons.add));
|
||||
await tester.pump();
|
||||
|
||||
// Verify that our counter has incremented.
|
||||
expect(find.text('0'), findsNothing);
|
||||
expect(find.text('1'), findsOneWidget);
|
||||
});
|
||||
}
|
|
@ -6,6 +6,9 @@
|
|||
|
||||
#include "generated_plugin_registrant.h"
|
||||
|
||||
#include <url_launcher_windows/url_launcher_windows.h>
|
||||
|
||||
void RegisterPlugins(flutter::PluginRegistry* registry) {
|
||||
UrlLauncherWindowsRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("UrlLauncherWindows"));
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#
|
||||
|
||||
list(APPEND FLUTTER_PLUGIN_LIST
|
||||
url_launcher_windows
|
||||
)
|
||||
|
||||
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
||||
|
|
Loading…
Reference in a new issue