Compare commits
66
Commits
35787cc208
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3983366408 | ||
|
|
3ba7458056 | ||
|
|
a3d7e651f4 | ||
|
|
8678e935df | ||
|
|
9aed2b3ac1 | ||
|
|
6908623ba2 | ||
|
|
a9486727b2 | ||
|
|
e4ba71ad4b | ||
|
|
202ec599d6 | ||
|
|
fbffc0cf4a | ||
|
|
19f9dd9b3b | ||
|
|
b6a73c398e | ||
|
|
c5a209d41e | ||
|
|
852d28afcf | ||
|
|
dac65c8390 | ||
|
|
98991a3d02 | ||
|
|
36b8ce37ad | ||
|
|
7642c6faf2 | ||
|
|
b617724f0a | ||
|
|
4a83465d82 | ||
|
|
a383ebfe34 | ||
|
|
e0302e63e2 | ||
|
|
af3fd69688 | ||
|
|
738a48438e | ||
|
|
2849cec682 | ||
|
|
2544a3de9f | ||
|
|
4aa6926f5c | ||
|
|
cbb2e2c4b0 | ||
|
|
4097a79205 | ||
|
|
0eaac20e7e | ||
|
|
ea745c1cec | ||
|
|
fb278e4487 | ||
|
|
de926bce0e | ||
|
|
6810b84310 | ||
|
|
83da62b5d9 | ||
|
|
b085d3bfb6 | ||
|
|
2a1eb9d07f | ||
|
|
8fb58a4db1 | ||
|
|
e6ba3f1a1c | ||
|
|
305ecd20eb | ||
|
|
da59790796 | ||
|
|
11eff63314 | ||
|
|
3978359dc4 | ||
|
|
e593639217 | ||
|
|
74b25e4e8f | ||
|
|
69f7e0c87b | ||
|
|
4e2ca56a69 | ||
|
|
0a7675797b | ||
|
|
8bda4d593d | ||
|
|
f11ade393a | ||
|
|
59c9c539d2 | ||
|
|
1445c19933 | ||
|
|
e834499644 | ||
|
|
0f7d938ad7 | ||
|
|
b1c7fc8882 | ||
|
|
7c71f5fa3e | ||
|
|
ff9f3263ae | ||
|
|
b58b877bb0 | ||
|
|
ea1cb1da76 | ||
|
|
6092161df0 | ||
|
|
fd83fef528 | ||
|
|
3ff136f758 | ||
|
|
a8b6c9f8a3 | ||
|
|
4d3de751f3 | ||
|
|
84837de3de | ||
|
|
d558a8f5ad |
Vendored
+25
@@ -0,0 +1,25 @@
|
||||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "fmassive",
|
||||
"request": "launch",
|
||||
"type": "dart"
|
||||
},
|
||||
{
|
||||
"name": "fmassive (profile mode)",
|
||||
"request": "launch",
|
||||
"type": "dart",
|
||||
"flutterMode": "profile"
|
||||
},
|
||||
{
|
||||
"name": "fmassive (release mode)",
|
||||
"request": "launch",
|
||||
"type": "dart",
|
||||
"flutterMode": "release"
|
||||
}
|
||||
]
|
||||
}
|
||||
+3
-25
@@ -1,29 +1,7 @@
|
||||
# This file configures the analyzer, which statically analyzes Dart code to
|
||||
# check for errors, warnings, and lints.
|
||||
#
|
||||
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
|
||||
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
|
||||
# invoked from the command line by running `flutter analyze`.
|
||||
|
||||
# The following line activates a set of recommended lints for Flutter apps,
|
||||
# packages, and plugins designed to encourage good coding practices.
|
||||
include: package:flutter_lints/flutter.yaml
|
||||
|
||||
linter:
|
||||
# The lint rules applied to this project can be customized in the
|
||||
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
|
||||
# included above or to enable additional rules. A list of all available lints
|
||||
# and their documentation is published at
|
||||
# https://dart-lang.github.io/linter/lints/index.html.
|
||||
#
|
||||
# Instead of disabling a lint rule for the entire project in the
|
||||
# section below, it can also be suppressed for a single line of code
|
||||
# or a specific dart file by using the `// ignore: name_of_lint` and
|
||||
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
|
||||
# producing the lint.
|
||||
rules:
|
||||
# avoid_print: false # Uncomment to disable the `avoid_print` rule
|
||||
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
|
||||
|
||||
# Additional information about this file can be found at
|
||||
# https://dart.dev/guides/language/analysis-options
|
||||
curly_braces_in_flow_control_structures: false
|
||||
avoid_print: false
|
||||
require_trailing_commas: true
|
||||
|
||||
@@ -39,5 +39,14 @@
|
||||
<meta-data
|
||||
android:name="flutterEmbedding"
|
||||
android:value="2" />
|
||||
|
||||
<activity
|
||||
android:name=".StopAlarm"
|
||||
android:exported="true"
|
||||
android:process=":remote" />
|
||||
|
||||
<service
|
||||
android:name=".AlarmService"
|
||||
android:exported="false" />
|
||||
</application>
|
||||
</manifest>
|
||||
|
||||
@@ -0,0 +1,155 @@
|
||||
package com.example.fmassive
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.*
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.media.AudioAttributes
|
||||
import android.media.MediaPlayer
|
||||
import android.media.MediaPlayer.OnPreparedListener
|
||||
import android.net.Uri
|
||||
import android.os.*
|
||||
import android.util.Log
|
||||
import androidx.annotation.RequiresApi
|
||||
import androidx.core.app.NotificationCompat
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
class AlarmService : Service(), OnPreparedListener {
|
||||
private var mediaPlayer: MediaPlayer? = null
|
||||
private var vibrator: Vibrator? = null
|
||||
|
||||
private fun getBuilder(): NotificationCompat.Builder {
|
||||
val context = applicationContext
|
||||
val contentIntent = Intent(context, MainActivity::class.java)
|
||||
val pendingContent =
|
||||
PendingIntent.getActivity(context, 0, contentIntent, PendingIntent.FLAG_IMMUTABLE)
|
||||
val addBroadcast = Intent(MainActivity.ADD_BROADCAST).apply {
|
||||
setPackage(context.packageName)
|
||||
}
|
||||
val pendingAdd =
|
||||
PendingIntent.getBroadcast(context, 0, addBroadcast, PendingIntent.FLAG_MUTABLE)
|
||||
val stopBroadcast = Intent(MainActivity.STOP_BROADCAST)
|
||||
stopBroadcast.setPackage(context.packageName)
|
||||
val pendingStop =
|
||||
PendingIntent.getBroadcast(context, 0, stopBroadcast, PendingIntent.FLAG_IMMUTABLE)
|
||||
return NotificationCompat.Builder(context, MainActivity.CHANNEL_ID_PENDING)
|
||||
.setSmallIcon(R.drawable.baseline_hourglass_bottom_24).setContentTitle("Resting")
|
||||
.setContentIntent(pendingContent)
|
||||
.addAction(R.drawable.launch_background, "Stop", pendingStop)
|
||||
.addAction(R.drawable.launch_background, "Add 1 min", pendingAdd)
|
||||
.setDeleteIntent(pendingStop)
|
||||
}
|
||||
|
||||
|
||||
@SuppressLint("Range")
|
||||
private fun getSettings(): Settings {
|
||||
val db = DatabaseHelper(applicationContext).readableDatabase
|
||||
val cursor = db.rawQuery("SELECT sound, no_sound, vibrate FROM settings", null)
|
||||
cursor.moveToFirst()
|
||||
val sound = cursor.getString(cursor.getColumnIndex("sound"))
|
||||
val noSound = cursor.getInt(cursor.getColumnIndex("no_sound")) == 1
|
||||
val vibrate = cursor.getInt(cursor.getColumnIndex("vibrate")) == 1
|
||||
Log.d("AlarmService", "vibrate=$vibrate")
|
||||
cursor.close()
|
||||
return Settings(sound, noSound, vibrate)
|
||||
}
|
||||
|
||||
private fun playSound(settings: Settings) {
|
||||
if (settings.sound == null && !settings.noSound) {
|
||||
Log.d("AlarmService", "Playing default alarm sound...")
|
||||
mediaPlayer = MediaPlayer.create(applicationContext, R.raw.argon)
|
||||
mediaPlayer?.start()
|
||||
mediaPlayer?.setOnCompletionListener { vibrator?.cancel() }
|
||||
} else if (settings.sound != null && !settings.noSound) {
|
||||
Log.d("AlarmService", "Playing custom alarm sound ${settings.sound}...")
|
||||
mediaPlayer = MediaPlayer().apply {
|
||||
setAudioAttributes(
|
||||
AudioAttributes.Builder()
|
||||
.setContentType(AudioAttributes.CONTENT_TYPE_MUSIC)
|
||||
.setUsage(AudioAttributes.USAGE_MEDIA)
|
||||
.build()
|
||||
)
|
||||
setDataSource(applicationContext, Uri.parse(settings.sound))
|
||||
prepare()
|
||||
start()
|
||||
setOnCompletionListener { vibrator?.cancel() }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun doNotify(): Notification {
|
||||
Log.d("AlarmService", "doNotify")
|
||||
val alarmsChannel = NotificationChannel(
|
||||
CHANNEL_ID_DONE,
|
||||
CHANNEL_ID_DONE,
|
||||
NotificationManager.IMPORTANCE_HIGH
|
||||
)
|
||||
alarmsChannel.description = "Alarms for rest timers."
|
||||
alarmsChannel.lockscreenVisibility = Notification.VISIBILITY_PUBLIC
|
||||
alarmsChannel.setSound(null, null)
|
||||
val manager = applicationContext.getSystemService(
|
||||
NotificationManager::class.java
|
||||
)
|
||||
manager.createNotificationChannel(alarmsChannel)
|
||||
val builder = getBuilder()
|
||||
val context = applicationContext
|
||||
val finishIntent = Intent(context, StopAlarm::class.java)
|
||||
val finishPending = PendingIntent.getActivity(
|
||||
context, 0, finishIntent, PendingIntent.FLAG_IMMUTABLE
|
||||
)
|
||||
builder.setContentText("Timer finished.").setProgress(0, 0, false)
|
||||
.setAutoCancel(true).setOngoing(true)
|
||||
.setContentIntent(finishPending).setChannelId(CHANNEL_ID_DONE)
|
||||
.setCategory(NotificationCompat.CATEGORY_ALARM).priority =
|
||||
NotificationCompat.PRIORITY_HIGH
|
||||
val notification = builder.build()
|
||||
manager.notify(NOTIFICATION_ID_DONE, notification)
|
||||
manager.cancel(MainActivity.NOTIFICATION_ID_PENDING)
|
||||
return notification
|
||||
}
|
||||
|
||||
@SuppressLint("Recycle")
|
||||
override fun onStartCommand(intent: Intent, flags: Int, startId: Int): Int {
|
||||
Log.d("AlarmService", "onStartCommand")
|
||||
val notification = doNotify()
|
||||
startForeground(NOTIFICATION_ID_DONE, notification)
|
||||
val settings = getSettings()
|
||||
playSound(settings)
|
||||
if (!settings.vibrate) return START_STICKY
|
||||
val pattern = longArrayOf(0, 300, 1300, 300, 1300, 300)
|
||||
vibrator = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
||||
val vibratorManager =
|
||||
getSystemService(Context.VIBRATOR_MANAGER_SERVICE) as VibratorManager
|
||||
vibratorManager.defaultVibrator
|
||||
} else {
|
||||
@Suppress("DEPRECATION")
|
||||
getSystemService(VIBRATOR_SERVICE) as Vibrator
|
||||
}
|
||||
val audioAttributes = AudioAttributes.Builder()
|
||||
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
|
||||
.setUsage(AudioAttributes.USAGE_ALARM)
|
||||
.build()
|
||||
vibrator!!.vibrate(VibrationEffect.createWaveform(pattern, 1), audioAttributes)
|
||||
return START_STICKY
|
||||
}
|
||||
|
||||
override fun onBind(intent: Intent): IBinder? {
|
||||
return null
|
||||
}
|
||||
|
||||
override fun onPrepared(player: MediaPlayer) {
|
||||
player.start()
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
mediaPlayer?.stop()
|
||||
mediaPlayer?.release()
|
||||
vibrator?.cancel()
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val CHANNEL_ID_DONE = "Alarm"
|
||||
const val NOTIFICATION_ID_DONE = 2
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.example.fmassive
|
||||
|
||||
import android.content.Context
|
||||
import android.database.sqlite.SQLiteDatabase
|
||||
import android.database.sqlite.SQLiteOpenHelper
|
||||
|
||||
class DatabaseHelper(context: Context) :
|
||||
SQLiteOpenHelper(context, DATABASE_NAME, null, DATABASE_VERSION) {
|
||||
companion object {
|
||||
private const val DATABASE_NAME = "massive.db"
|
||||
private const val DATABASE_VERSION = 1
|
||||
}
|
||||
|
||||
override fun onCreate(db: SQLiteDatabase) {
|
||||
}
|
||||
|
||||
override fun onUpgrade(db: SQLiteDatabase, oldVersion: Int, newVersion: Int) {
|
||||
}
|
||||
|
||||
override fun onDowngrade(db: SQLiteDatabase, oldVersion: Int, newVersion: Int) {
|
||||
}
|
||||
}
|
||||
@@ -18,17 +18,15 @@ import io.flutter.embedding.engine.FlutterEngine
|
||||
import io.flutter.plugin.common.MethodChannel
|
||||
import kotlin.math.floor
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
class MainActivity : FlutterActivity() {
|
||||
private val CHANNEL = "com.massive/android"
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
|
||||
super.configureFlutterEngine(flutterEngine)
|
||||
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, CHANNEL).setMethodCallHandler {
|
||||
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, FLUTTER_CHANNEL).setMethodCallHandler {
|
||||
call, result ->
|
||||
if (call.method == "timer") {
|
||||
val args = call.arguments as ArrayList<*>
|
||||
timer(args[0] as Long)
|
||||
timer(args[0] as Int)
|
||||
} else {
|
||||
result.notImplemented()
|
||||
}
|
||||
@@ -40,15 +38,13 @@ class MainActivity : FlutterActivity() {
|
||||
private var running = false
|
||||
|
||||
private val stopReceiver = object : BroadcastReceiver() {
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
override fun onReceive(context: Context?, intent: Intent?) {
|
||||
Log.d("AlarmModule", "Received stop broadcast intent")
|
||||
Log.d("MainActivity", "Received stop broadcast intent")
|
||||
stop()
|
||||
}
|
||||
}
|
||||
|
||||
private val addReceiver = object : BroadcastReceiver() {
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
override fun onReceive(context: Context?, intent: Intent?) {
|
||||
add()
|
||||
}
|
||||
@@ -57,61 +53,49 @@ class MainActivity : FlutterActivity() {
|
||||
init {
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.O)
|
||||
fun add() {
|
||||
Log.d("AlarmModule", "Add 1 min to alarm.")
|
||||
Log.d("MainActivity", "Add 1 min to alarm.")
|
||||
countdownTimer?.cancel()
|
||||
val newMs = if (running) currentMs.toInt().plus(60000) else 60000
|
||||
countdownTimer = getTimer(newMs.toLong())
|
||||
countdownTimer = getTimer(newMs)
|
||||
countdownTimer?.start()
|
||||
running = true
|
||||
//val manager = getManager()
|
||||
//manager.cancel(AlarmService.NOTIFICATION_ID_DONE)
|
||||
//val intent = Intent(context, AlarmService::class.java)
|
||||
//context.stopService(intent)
|
||||
val manager = getManager()
|
||||
manager.cancel(AlarmService.NOTIFICATION_ID_DONE)
|
||||
val intent = Intent(context, AlarmService::class.java)
|
||||
context.stopService(intent)
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.O)
|
||||
fun stop() {
|
||||
Log.d("AlarmModule", "Stop alarm.")
|
||||
Log.d("MainActivity", "Stop alarm.")
|
||||
countdownTimer?.cancel()
|
||||
running = false
|
||||
//val intent = Intent(context, AlarmService::class.java)
|
||||
//reactApplicationContext?.stopService(intent)
|
||||
//val manager = getManager()
|
||||
//manager.cancel(AlarmService.NOTIFICATION_ID_DONE)
|
||||
//manager.cancel(NOTIFICATION_ID_PENDING)
|
||||
//val params = Arguments.createMap().apply {
|
||||
// putString("minutes", "00")
|
||||
// putString("seconds", "00")
|
||||
//}
|
||||
//reactApplicationContext
|
||||
// .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
|
||||
// .emit("tick", params)
|
||||
val intent = Intent(context, AlarmService::class.java)
|
||||
context.stopService(intent)
|
||||
val manager = getManager()
|
||||
manager.cancel(AlarmService.NOTIFICATION_ID_DONE)
|
||||
manager.cancel(NOTIFICATION_ID_PENDING)
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.O)
|
||||
fun timer(milliseconds: Long) {
|
||||
fun timer(milliseconds: Int) {
|
||||
context.registerReceiver(stopReceiver, IntentFilter(STOP_BROADCAST))
|
||||
context.registerReceiver(addReceiver, IntentFilter(ADD_BROADCAST))
|
||||
Log.d("AlarmModule", "Queue alarm for $milliseconds delay")
|
||||
//val manager = getManager()
|
||||
//manager.cancel(AlarmService.NOTIFICATION_ID_DONE)
|
||||
//val intent = Intent(reactApplicationContext, AlarmService::class.java)
|
||||
//reactApplicationContext.stopService(intent)
|
||||
Log.d("MainActivity", "Queue alarm for $milliseconds delay")
|
||||
val manager = getManager()
|
||||
manager.cancel(AlarmService.NOTIFICATION_ID_DONE)
|
||||
val intent = Intent(context, AlarmService::class.java)
|
||||
context.stopService(intent)
|
||||
countdownTimer?.cancel()
|
||||
countdownTimer = getTimer(milliseconds)
|
||||
countdownTimer?.start()
|
||||
running = true
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.M)
|
||||
private fun getTimer(
|
||||
endMs: Long,
|
||||
endMs: Int,
|
||||
): CountDownTimer {
|
||||
val builder = getBuilder()
|
||||
return object : CountDownTimer(endMs.toLong(), 1000) {
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
override fun onTick(current: Long) {
|
||||
currentMs = current
|
||||
val seconds =
|
||||
@@ -123,33 +107,18 @@ class MainActivity : FlutterActivity() {
|
||||
.setCategory(NotificationCompat.CATEGORY_PROGRESS).priority =
|
||||
NotificationCompat.PRIORITY_LOW
|
||||
val manager = getManager()
|
||||
Log.d("AlarmModule", "Notify $NOTIFICATION_ID_PENDING")
|
||||
Log.d("MainActivity", "current=$current")
|
||||
manager.notify(NOTIFICATION_ID_PENDING, builder.build())
|
||||
//val params = Arguments.createMap().apply {
|
||||
// putString("minutes", minutes)
|
||||
// putString("seconds", seconds)
|
||||
//}
|
||||
//reactApplicationContext
|
||||
// .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
|
||||
// .emit("tick", params)
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
override fun onFinish() {
|
||||
//val context = reactApplicationContext
|
||||
//context.startForegroundService(Intent(context, AlarmService::class.java))
|
||||
//context
|
||||
// .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
|
||||
// .emit("finish", Arguments.createMap().apply {
|
||||
// putString("minutes", "00")
|
||||
// putString("seconds", "00")
|
||||
// })
|
||||
Log.d("MainActivity", "Finish")
|
||||
context.startForegroundService(Intent(context, AlarmService::class.java))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("UnspecifiedImmutableFlag")
|
||||
@RequiresApi(Build.VERSION_CODES.M)
|
||||
private fun getBuilder(): NotificationCompat.Builder {
|
||||
val contentIntent = Intent(context, MainActivity::class.java)
|
||||
val pendingContent =
|
||||
@@ -164,14 +133,13 @@ class MainActivity : FlutterActivity() {
|
||||
val pendingStop =
|
||||
PendingIntent.getBroadcast(context, 0, stopBroadcast, PendingIntent.FLAG_IMMUTABLE)
|
||||
return NotificationCompat.Builder(context, CHANNEL_ID_PENDING)
|
||||
.setSmallIcon(R.drawable.ic_baseline_hourglass_bottom_24).setContentTitle("Resting")
|
||||
.setSmallIcon(R.drawable.baseline_hourglass_bottom_24).setContentTitle("Resting")
|
||||
.setContentIntent(pendingContent)
|
||||
.addAction(R.drawable.ic_baseline_stop_24, "Stop", pendingStop)
|
||||
.addAction(R.drawable.ic_baseline_stop_24, "Add 1 min", pendingAdd)
|
||||
.addAction(R.drawable.baseline_hourglass_bottom_24, "Stop", pendingStop)
|
||||
.addAction(R.drawable.baseline_hourglass_bottom_24, "Add 1 min", pendingAdd)
|
||||
.setDeleteIntent(pendingStop)
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
private fun getManager(): NotificationManager {
|
||||
val notificationManager = context.getSystemService(
|
||||
NotificationManager::class.java
|
||||
@@ -190,5 +158,6 @@ class MainActivity : FlutterActivity() {
|
||||
const val ADD_BROADCAST = "add-timer-event"
|
||||
const val CHANNEL_ID_PENDING = "Timer"
|
||||
const val NOTIFICATION_ID_PENDING = 1
|
||||
const val FLUTTER_CHANNEL = "com.massive/android"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
package com.example.fmassive
|
||||
|
||||
class Settings(val sound: String?, val noSound: Boolean, val vibrate: Boolean)
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.example.fmassive
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Intent
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import androidx.annotation.RequiresApi
|
||||
|
||||
class StopAlarm : Activity() {
|
||||
@RequiresApi(Build.VERSION_CODES.O_MR1)
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
Log.d("AlarmActivity", "Call to AlarmActivity")
|
||||
super.onCreate(savedInstanceState)
|
||||
val context = applicationContext
|
||||
context.stopService(Intent(context, AlarmService::class.java))
|
||||
savedInstanceState.apply { setShowWhenLocked(true) }
|
||||
val intent = Intent(context, MainActivity::class.java)
|
||||
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
context.startActivity(intent)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<vector android:height="24dp" android:tint="#000000"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M18,22l-0.01,-6L14,12l3.99,-4.01L18,2H6v6l4,4l-4,3.99V22H18zM8,7.5V4h8v3.5l-4,4L8,7.5z"/>
|
||||
</vector>
|
||||
Binary file not shown.
@@ -26,6 +26,6 @@ subprojects {
|
||||
project.evaluationDependsOn(':app')
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
tasks.register("clean", Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
dart run build_runner build --delete-conflicting-outputs
|
||||
+2
-5
@@ -5,11 +5,8 @@ class BestPage extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Best'),
|
||||
),
|
||||
body: const Center(
|
||||
return const Scaffold(
|
||||
body: Center(
|
||||
child: Text('Welcome to the Best Page!'),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
const List<String> weekdayNames = [
|
||||
'Monday',
|
||||
'Tuesday',
|
||||
'Wednesday',
|
||||
'Thursday',
|
||||
'Friday',
|
||||
'Saturday',
|
||||
'Sunday',
|
||||
];
|
||||
@@ -0,0 +1,40 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:fmassive/gym_sets.dart';
|
||||
import 'package:fmassive/main.dart';
|
||||
import 'package:fmassive/plans.dart';
|
||||
import 'package:moor/ffi.dart';
|
||||
import 'package:moor/moor.dart';
|
||||
import 'package:path/path.dart';
|
||||
import 'package:sqflite/sqflite.dart';
|
||||
|
||||
import 'settings.dart';
|
||||
|
||||
part 'database.g.dart';
|
||||
|
||||
@UseMoor(tables: [Settings, GymSets, Plans])
|
||||
class MyDatabase extends _$MyDatabase {
|
||||
MyDatabase() : super(_openConnection());
|
||||
|
||||
@override
|
||||
int get schemaVersion => 1;
|
||||
|
||||
@override
|
||||
MigrationStrategy get migration => MigrationStrategy(
|
||||
onCreate: (Migrator m) async {
|
||||
print('Creating...');
|
||||
await m.createAll();
|
||||
var data = await (db.select(db.settings)..limit(1)).get();
|
||||
if (data.isEmpty) await db.into(db.settings).insert(defaultSettings);
|
||||
},
|
||||
onUpgrade: (Migrator m, int from, int to) async {},
|
||||
);
|
||||
}
|
||||
|
||||
LazyDatabase _openConnection() {
|
||||
return LazyDatabase(() async {
|
||||
final dbFolder = await getDatabasesPath();
|
||||
final file = File(join(dbFolder, 'massive.db'));
|
||||
return VmDatabase(file, logStatements: true);
|
||||
});
|
||||
}
|
||||
+1464
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,51 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:fmassive/main.dart';
|
||||
import 'package:moor/moor.dart';
|
||||
|
||||
class DeleteAllSets extends StatelessWidget {
|
||||
const DeleteAllSets({
|
||||
super.key,
|
||||
required this.mounted,
|
||||
});
|
||||
|
||||
final bool mounted;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Center(
|
||||
child: ElevatedButton(
|
||||
child: const Text("Delete all sets"),
|
||||
onPressed: () async {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return AlertDialog(
|
||||
title: const Text("Delete all sets"),
|
||||
content: const Text(
|
||||
"This will irreversibly destroy all your gym set data. Are you sure?",),
|
||||
actions: <Widget>[
|
||||
ElevatedButton(
|
||||
child: const Text('Cancel'),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
ElevatedButton(
|
||||
child: const Text('Delete'),
|
||||
onPressed: () async {
|
||||
await db.gymSets.delete().go();
|
||||
if (!mounted) return;
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text('Deleted all sets')),);
|
||||
final navigator = Navigator.of(context);
|
||||
navigator.pop();
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
},);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class DynamicColorScheme extends StatefulWidget {
|
||||
final Color Function(Brightness brightness) data;
|
||||
final Widget Function(BuildContext context, ColorScheme colorScheme) builder;
|
||||
|
||||
const DynamicColorScheme({
|
||||
required this.data,
|
||||
required this.builder,
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
createState() => _DynamicColorSchemeState();
|
||||
}
|
||||
|
||||
class _DynamicColorSchemeState extends State<DynamicColorScheme> {
|
||||
late final ValueNotifier<Brightness> brightness;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
brightness = ValueNotifier(MediaQuery.of(context).platformBrightness);
|
||||
}
|
||||
|
||||
@override
|
||||
void didChangeDependencies() {
|
||||
super.didChangeDependencies();
|
||||
brightness.value = MediaQuery.of(context).platformBrightness;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ValueListenableBuilder<Brightness>(
|
||||
valueListenable: brightness,
|
||||
builder: (context, platformBrightness, child) {
|
||||
final colorScheme = ColorScheme.fromSwatch(
|
||||
brightness: platformBrightness,
|
||||
primarySwatch: Colors.blue,
|
||||
accentColor: Colors.blueAccent,
|
||||
).copyWith(
|
||||
secondary: Colors.red,
|
||||
);
|
||||
final color = widget.data(platformBrightness);
|
||||
return widget.builder(
|
||||
context,
|
||||
colorScheme.copyWith(
|
||||
primary: color,
|
||||
),);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,192 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/material.dart' as material;
|
||||
import 'package:fmassive/constants.dart';
|
||||
import 'package:fmassive/database.dart';
|
||||
import 'package:fmassive/main.dart';
|
||||
import 'package:moor_flutter/moor_flutter.dart';
|
||||
|
||||
class EditPlanPage extends StatefulWidget {
|
||||
final PlansCompanion plan;
|
||||
|
||||
const EditPlanPage({required this.plan, super.key});
|
||||
|
||||
@override
|
||||
createState() => _EditPlanPageState();
|
||||
}
|
||||
|
||||
class _EditPlanPageState extends State<EditPlanPage> {
|
||||
List<String?> names = [];
|
||||
List<bool>? daySelections;
|
||||
List<bool>? exerciseSelections;
|
||||
|
||||
Future<List<String?>> getDistinctNames() async {
|
||||
final names = await (db.gymSets.selectOnly(distinct: true)
|
||||
..addColumns([db.gymSets.name]))
|
||||
.get();
|
||||
return names.map((name) => name.read(db.gymSets.name)).toList();
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
final dayList = widget.plan.days.value.split(',');
|
||||
daySelections = weekdayNames.map((day) => dayList.contains(day)).toList();
|
||||
|
||||
getDistinctNames().then((value) {
|
||||
setState(() {
|
||||
names = value;
|
||||
final exercises = widget.plan.exercises.value.split(',');
|
||||
exerciseSelections =
|
||||
names.map((name) => exercises.contains(name)).toList();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
Future<bool?> _showConfirmationDialog(BuildContext context) {
|
||||
return showDialog<bool>(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
title: const Text('Confirm Delete'),
|
||||
content: const Text('Are you sure you want to delete this plan?'),
|
||||
actions: <Widget>[
|
||||
ElevatedButton(
|
||||
child: const Text('Yes'),
|
||||
onPressed: () {
|
||||
Navigator.pop(context, true); // showDialog() returns true
|
||||
},
|
||||
),
|
||||
ElevatedButton(
|
||||
child: const Text('No'),
|
||||
onPressed: () {
|
||||
Navigator.pop(context, false); // showDialog() returns false
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
List<Widget> actions = [];
|
||||
if (widget.plan.id.present)
|
||||
actions.add(
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
bool? confirm = await _showConfirmationDialog(context);
|
||||
if (!confirm!) return;
|
||||
await db.plans.deleteOne(widget.plan);
|
||||
if (!mounted) return;
|
||||
Navigator.pop(context);
|
||||
},
|
||||
icon: const Icon(Icons.delete),
|
||||
),
|
||||
);
|
||||
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(title: const Text('Edit Plan'), actions: actions),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: material.Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: getChildren,
|
||||
),
|
||||
),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: () async {
|
||||
final days = [];
|
||||
for (int i = 0; i < daySelections!.length; i++) {
|
||||
if (daySelections![i]) days.add(weekdayNames[i]);
|
||||
}
|
||||
if (days.isEmpty) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text('Select days first')),
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
final exercises = [];
|
||||
for (int i = 0; i < exerciseSelections!.length; i++) {
|
||||
if (exerciseSelections![i]) exercises.add(names[i]);
|
||||
}
|
||||
if (exercises.isEmpty) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text('Select exercises first')),
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
var newPlan = widget.plan.copyWith(
|
||||
days: Value(days.join(',')),
|
||||
exercises: Value(exercises.join(',')),
|
||||
);
|
||||
|
||||
if (widget.plan.id.present)
|
||||
await db.update(db.plans).replace(newPlan);
|
||||
else {
|
||||
final id = await db.into(db.plans).insert(newPlan);
|
||||
newPlan = newPlan.copyWith(id: Value(id));
|
||||
}
|
||||
|
||||
if (!mounted) return;
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: const Icon(Icons.check),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
List<Widget> get getChildren {
|
||||
final List<Widget> children = [
|
||||
Text('Days', style: Theme.of(context).textTheme.headlineSmall),
|
||||
];
|
||||
|
||||
final days = List.generate(7, (index) {
|
||||
return SwitchListTile(
|
||||
title: Text(weekdayNames[index]),
|
||||
value: daySelections![index],
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
daySelections![index] = value;
|
||||
});
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
final exercises = List.generate(names.length, (index) {
|
||||
return SwitchListTile(
|
||||
title: Text(names[index] ?? ''),
|
||||
value: exerciseSelections![index],
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
exerciseSelections![index] = value;
|
||||
});
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
children.addAll(days);
|
||||
children.add(
|
||||
Text('Exercises', style: Theme.of(context).textTheme.headlineSmall),
|
||||
);
|
||||
children.addAll(exercises);
|
||||
|
||||
return [
|
||||
Expanded(
|
||||
child: ListView(
|
||||
children: children,
|
||||
),
|
||||
),
|
||||
];
|
||||
}
|
||||
}
|
||||
+76
-33
@@ -1,8 +1,13 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:fmassive/gym_set.dart';
|
||||
import 'package:flutter/material.dart' as material;
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:fmassive/database.dart';
|
||||
import 'package:fmassive/main.dart';
|
||||
import 'package:moor_flutter/moor_flutter.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
|
||||
class EditGymSetPage extends StatefulWidget {
|
||||
final GymSet gymSet;
|
||||
final GymSetsCompanion gymSet;
|
||||
|
||||
const EditGymSetPage({required this.gymSet, super.key});
|
||||
|
||||
@@ -14,58 +19,80 @@ class _EditGymSetPageState extends State<EditGymSetPage> {
|
||||
final TextEditingController _nameController = TextEditingController();
|
||||
final TextEditingController _repsController = TextEditingController();
|
||||
final TextEditingController _weightController = TextEditingController();
|
||||
|
||||
late GymSet _editedGymSet;
|
||||
late GymSetDatabaseHelper _db;
|
||||
late GymSetsCompanion gymSet;
|
||||
final nameNode = FocusNode();
|
||||
final repsNode = FocusNode();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_db = GymSetDatabaseHelper.instance;
|
||||
_editedGymSet = GymSet(
|
||||
id: widget.gymSet.id,
|
||||
name: widget.gymSet.name,
|
||||
reps: widget.gymSet.reps,
|
||||
weight: widget.gymSet.weight,
|
||||
created: DateTime.now());
|
||||
_nameController.text = _editedGymSet.name;
|
||||
_repsController.text = _editedGymSet.reps.toString();
|
||||
_weightController.text = _editedGymSet.weight.toString();
|
||||
gymSet = widget.gymSet;
|
||||
print(gymSet);
|
||||
_nameController.text = gymSet.name.value;
|
||||
_repsController.text = gymSet.reps.value.toString();
|
||||
_weightController.text = gymSet.weight.value.toString();
|
||||
if (gymSet.id.present) {
|
||||
repsNode.requestFocus();
|
||||
_repsController.selection = TextSelection(
|
||||
baseOffset: 0, extentOffset: _repsController.text.length,);
|
||||
} else
|
||||
nameNode.requestFocus();
|
||||
}
|
||||
|
||||
@override
|
||||
dispose() {
|
||||
nameNode.dispose();
|
||||
repsNode.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: const Text('Edit Gym Set'), actions: [
|
||||
IconButton(
|
||||
List<Widget> actions = [];
|
||||
if (widget.gymSet.id.present)
|
||||
actions.add(IconButton(
|
||||
onPressed: () async {
|
||||
await _db.delete(_editedGymSet);
|
||||
await db.gymSets.deleteOne(widget.gymSet);
|
||||
if (!mounted) return;
|
||||
Navigator.pop(context, _editedGymSet);
|
||||
Navigator.pop(context);
|
||||
},
|
||||
icon: const Icon(Icons.delete))
|
||||
]),
|
||||
icon: const Icon(Icons.delete),),);
|
||||
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(title: const Text('Edit Gym Set'), actions: actions),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Column(
|
||||
child: material.Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
TextFormField(
|
||||
controller: _nameController,
|
||||
focusNode: nameNode,
|
||||
decoration: const InputDecoration(labelText: 'Name'),
|
||||
onTap: () {
|
||||
_nameController.selection = TextSelection(
|
||||
baseOffset: 0, extentOffset: _nameController.text.length,);
|
||||
},
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
_editedGymSet.name = value;
|
||||
gymSet = gymSet.copyWith(name: Value(value));
|
||||
});
|
||||
},
|
||||
),
|
||||
TextFormField(
|
||||
controller: _repsController,
|
||||
focusNode: repsNode,
|
||||
onTap: () {
|
||||
_repsController.selection = TextSelection(
|
||||
baseOffset: 0, extentOffset: _repsController.text.length,);
|
||||
},
|
||||
decoration: const InputDecoration(labelText: 'Reps'),
|
||||
keyboardType: TextInputType.number,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
_editedGymSet.reps = int.tryParse(value) ?? 0;
|
||||
gymSet =
|
||||
gymSet.copyWith(reps: Value(int.tryParse(value) ?? 0));
|
||||
});
|
||||
},
|
||||
),
|
||||
@@ -73,9 +100,14 @@ class _EditGymSetPageState extends State<EditGymSetPage> {
|
||||
controller: _weightController,
|
||||
decoration: const InputDecoration(labelText: 'Weight (kg)'),
|
||||
keyboardType: TextInputType.number,
|
||||
onTap: () {
|
||||
_weightController.selection = TextSelection(
|
||||
baseOffset: 0, extentOffset: _weightController.text.length,);
|
||||
},
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
_editedGymSet.weight = int.tryParse(value) ?? 0;
|
||||
gymSet = gymSet.copyWith(
|
||||
weight: Value(double.tryParse(value) ?? 0),);
|
||||
});
|
||||
},
|
||||
),
|
||||
@@ -84,16 +116,27 @@ class _EditGymSetPageState extends State<EditGymSetPage> {
|
||||
),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: () async {
|
||||
print('edited gym set id: ${_editedGymSet.id}');
|
||||
if (_editedGymSet.id != null)
|
||||
await _db.update(_editedGymSet);
|
||||
else
|
||||
await _db.insert(_editedGymSet);
|
||||
if (_nameController.text.isEmpty) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text('Please enter a name')),);
|
||||
nameNode.requestFocus();
|
||||
return;
|
||||
}
|
||||
if (gymSet.id.present)
|
||||
await db.update(db.gymSets).replace(gymSet);
|
||||
else {
|
||||
await Permission.notification.request();
|
||||
final newSet = gymSet.copyWith(
|
||||
created: Value(DateTime.now().toIso8601String()),);
|
||||
await db.into(db.gymSets).insert(newSet);
|
||||
const platform = MethodChannel('com.massive/android');
|
||||
platform.invokeMethod('timer', [3000]);
|
||||
}
|
||||
if (!mounted) return;
|
||||
Navigator.pop(context, _editedGymSet);
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: const Icon(Icons.check),
|
||||
),
|
||||
);
|
||||
),);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,101 +0,0 @@
|
||||
import 'package:path/path.dart';
|
||||
import 'package:sqflite/sqflite.dart';
|
||||
|
||||
class GymSet {
|
||||
int? id;
|
||||
String name;
|
||||
int reps;
|
||||
int weight;
|
||||
DateTime created;
|
||||
|
||||
GymSet(
|
||||
{this.id,
|
||||
required this.name,
|
||||
required this.reps,
|
||||
required this.weight,
|
||||
required this.created});
|
||||
}
|
||||
|
||||
class GymSetDatabaseHelper {
|
||||
static const _databaseName = "gym_set_database.db";
|
||||
static const _databaseVersion = 1;
|
||||
static const table = 'gym_sets';
|
||||
static const columnId = '_id';
|
||||
static const columnName = 'name';
|
||||
static const columnReps = 'reps';
|
||||
static const columnWeight = 'weight';
|
||||
static const columnCreated = 'created';
|
||||
|
||||
GymSetDatabaseHelper._privateConstructor();
|
||||
static final GymSetDatabaseHelper instance =
|
||||
GymSetDatabaseHelper._privateConstructor();
|
||||
|
||||
static Database? _database;
|
||||
Future<Database> get database async {
|
||||
if (_database != null) return _database!;
|
||||
_database = await _initDatabase();
|
||||
return _database!;
|
||||
}
|
||||
|
||||
_initDatabase() async {
|
||||
String path = join(await getDatabasesPath(), _databaseName);
|
||||
return await openDatabase(path,
|
||||
version: _databaseVersion, onCreate: _onCreate);
|
||||
}
|
||||
|
||||
Future _onCreate(Database db, int version) async {
|
||||
await db.execute('''
|
||||
CREATE TABLE $table (
|
||||
$columnId INTEGER PRIMARY KEY,
|
||||
$columnName TEXT NOT NULL,
|
||||
$columnReps INTEGER NOT NULL,
|
||||
$columnWeight INTEGER NOT NULL,
|
||||
$columnCreated TEXT NOT NULL
|
||||
)
|
||||
''');
|
||||
}
|
||||
|
||||
Future<int> insert(GymSet gymSet) async {
|
||||
Database db = await instance.database;
|
||||
return await db.insert(table, {
|
||||
columnName: gymSet.name,
|
||||
columnReps: gymSet.reps,
|
||||
columnWeight: gymSet.weight,
|
||||
columnCreated: gymSet.created.toIso8601String()
|
||||
});
|
||||
}
|
||||
|
||||
Future<List<GymSet>> getAll() async {
|
||||
Database db = await instance.database;
|
||||
List<Map<String, dynamic>> result = await db.query(table);
|
||||
return result
|
||||
.map((gymSetMap) => GymSet(
|
||||
id: gymSetMap[columnId],
|
||||
name: gymSetMap[columnName],
|
||||
reps: gymSetMap[columnReps],
|
||||
weight: gymSetMap[columnWeight],
|
||||
created: DateTime.parse(gymSetMap[columnCreated]),
|
||||
))
|
||||
.toList();
|
||||
}
|
||||
|
||||
Future<int> update(GymSet gymSet) async {
|
||||
Database db = await instance.database;
|
||||
return await db.update(
|
||||
table,
|
||||
{
|
||||
columnName: gymSet.name,
|
||||
columnReps: gymSet.reps,
|
||||
columnWeight: gymSet.weight,
|
||||
columnCreated: gymSet.created.toIso8601String()
|
||||
},
|
||||
where: '$columnId = ?',
|
||||
whereArgs: [gymSet.id]);
|
||||
}
|
||||
|
||||
Future<int> delete(GymSet gymSet) async {
|
||||
Database db = await instance.database;
|
||||
return await db
|
||||
.delete(table, where: '$columnId = ?', whereArgs: [gymSet.id]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import 'package:moor_flutter/moor_flutter.dart';
|
||||
|
||||
class GymSets extends Table {
|
||||
IntColumn get id => integer().autoIncrement()();
|
||||
TextColumn get name => text()();
|
||||
IntColumn get reps => integer()();
|
||||
RealColumn get weight => real()();
|
||||
IntColumn get sets => integer().withDefault(const Constant(3))();
|
||||
IntColumn get minutes => integer().withDefault(const Constant(3))();
|
||||
IntColumn get seconds => integer().withDefault(const Constant(30))();
|
||||
BoolColumn get hidden =>
|
||||
boolean().nullable().withDefault(const Constant(false))();
|
||||
TextColumn get created => text()();
|
||||
TextColumn get unit => text().withDefault(const Constant('kg'))();
|
||||
TextColumn get image => text().nullable()();
|
||||
TextColumn get steps => text().nullable()();
|
||||
}
|
||||
+71
-113
@@ -1,9 +1,23 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:fmassive/edit_set.dart';
|
||||
import 'package:fmassive/gym_set.dart';
|
||||
import 'package:fmassive/best_page.dart';
|
||||
import 'package:fmassive/plans_page.dart';
|
||||
import 'package:fmassive/set_list.dart';
|
||||
import 'package:fmassive/settings_page.dart';
|
||||
import 'package:fmassive/timer_page.dart';
|
||||
import 'package:fmassive/workouts_page.dart';
|
||||
|
||||
class HomePage extends StatelessWidget {
|
||||
HomePage({super.key});
|
||||
class HomePage extends StatefulWidget {
|
||||
const HomePage({super.key});
|
||||
|
||||
@override
|
||||
createState() => _HomePage();
|
||||
}
|
||||
|
||||
class _HomePage extends State<HomePage> {
|
||||
bool showSearch = false;
|
||||
int selected = 0;
|
||||
String search = '';
|
||||
final focusNode = FocusNode();
|
||||
|
||||
final List<Map<String, dynamic>> routes = [
|
||||
{'title': 'Home', 'icon': Icons.home},
|
||||
@@ -14,135 +28,79 @@ class HomePage extends StatelessWidget {
|
||||
{'title': 'Settings', 'icon': Icons.settings},
|
||||
];
|
||||
|
||||
void toggleSearch() {
|
||||
setState(() {
|
||||
if (showSearch) search = '';
|
||||
showSearch = !showSearch;
|
||||
});
|
||||
focusNode.requestFocus();
|
||||
}
|
||||
|
||||
Widget getBody() {
|
||||
switch (routes[selected]['title']) {
|
||||
case 'Settings':
|
||||
return SettingsPage(search: search);
|
||||
case 'Timer':
|
||||
return const TimerPage();
|
||||
case 'Workouts':
|
||||
return const WorkoutsPage();
|
||||
case 'Best':
|
||||
return const BestPage();
|
||||
case 'Plans':
|
||||
return PlansPage(search: search);
|
||||
default:
|
||||
return SetList(search: search);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(routes[0]['title']),
|
||||
),
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
drawerEdgeDragWidth: 200.0,
|
||||
drawer: Drawer(
|
||||
child: ListView.builder(
|
||||
itemCount: routes.length,
|
||||
itemBuilder: (context, index) {
|
||||
return ListTile(
|
||||
selected: selected == index,
|
||||
leading: Icon(routes[index]['icon']),
|
||||
title: Text(routes[index]['title']),
|
||||
onTap: () {
|
||||
setState(() {
|
||||
selected = index;
|
||||
});
|
||||
Navigator.pop(context);
|
||||
Navigator.pushNamed(
|
||||
context, '/${routes[index]['title'].toLowerCase()}');
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
body: const Center(
|
||||
child: GymSetPage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class GymSetPage extends StatefulWidget {
|
||||
const GymSetPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
createState() => GymSetPageState();
|
||||
}
|
||||
|
||||
class GymSetPageState extends State<GymSetPage> {
|
||||
late GymSetDatabaseHelper db;
|
||||
List<GymSet> sets = [];
|
||||
|
||||
List<GymSet> searchResults = [];
|
||||
|
||||
final TextEditingController searchController = TextEditingController();
|
||||
|
||||
void search(String searchQuery) {
|
||||
List<GymSet> results = [];
|
||||
|
||||
if (searchQuery.isEmpty) {
|
||||
results = sets;
|
||||
} else {
|
||||
for (int i = 0; i < sets.length; i++) {
|
||||
if (sets[i].reps.toString().contains(searchQuery) ||
|
||||
sets[i].weight.toString().contains(searchQuery) ||
|
||||
sets[i].created.toString().contains(searchQuery) ||
|
||||
sets[i].name.contains(searchQuery)) {
|
||||
results.add(sets[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setState(() {
|
||||
searchResults = results;
|
||||
});
|
||||
}
|
||||
|
||||
void reset() async {
|
||||
print('Resetting...');
|
||||
final data = await db.getAll();
|
||||
setState(() {
|
||||
sets = data;
|
||||
searchResults = data;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
db = GymSetDatabaseHelper.instance;
|
||||
reset();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: TextField(
|
||||
controller: searchController,
|
||||
decoration: const InputDecoration(
|
||||
hintText: 'Search Gym Sets',
|
||||
border: InputBorder.none,
|
||||
),
|
||||
onChanged: (searchQuery) {
|
||||
search(searchQuery);
|
||||
},
|
||||
),
|
||||
),
|
||||
body: ListView.builder(
|
||||
itemCount: searchResults.length,
|
||||
itemBuilder: (context, index) {
|
||||
return ListTile(
|
||||
title: Text(
|
||||
'${searchResults[index].name}: ${searchResults[index].reps}x${searchResults[index].weight}kg'),
|
||||
onTap: () async {
|
||||
await Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) =>
|
||||
EditGymSetPage(gymSet: searchResults[index]),
|
||||
),
|
||||
);
|
||||
reset();
|
||||
title: showSearch
|
||||
? TextField(
|
||||
focusNode: focusNode,
|
||||
cursorColor: Colors.white,
|
||||
onChanged: (String value) {
|
||||
setState(() {
|
||||
search = value;
|
||||
});
|
||||
},
|
||||
decoration: const InputDecoration(
|
||||
hintText: 'Search...',
|
||||
border: InputBorder.none,
|
||||
hintStyle: TextStyle(color: Colors.white),
|
||||
),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: () async {
|
||||
await Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => EditGymSetPage(
|
||||
gymSet: GymSet(
|
||||
name: '',
|
||||
reps: 0,
|
||||
weight: 0,
|
||||
created: DateTime.now())),
|
||||
)
|
||||
: Text(routes[selected]['title']),
|
||||
actions: [
|
||||
IconButton(
|
||||
icon: const Icon(Icons.search),
|
||||
onPressed: toggleSearch,
|
||||
),
|
||||
);
|
||||
reset();
|
||||
},
|
||||
child: const Icon(Icons.add)));
|
||||
],
|
||||
),
|
||||
body: getBody(),
|
||||
),);
|
||||
}
|
||||
}
|
||||
|
||||
+9
-28
@@ -1,45 +1,26 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:fmassive/best_page.dart';
|
||||
import 'package:fmassive/edit_set.dart';
|
||||
import 'package:fmassive/gym_set.dart';
|
||||
import 'package:fmassive/database.dart';
|
||||
import 'package:fmassive/home_page.dart';
|
||||
import 'package:fmassive/plans_page.dart';
|
||||
import 'package:fmassive/settings_page.dart';
|
||||
import 'package:fmassive/timer_page.dart';
|
||||
import 'package:fmassive/workouts_page.dart';
|
||||
|
||||
MyDatabase db = MyDatabase();
|
||||
|
||||
void main() {
|
||||
runApp(MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
MyApp({Key? key}) : super(key: key);
|
||||
MyApp({super.key});
|
||||
|
||||
final navigatorKey = GlobalKey<NavigatorState>();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final edit = EditGymSetPage(
|
||||
gymSet: GymSet(name: '', reps: 0, weight: 0, created: DateTime.now()));
|
||||
|
||||
final Map<String, WidgetBuilder> routes = {
|
||||
'/home': (context) => HomePage(),
|
||||
'/plans': (context) => const PlansPage(),
|
||||
'/best': (context) => const BestPage(),
|
||||
'/workouts': (context) => const WorkoutsPage(),
|
||||
'/timer': (context) => const TimerPage(),
|
||||
'/settings': (context) => const SettingsPage(),
|
||||
'/edit-set': (context) => edit,
|
||||
};
|
||||
|
||||
return MaterialApp(
|
||||
title: 'Gym App',
|
||||
theme: ThemeData(
|
||||
primarySwatch: Colors.blue,
|
||||
visualDensity: VisualDensity.adaptivePlatformDensity,
|
||||
),
|
||||
initialRoute: '/home',
|
||||
routes: routes,
|
||||
title: 'Massive',
|
||||
themeMode: ThemeMode.system,
|
||||
home: const HomePage(),
|
||||
darkTheme: ThemeData.dark(),
|
||||
theme: ThemeData.light(),
|
||||
navigatorKey: navigatorKey,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MassiveDrawer extends StatefulWidget {
|
||||
final Widget body;
|
||||
final PreferredSizeWidget appBar;
|
||||
|
||||
const MassiveDrawer({super.key, required this.body, required this.appBar});
|
||||
|
||||
@override
|
||||
createState() => _MassiveDrawer();
|
||||
}
|
||||
|
||||
class _MassiveDrawer extends State<MassiveDrawer> {
|
||||
final List<Map<String, dynamic>> routes = [
|
||||
{'title': 'Home', 'icon': Icons.home},
|
||||
{'title': 'Plans', 'icon': Icons.calendar_today},
|
||||
{'title': 'Best', 'icon': Icons.star},
|
||||
{'title': 'Workouts', 'icon': Icons.fitness_center},
|
||||
{'title': 'Timer', 'icon': Icons.timer},
|
||||
{'title': 'Settings', 'icon': Icons.settings},
|
||||
];
|
||||
int selected = 0;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: widget.body,
|
||||
appBar: widget.appBar,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:fmassive/constants.dart';
|
||||
import 'package:fmassive/database.dart';
|
||||
import 'package:fmassive/plan_tile.dart';
|
||||
|
||||
class PlanList extends StatelessWidget {
|
||||
const PlanList({
|
||||
super.key,
|
||||
required this.plans,
|
||||
});
|
||||
|
||||
final List<Plan> plans;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final weekday = weekdayNames[DateTime.now().weekday - 1];
|
||||
|
||||
return ListView.builder(
|
||||
itemCount: plans.length,
|
||||
itemBuilder: (context, index) {
|
||||
return PlanTile(plan: plans[index], weekday: weekday);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:fmassive/database.dart';
|
||||
import 'package:fmassive/edit_plan.dart';
|
||||
import 'package:fmassive/main.dart';
|
||||
import 'package:fmassive/start_plan.dart';
|
||||
import 'package:moor_flutter/moor_flutter.dart';
|
||||
|
||||
class PlanTile extends StatelessWidget {
|
||||
PlanTile({
|
||||
super.key,
|
||||
required this.plan,
|
||||
required this.weekday,
|
||||
});
|
||||
|
||||
final Plan plan;
|
||||
final String weekday;
|
||||
final tapPosition = GlobalKey();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MenuAnchor(
|
||||
menuChildren: [
|
||||
MenuItemButton(
|
||||
child: const Text("Edit"),
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) =>
|
||||
EditPlanPage(plan: plan.toCompanion(false)),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
MenuItemButton(
|
||||
onPressed: () async {
|
||||
await db.plans.deleteOne(plan);
|
||||
},
|
||||
child: const Text("Delete"),
|
||||
),
|
||||
],
|
||||
builder: (context, controller, child) {
|
||||
return ListTile(
|
||||
title: Text(
|
||||
plan.days.replaceAll(',', ', '),
|
||||
style: TextStyle(
|
||||
fontWeight: plan.days.contains(weekday) ? FontWeight.bold : null,
|
||||
decoration:
|
||||
plan.days.contains(weekday) ? TextDecoration.underline : null,
|
||||
),
|
||||
),
|
||||
subtitle: Text(plan.exercises),
|
||||
onLongPress: () {
|
||||
controller.open();
|
||||
},
|
||||
onTap: () async {
|
||||
await Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => StartPlan(plan: plan.toCompanion(false)),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import 'package:moor/moor.dart';
|
||||
|
||||
class Plans extends Table {
|
||||
IntColumn get id => integer().autoIncrement()();
|
||||
TextColumn get days => text()();
|
||||
TextColumn get exercises => text()();
|
||||
}
|
||||
+85
-6
@@ -1,17 +1,96 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:fmassive/database.dart';
|
||||
import 'package:fmassive/edit_plan.dart';
|
||||
import 'package:fmassive/main.dart';
|
||||
import 'package:fmassive/plan_list.dart';
|
||||
import 'package:moor/moor.dart';
|
||||
|
||||
class PlansPage extends StatelessWidget {
|
||||
const PlansPage({super.key});
|
||||
const PlansPage({super.key, required this.search});
|
||||
|
||||
final String search;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Plans'),
|
||||
),
|
||||
body: const Center(
|
||||
child: Text('Welcome to the Plans Page!'),
|
||||
body: Center(
|
||||
child: _PlansPage(search: search),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _PlansPage extends StatefulWidget {
|
||||
const _PlansPage({required this.search});
|
||||
|
||||
final String search;
|
||||
|
||||
@override
|
||||
createState() => _PlansPageState();
|
||||
}
|
||||
|
||||
class _PlansPageState extends State<_PlansPage> {
|
||||
bool showSearch = false;
|
||||
late Stream<List<Plan>> stream;
|
||||
|
||||
@override
|
||||
initState() {
|
||||
super.initState();
|
||||
setStream();
|
||||
}
|
||||
|
||||
void setStream() {
|
||||
stream = (db.select(db.plans)
|
||||
..where((gymSet) => gymSet.days.contains(widget.search))
|
||||
..limit(10, offset: 0))
|
||||
.watch();
|
||||
}
|
||||
|
||||
@override
|
||||
didUpdateWidget(covariant _PlansPage oldWidget) {
|
||||
super.didUpdateWidget(oldWidget);
|
||||
setStream();
|
||||
}
|
||||
|
||||
void toggleSearch() {
|
||||
setState(() {
|
||||
showSearch = !showSearch;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: StreamBuilder<List<Plan>>(
|
||||
stream: stream,
|
||||
builder: (context, snapshot) {
|
||||
final plans = snapshot.data;
|
||||
|
||||
if (snapshot.hasError)
|
||||
return Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Text(
|
||||
'Error: ${snapshot.error}',
|
||||
style: Theme.of(context).textTheme.headlineSmall,
|
||||
),),
|
||||
);
|
||||
|
||||
if (plans == null) return Container();
|
||||
|
||||
return PlanList(plans: plans);
|
||||
},),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: () async {
|
||||
await Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => const EditPlanPage(
|
||||
plan: PlansCompanion(
|
||||
days: Value(''), exercises: Value(''),),),
|
||||
),
|
||||
);
|
||||
},
|
||||
child: const Icon(Icons.add),),);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:fmassive/database.dart';
|
||||
import 'package:fmassive/edit_set.dart';
|
||||
import 'package:fmassive/main.dart';
|
||||
import 'package:fmassive/set_tile.dart';
|
||||
import 'package:infinite_scroll_pagination/infinite_scroll_pagination.dart';
|
||||
import 'package:moor_flutter/moor_flutter.dart';
|
||||
|
||||
class SetList extends StatefulWidget {
|
||||
final String search;
|
||||
|
||||
const SetList({super.key, required this.search});
|
||||
|
||||
@override
|
||||
createState() => _SetList();
|
||||
}
|
||||
|
||||
class _SetList extends State<SetList> {
|
||||
bool showSearch = false;
|
||||
final PagingController<int, GymSet> pagingController =
|
||||
PagingController(firstPageKey: 0);
|
||||
|
||||
@override
|
||||
initState() {
|
||||
super.initState();
|
||||
pagingController.addPageRequestListener((pageKey) {
|
||||
fetch(pageKey);
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
didUpdateWidget(covariant SetList oldWidget) {
|
||||
super.didUpdateWidget(oldWidget);
|
||||
pagingController.refresh();
|
||||
}
|
||||
|
||||
Future<void> fetch(int pageKey) async {
|
||||
final gymSets = await (db.select(db.gymSets)
|
||||
..where((gymSet) => gymSet.name.contains(widget.search))
|
||||
..orderBy([
|
||||
(u) => OrderingTerm(expression: u.created, mode: OrderingMode.desc),
|
||||
])
|
||||
..limit(10, offset: pageKey * 10))
|
||||
.get();
|
||||
|
||||
final isLastPage = gymSets.length < 10;
|
||||
|
||||
if (isLastPage) {
|
||||
pagingController.appendLastPage(gymSets);
|
||||
} else {
|
||||
final nextPageKey = pageKey + 1;
|
||||
pagingController.appendPage(gymSets, nextPageKey);
|
||||
}
|
||||
}
|
||||
|
||||
void toggleSearch() {
|
||||
setState(() {
|
||||
showSearch = !showSearch;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: PagedListView<int, GymSet>(
|
||||
pagingController: pagingController,
|
||||
builderDelegate: PagedChildBuilderDelegate<GymSet>(
|
||||
itemBuilder: (context, gymSet, index) => SetTile(
|
||||
pagingController: pagingController,
|
||||
gymSet: gymSet,
|
||||
),
|
||||
),
|
||||
),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: () async {
|
||||
await Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => const EditGymSetPage(
|
||||
gymSet: GymSetsCompanion(
|
||||
name: Value(''),
|
||||
reps: Value(0),
|
||||
weight: Value(0),
|
||||
image: Value(''),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
pagingController.refresh();
|
||||
},
|
||||
child: const Icon(Icons.add),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:fmassive/database.dart';
|
||||
import 'package:fmassive/edit_set.dart';
|
||||
import 'package:fmassive/main.dart';
|
||||
import 'package:infinite_scroll_pagination/infinite_scroll_pagination.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:moor/moor.dart';
|
||||
|
||||
class SetTile extends StatelessWidget {
|
||||
const SetTile({
|
||||
super.key,
|
||||
required this.pagingController,
|
||||
required this.gymSet,
|
||||
});
|
||||
|
||||
final PagingController<int, GymSet> pagingController;
|
||||
final GymSet gymSet;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListTile(
|
||||
title: Text(gymSet.name),
|
||||
subtitle: Text(DateFormat("yyyy-MM-dd HH:mm")
|
||||
.format(DateTime.parse(gymSet.created)),),
|
||||
trailing: Text("${gymSet.reps} x ${gymSet.weight}kg"),
|
||||
onTap: () async {
|
||||
await Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => EditGymSetPage(
|
||||
gymSet: gymSet.toCompanion(false),
|
||||
),
|
||||
),
|
||||
);
|
||||
pagingController.refresh();
|
||||
},
|
||||
onLongPress: () => showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
title: const Text('Delete set'),
|
||||
content: Text(
|
||||
'Are you sure you want to delete ${gymSet.name} ${gymSet.reps}x${gymSet.weight}${gymSet.unit}?',),
|
||||
actions: <Widget>[
|
||||
ElevatedButton(
|
||||
child: const Text('Cancel'),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
ElevatedButton(
|
||||
child: const Text('Delete'),
|
||||
onPressed: () async {
|
||||
final navigator = Navigator.of(context);
|
||||
await db.gymSets.deleteOne(gymSet);
|
||||
pagingController.refresh();
|
||||
navigator.pop();
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
import 'package:fmassive/database.dart';
|
||||
import 'package:moor/moor.dart';
|
||||
|
||||
Setting defaultSettings = Setting(
|
||||
alarm: true,
|
||||
vibrate: true,
|
||||
sound: null,
|
||||
notify: true,
|
||||
images: true,
|
||||
showUnit: true,
|
||||
lightColor: null,
|
||||
darkColor: null,
|
||||
steps: true,
|
||||
date: 'DD/MM/YYYY',
|
||||
showDate: true,
|
||||
theme: 'light',
|
||||
showSets: true,
|
||||
noSound: false,
|
||||
backup: false,
|
||||
);
|
||||
|
||||
class Settings extends Table {
|
||||
BoolColumn get alarm => boolean()();
|
||||
BoolColumn get backup => boolean().nullable()();
|
||||
TextColumn get darkColor => text().nullable()();
|
||||
TextColumn get date => text().nullable()();
|
||||
BoolColumn get images => boolean().nullable()();
|
||||
TextColumn get lightColor => text().nullable()();
|
||||
BoolColumn get noSound => boolean().nullable()();
|
||||
BoolColumn get notify => boolean().nullable()();
|
||||
BoolColumn get showDate => boolean().nullable()();
|
||||
BoolColumn get showSets => boolean().nullable()();
|
||||
BoolColumn get showUnit => boolean().nullable()();
|
||||
TextColumn get sound => text().nullable()();
|
||||
BoolColumn get steps => boolean().nullable()();
|
||||
TextColumn get theme => text().nullable()();
|
||||
BoolColumn get vibrate => boolean()();
|
||||
}
|
||||
+171
-6
@@ -1,16 +1,181 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:csv/csv.dart';
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/material.dart' as material;
|
||||
import 'package:fmassive/database.dart';
|
||||
import 'package:fmassive/delete_all_sets.dart';
|
||||
import 'package:fmassive/main.dart';
|
||||
import 'package:fmassive/sound_picker.dart';
|
||||
import 'package:moor/moor.dart';
|
||||
|
||||
class SettingsPage extends StatelessWidget {
|
||||
const SettingsPage({super.key});
|
||||
const SettingsPage({super.key, required this.search});
|
||||
|
||||
final String search;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Settings'),
|
||||
),
|
||||
body: const Center(
|
||||
child: Text('Welcome to the Settings Page!'),
|
||||
body: Center(
|
||||
child: _SettingsPage(search: search),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _SettingsPage extends StatefulWidget {
|
||||
const _SettingsPage({required this.search});
|
||||
|
||||
final String search;
|
||||
|
||||
@override
|
||||
createState() => _SettingsPageState();
|
||||
}
|
||||
|
||||
class _SettingsPageState extends State<_SettingsPage> {
|
||||
late Stream<Setting> stream;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
stream = (db.select(db.settings)..limit(1)).watchSingle();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: StreamBuilder<Setting>(
|
||||
stream: stream,
|
||||
builder: (context, snapshot) {
|
||||
final settings = snapshot.data;
|
||||
print('build: $settings');
|
||||
|
||||
if (settings == null) return Container();
|
||||
|
||||
final filteredItems = [
|
||||
{'title': 'Alarm', 'value': settings.alarm},
|
||||
{'title': 'Vibrate', 'value': settings.vibrate},
|
||||
{'title': 'Notify', 'value': settings.notify},
|
||||
{'title': 'Images', 'value': settings.images},
|
||||
{'title': 'Show Unit', 'value': settings.showUnit},
|
||||
{'title': 'Steps', 'value': settings.steps},
|
||||
{'title': 'Sound', 'value': settings.sound},
|
||||
{'title': 'Import sets', 'value': null},
|
||||
{'title': 'Delete all sets', 'value': null},
|
||||
]
|
||||
.where((item) => (item['title'] as String)
|
||||
.toLowerCase()
|
||||
.contains(widget.search.toLowerCase()),)
|
||||
.toList();
|
||||
|
||||
return material.Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: ListView.builder(
|
||||
itemCount: filteredItems.length,
|
||||
itemBuilder: (context, index) {
|
||||
final item = filteredItems[index];
|
||||
|
||||
if (item['title'] == 'Delete all sets')
|
||||
return DeleteAllSets(mounted: mounted);
|
||||
|
||||
if (item['title'] == 'Import sets')
|
||||
return Center(
|
||||
child: ElevatedButton(
|
||||
child: const Text("Import sets"),
|
||||
onPressed: () async {
|
||||
final result = await FilePicker.platform.pickFiles(
|
||||
type: FileType.custom,
|
||||
allowedExtensions: ['csv'],);
|
||||
if (result == null) return;
|
||||
|
||||
final file = File(result.files.single.path!);
|
||||
final input = file.openRead();
|
||||
final fields = await input
|
||||
.transform(utf8.decoder)
|
||||
.transform(const CsvToListConverter(eol: "\n"))
|
||||
.skip(1)
|
||||
.toList();
|
||||
final gymSets = fields.map((row) => GymSetsCompanion(
|
||||
id: Value(int.tryParse(row[0]) ?? 0),
|
||||
name: Value(row[1]),
|
||||
reps: Value(int.tryParse(row[2]) ?? 0),
|
||||
weight: Value(double.tryParse(row[3]) ?? 0),
|
||||
created: Value(row[4]),
|
||||
unit: Value(row[5]),
|
||||
hidden: Value(row[6] == 'true'),
|
||||
image: Value(row[7]),
|
||||
sets: Value(int.tryParse(row[8]) ?? 0),
|
||||
minutes: Value(int.tryParse(row[9]) ?? 0),
|
||||
seconds: Value(int.tryParse(row[10]) ?? 0),
|
||||
steps: Value(row[11]),
|
||||
),);
|
||||
await db.batch(
|
||||
(batch) => batch.insertAll(db.gymSets, gymSets),);
|
||||
if (!mounted) return;
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text('Imported sets')),);
|
||||
},
|
||||
),);
|
||||
|
||||
if (item['title'] == 'Sound') {
|
||||
return Center(
|
||||
child: SoundPicker(
|
||||
path: settings.sound,
|
||||
onSelect: (path) {
|
||||
db
|
||||
.update(db.settings)
|
||||
.write(SettingsCompanion(sound: Value(path)));
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return SwitchListTile(
|
||||
title: Text(item['title'].toString()),
|
||||
value: (item['value'] ?? false) as bool,
|
||||
onChanged: (value) {
|
||||
switch (item['title']) {
|
||||
case 'Alarm':
|
||||
db
|
||||
.update(db.settings)
|
||||
.write(SettingsCompanion(alarm: Value(value)));
|
||||
break;
|
||||
case 'Vibrate':
|
||||
db.update(db.settings).write(
|
||||
SettingsCompanion(vibrate: Value(value)),);
|
||||
break;
|
||||
case 'Notify':
|
||||
db
|
||||
.update(db.settings)
|
||||
.write(SettingsCompanion(notify: Value(value)));
|
||||
break;
|
||||
case 'Images':
|
||||
db
|
||||
.update(db.settings)
|
||||
.write(SettingsCompanion(images: Value(value)));
|
||||
break;
|
||||
case 'Show Unit':
|
||||
db.update(db.settings).write(
|
||||
SettingsCompanion(showUnit: Value(value)),);
|
||||
break;
|
||||
case 'Steps':
|
||||
db
|
||||
.update(db.settings)
|
||||
.write(SettingsCompanion(steps: Value(value)));
|
||||
break;
|
||||
}
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
import 'package:audioplayers/audioplayers.dart';
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:path/path.dart';
|
||||
|
||||
class SoundPicker extends StatefulWidget {
|
||||
const SoundPicker({super.key, required this.onSelect, required this.path});
|
||||
|
||||
final Function(String path) onSelect;
|
||||
final String? path;
|
||||
|
||||
@override
|
||||
createState() => _SoundPickerState();
|
||||
}
|
||||
|
||||
class _SoundPickerState extends State<SoundPicker> {
|
||||
final audioPlayer = AudioPlayer();
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
audioPlayer.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ElevatedButton(
|
||||
onPressed: () async {
|
||||
FilePickerResult? result = await FilePicker.platform.pickFiles(
|
||||
type: FileType.audio,
|
||||
);
|
||||
if (result == null) return;
|
||||
final path = result.files.first.path;
|
||||
if (path == null) return;
|
||||
await audioPlayer.play(DeviceFileSource(path));
|
||||
widget.onSelect(path);
|
||||
},
|
||||
child: Text(widget.path != null
|
||||
? "Sound: ${basename(widget.path!)}"
|
||||
: 'Alarm sound',),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,222 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/material.dart' as material;
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:fmassive/database.dart';
|
||||
import 'package:fmassive/main.dart';
|
||||
import 'package:moor_flutter/moor_flutter.dart';
|
||||
|
||||
class StartPlan extends StatefulWidget {
|
||||
final PlansCompanion plan;
|
||||
|
||||
const StartPlan({required this.plan, super.key});
|
||||
|
||||
@override
|
||||
createState() => _StartPlanState();
|
||||
}
|
||||
|
||||
class _StartPlanState extends State<StartPlan> {
|
||||
late List<String> exercises;
|
||||
List<int> counts = [];
|
||||
List<int> totals = [];
|
||||
int selectedExercise = 0;
|
||||
final repsController = TextEditingController();
|
||||
final repsNode = FocusNode();
|
||||
final weightController = TextEditingController();
|
||||
final weightNode = FocusNode();
|
||||
int current = 0;
|
||||
int minutes = 3;
|
||||
int seconds = 30;
|
||||
Timer? timer;
|
||||
|
||||
void startTimer() {
|
||||
setState(() {
|
||||
current = minutes * 60 * 1000 + seconds * 1000;
|
||||
});
|
||||
timer = Timer.periodic(const Duration(seconds: 1), (timer) {
|
||||
print("StartPlan: current=$current");
|
||||
if (current == 0)
|
||||
setState(() {
|
||||
timer.cancel();
|
||||
});
|
||||
else
|
||||
setState(() {
|
||||
current -= 1000;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> getTotals() async {
|
||||
final query = await (db.selectOnly(db.gymSets)
|
||||
..addColumns([db.gymSets.name, db.gymSets.sets])
|
||||
..where(db.gymSets.name.isIn(exercises))
|
||||
..groupBy([db.gymSets.name, db.gymSets.sets]))
|
||||
.map(
|
||||
(row) =>
|
||||
MapEntry(row.read(db.gymSets.name), row.read(db.gymSets.sets)),
|
||||
)
|
||||
.get();
|
||||
final map = Map.fromIterables(
|
||||
query.map((entry) => entry.key),
|
||||
query.map((entry) => entry.value),
|
||||
);
|
||||
setState(() {
|
||||
totals = [];
|
||||
for (var exercise in exercises) {
|
||||
totals.add(map[exercise] ?? 0);
|
||||
}
|
||||
});
|
||||
print("totals=$totals");
|
||||
}
|
||||
|
||||
Future<void> getCounts() async {
|
||||
var countExp = db.gymSets.name.count();
|
||||
final today = DateTime.now().toIso8601String().split('T')[0];
|
||||
final query = await (db.selectOnly(db.gymSets)
|
||||
..addColumns([countExp, db.gymSets.name])
|
||||
..where(db.gymSets.created.contains(today))
|
||||
..groupBy([db.gymSets.name]))
|
||||
.map((row) => MapEntry(row.read(db.gymSets.name), row.read(countExp)))
|
||||
.get();
|
||||
final map = Map.fromIterables(
|
||||
query.map((entry) => entry.key),
|
||||
query.map((entry) => entry.value),
|
||||
);
|
||||
setState(() {
|
||||
counts = [];
|
||||
for (var exercise in exercises) {
|
||||
counts.add(map[exercise] ?? 0);
|
||||
}
|
||||
});
|
||||
print("counts=$counts");
|
||||
}
|
||||
|
||||
Future<void> focus(int index) async {
|
||||
final name = exercises[index];
|
||||
final sets = await (db.gymSets.select()
|
||||
..where((gymSet) => gymSet.name.contains(name))
|
||||
..orderBy([
|
||||
(u) => OrderingTerm(expression: u.created, mode: OrderingMode.desc),
|
||||
])
|
||||
..limit(1))
|
||||
.get();
|
||||
final firstSet = sets.first;
|
||||
setState(() {
|
||||
repsController.text = firstSet.reps.toString();
|
||||
repsController.selection = TextSelection(
|
||||
baseOffset: 0,
|
||||
extentOffset: firstSet.reps.toString().length,
|
||||
);
|
||||
weightController.text = firstSet.weight.toString();
|
||||
minutes = firstSet.minutes;
|
||||
seconds = firstSet.seconds;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
exercises = widget.plan.exercises.value.split(',');
|
||||
repsNode.requestFocus();
|
||||
getCounts();
|
||||
getTotals();
|
||||
focus(selectedExercise);
|
||||
}
|
||||
|
||||
@override
|
||||
dispose() {
|
||||
super.dispose();
|
||||
timer?.cancel();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (totals.isEmpty || counts.isEmpty) return Container();
|
||||
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(title: const Text('Start plan')),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: material.Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: ListView.builder(
|
||||
itemBuilder: ((context, index) {
|
||||
return ListTile(
|
||||
title: Text(exercises[index]),
|
||||
subtitle: Text("${counts[index]}/${totals[index]}"),
|
||||
onTap: () {
|
||||
setState(() {
|
||||
selectedExercise = index;
|
||||
focus(index);
|
||||
});
|
||||
},
|
||||
leading: Radio<int>(
|
||||
value: index,
|
||||
groupValue: selectedExercise,
|
||||
onChanged: (value) {
|
||||
print("onChanged $value");
|
||||
if (value == null) return;
|
||||
setState(() {
|
||||
selectedExercise = value;
|
||||
focus(index);
|
||||
});
|
||||
},
|
||||
),
|
||||
);
|
||||
}),
|
||||
itemCount: exercises.length,
|
||||
),
|
||||
),
|
||||
TextFormField(
|
||||
decoration: const InputDecoration(labelText: 'Reps'),
|
||||
controller: repsController,
|
||||
focusNode: repsNode,
|
||||
onTap: () {
|
||||
repsController.selection = TextSelection(
|
||||
baseOffset: 0,
|
||||
extentOffset: repsController.text.length,
|
||||
);
|
||||
},
|
||||
),
|
||||
TextFormField(
|
||||
decoration: const InputDecoration(labelText: 'Weight'),
|
||||
controller: weightController,
|
||||
focusNode: weightNode,
|
||||
onTap: () {
|
||||
weightController.selection = TextSelection(
|
||||
baseOffset: 0,
|
||||
extentOffset: weightController.text.length,
|
||||
);
|
||||
},
|
||||
),
|
||||
LinearProgressIndicator(
|
||||
value: current / (minutes * 60 * 1000 + seconds * 1000),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: () async {
|
||||
final gymSet = GymSetsCompanion(
|
||||
created: Value(DateTime.now().toIso8601String()),
|
||||
name: Value(exercises[selectedExercise]),
|
||||
reps: Value(int.tryParse(repsController.text) ?? 0),
|
||||
weight: Value(double.tryParse(weightController.text) ?? 0),
|
||||
);
|
||||
await db.into(db.gymSets).insert(gymSet);
|
||||
const platform = MethodChannel('com.massive/android');
|
||||
platform
|
||||
.invokeMethod('timer', [minutes * 60 * 1000 + seconds * 1000]);
|
||||
startTimer();
|
||||
await getCounts();
|
||||
},
|
||||
child: const Icon(Icons.check),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,14 @@
|
||||
|
||||
#include "generated_plugin_registrant.h"
|
||||
|
||||
#include <audioplayers_linux/audioplayers_linux_plugin.h>
|
||||
#include <sqlite3_flutter_libs/sqlite3_flutter_libs_plugin.h>
|
||||
|
||||
void fl_register_plugins(FlPluginRegistry* registry) {
|
||||
g_autoptr(FlPluginRegistrar) audioplayers_linux_registrar =
|
||||
fl_plugin_registry_get_registrar_for_plugin(registry, "AudioplayersLinuxPlugin");
|
||||
audioplayers_linux_plugin_register_with_registrar(audioplayers_linux_registrar);
|
||||
g_autoptr(FlPluginRegistrar) sqlite3_flutter_libs_registrar =
|
||||
fl_plugin_registry_get_registrar_for_plugin(registry, "Sqlite3FlutterLibsPlugin");
|
||||
sqlite3_flutter_libs_plugin_register_with_registrar(sqlite3_flutter_libs_registrar);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
#
|
||||
|
||||
list(APPEND FLUTTER_PLUGIN_LIST
|
||||
audioplayers_linux
|
||||
sqlite3_flutter_libs
|
||||
)
|
||||
|
||||
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
||||
|
||||
@@ -5,8 +5,14 @@
|
||||
import FlutterMacOS
|
||||
import Foundation
|
||||
|
||||
import audioplayers_darwin
|
||||
import path_provider_foundation
|
||||
import sqflite
|
||||
import sqlite3_flutter_libs
|
||||
|
||||
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||
AudioplayersDarwinPlugin.register(with: registry.registrar(forPlugin: "AudioplayersDarwinPlugin"))
|
||||
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
||||
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
|
||||
Sqlite3FlutterLibsPlugin.register(with: registry.registrar(forPlugin: "Sqlite3FlutterLibsPlugin"))
|
||||
}
|
||||
|
||||
+719
-34
@@ -1,14 +1,102 @@
|
||||
# Generated by pub
|
||||
# See https://dart.dev/tools/pub/glossary#lockfile
|
||||
packages:
|
||||
_fe_analyzer_shared:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: _fe_analyzer_shared
|
||||
sha256: "4897882604d919befd350648c7f91926a9d5de99e67b455bf0917cc2362f4bb8"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "47.0.0"
|
||||
analyzer:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: analyzer
|
||||
sha256: "690e335554a8385bc9d787117d9eb52c0c03ee207a607e593de3c9d71b1cfe80"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.7.0"
|
||||
analyzer_plugin:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: analyzer_plugin
|
||||
sha256: "02b0046b8b9a4c97a238c66f70acd22eec4263dfc8d9205f9dab5cc8630c5a6f"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.11.1"
|
||||
args:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: args
|
||||
sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.4.2"
|
||||
async:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: async
|
||||
sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0
|
||||
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.10.0"
|
||||
version: "2.11.0"
|
||||
audioplayers:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: audioplayers
|
||||
sha256: d9f6ca8e9b3e5af5e73d4c814404566f72698ee7ba35487bdf2baa6749e7503f
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.2.0"
|
||||
audioplayers_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: audioplayers_android
|
||||
sha256: fb01b9481f431fe04ac60f1f97ce8158383f2dc754558820592f795d81ca9d53
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.0.2"
|
||||
audioplayers_darwin:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: audioplayers_darwin
|
||||
sha256: "3034e99a6df8d101da0f5082dcca0a2a99db62ab1d4ddb3277bed3f6f81afe08"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.0.2"
|
||||
audioplayers_linux:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: audioplayers_linux
|
||||
sha256: "60787e73fefc4d2e0b9c02c69885402177e818e4e27ef087074cf27c02246c9e"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.1.0"
|
||||
audioplayers_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: audioplayers_platform_interface
|
||||
sha256: "365c547f1bb9e77d94dd1687903a668d8f7ac3409e48e6e6a3668a1ac2982adb"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.1.0"
|
||||
audioplayers_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: audioplayers_web
|
||||
sha256: "22cd0173e54d92bd9b2c80b1204eb1eb159ece87475ab58c9788a70ec43c2a62"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.1.0"
|
||||
audioplayers_windows:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: audioplayers_windows
|
||||
sha256: "9536812c9103563644ada2ef45ae523806b0745f7a78e89d1b5fb1951de90e1a"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.1.0"
|
||||
boolean_selector:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -17,14 +105,102 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.1"
|
||||
build:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: build
|
||||
sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.4.1"
|
||||
build_config:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: build_config
|
||||
sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.1"
|
||||
build_daemon:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: build_daemon
|
||||
sha256: "0343061a33da9c5810b2d6cee51945127d8f4c060b7fbdd9d54917f0a3feaaa1"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.0.1"
|
||||
build_resolvers:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: build_resolvers
|
||||
sha256: "687cf90a3951affac1bd5f9ecb5e3e90b60487f3d9cdc359bb310f8876bb02a6"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.10"
|
||||
build_runner:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: build_runner
|
||||
sha256: "10c6bcdbf9d049a0b666702cf1cee4ddfdc38f02a19d35ae392863b47519848b"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.4.6"
|
||||
build_runner_core:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: build_runner_core
|
||||
sha256: "6d6ee4276b1c5f34f21fdf39425202712d2be82019983d52f351c94aafbc2c41"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "7.2.10"
|
||||
built_collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: built_collection
|
||||
sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.1.1"
|
||||
built_value:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: built_value
|
||||
sha256: "723b4021e903217dfc445ec4cf5b42e27975aece1fc4ebbc1ca6329c2d9fb54e"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "8.7.0"
|
||||
characters:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: characters
|
||||
sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c
|
||||
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.1"
|
||||
version: "1.3.0"
|
||||
charcode:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: charcode
|
||||
sha256: fb98c0f6d12c920a02ee2d998da788bca066ca5f148492b7085ee23372b12306
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.3.1"
|
||||
checked_yaml:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: checked_yaml
|
||||
sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.3"
|
||||
cli_util:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: cli_util
|
||||
sha256: "66f86e916d285c1a93d3b79587d94bd71984a66aac4ff74e524cfa7877f1395c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.3.5"
|
||||
clock:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -33,22 +209,78 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.1"
|
||||
code_builder:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: code_builder
|
||||
sha256: "1be9be30396d7e4c0db42c35ea6ccd7cc6a1e19916b5dc64d6ac216b5544d677"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.7.0"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: collection
|
||||
sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0
|
||||
sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.17.0"
|
||||
version: "1.17.2"
|
||||
convert:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: convert
|
||||
sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.1.1"
|
||||
crypto:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: crypto
|
||||
sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.3"
|
||||
csv:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: csv
|
||||
sha256: "63ed2871dd6471193dffc52c0e6c76fb86269c00244d244297abbb355c84a86e"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.1.1"
|
||||
cupertino_icons:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: cupertino_icons
|
||||
sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be
|
||||
sha256: d57953e10f9f8327ce64a508a355f0b1ec902193f66288e8cb5070e7c47eeb2d
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.5"
|
||||
version: "1.0.6"
|
||||
dart_style:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: dart_style
|
||||
sha256: "7a03456c3490394c8e7665890333e91ae8a49be43542b616e414449ac358acd4"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.2.4"
|
||||
drift:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: drift
|
||||
sha256: "43ae515270f38ffe47702dc920c04d415894bcc6ebdf3e2b6a292cb207ed8cb7"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.7.1"
|
||||
drift_dev:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: drift_dev
|
||||
sha256: "7d51538da971823a158236823cfb299731f720cd55078c6a478bfa4effb69275"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.7.1"
|
||||
fake_async:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -57,6 +289,38 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.3.1"
|
||||
ffi:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: ffi
|
||||
sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
file:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: file
|
||||
sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.1.4"
|
||||
file_picker:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: file_picker
|
||||
sha256: "4e42aacde3b993c5947467ab640882c56947d9d27342a5b6f2895b23956954a6"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.1.1"
|
||||
fixnum:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: fixnum
|
||||
sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
flutter:
|
||||
dependency: "direct main"
|
||||
description: flutter
|
||||
@@ -66,92 +330,433 @@ packages:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: flutter_lints
|
||||
sha256: aeb0b80a8b3709709c9cc496cdc027c5b3216796bc0af0ce1007eaf24464fd4c
|
||||
sha256: e2a421b7e59244faef694ba7b30562e489c2b489866e505074eb005cd7060db7
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.1"
|
||||
version: "3.0.1"
|
||||
flutter_plugin_android_lifecycle:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_plugin_android_lifecycle
|
||||
sha256: b068ffc46f82a55844acfa4fdbb61fad72fa2aef0905548419d97f0f95c456da
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.17"
|
||||
flutter_staggered_grid_view:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_staggered_grid_view
|
||||
sha256: "19e7abb550c96fbfeb546b23f3ff356ee7c59a019a651f8f102a4ba9b7349395"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.7.0"
|
||||
flutter_test:
|
||||
dependency: "direct dev"
|
||||
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:
|
||||
name: frontend_server_client
|
||||
sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.2.0"
|
||||
glob:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: glob
|
||||
sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.2"
|
||||
graphs:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: graphs
|
||||
sha256: aedc5a15e78fc65a6e23bcd927f24c64dd995062bcd1ca6eda65a3cff92a4d19
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.3.1"
|
||||
http:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: http
|
||||
sha256: "5895291c13fa8a3bd82e76d5627f69e0d85ca6a30dcac95c4ea19a5d555879c2"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.13.6"
|
||||
http_multi_server:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: http_multi_server
|
||||
sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.2.1"
|
||||
http_parser:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: http_parser
|
||||
sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.0.2"
|
||||
infinite_scroll_pagination:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: infinite_scroll_pagination
|
||||
sha256: b68bce20752fcf36c7739e60de4175494f74e99e9a69b4dd2fe3a1dd07a7f16a
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.0.0"
|
||||
intl:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: intl
|
||||
sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.18.1"
|
||||
io:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: io
|
||||
sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.4"
|
||||
js:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: js
|
||||
sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7"
|
||||
sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.6.5"
|
||||
version: "0.6.7"
|
||||
json_annotation:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: json_annotation
|
||||
sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.8.1"
|
||||
lints:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: lints
|
||||
sha256: "5e4a9cd06d447758280a8ac2405101e0e2094d2a1dbdd3756aec3fe7775ba593"
|
||||
sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.1"
|
||||
version: "3.0.0"
|
||||
logging:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: logging
|
||||
sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
matcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: matcher
|
||||
sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72"
|
||||
sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.12.13"
|
||||
version: "0.12.16"
|
||||
material_color_utilities:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: material_color_utilities
|
||||
sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724
|
||||
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.2.0"
|
||||
version: "0.5.0"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: meta
|
||||
sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42"
|
||||
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.8.0"
|
||||
version: "1.9.1"
|
||||
mime:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: mime
|
||||
sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.4"
|
||||
moor:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: moor
|
||||
sha256: "3c9500ebb0996592480728a5480e020c881110597416b9f3c6f72e57212bd78c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.6.1+1"
|
||||
moor_flutter:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: moor_flutter
|
||||
sha256: "337babe6977103a765d01a838b5d166483eff0a6a83ad5f997761c247f428cdf"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.1.0"
|
||||
moor_generator:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: moor_generator
|
||||
sha256: "511df4d32bc6150456024592e4839fb868eda96b49d8c3515e30781eec6bc31d"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.6.0+1"
|
||||
package_config:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: package_config
|
||||
sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
path:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: path
|
||||
sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b
|
||||
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.8.2"
|
||||
version: "1.8.3"
|
||||
path_provider:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: path_provider
|
||||
sha256: a1aa8aaa2542a6bc57e381f132af822420216c80d4781f7aa085ca3229208aaa
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.1"
|
||||
path_provider_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path_provider_android
|
||||
sha256: e595b98692943b4881b219f0a9e3945118d3c16bd7e2813f98ec6e532d905f72
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.2.1"
|
||||
path_provider_foundation:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path_provider_foundation
|
||||
sha256: "19314d595120f82aca0ba62787d58dde2cc6b5df7d2f0daf72489e38d1b57f2d"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.3.1"
|
||||
path_provider_linux:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path_provider_linux
|
||||
sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.2.1"
|
||||
path_provider_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path_provider_platform_interface
|
||||
sha256: "94b1e0dd80970c1ce43d5d4e050a9918fce4f4a775e6142424c30a29a363265c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.1"
|
||||
path_provider_windows:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path_provider_windows
|
||||
sha256: "8bc9f22eee8690981c22aa7fc602f5c85b497a6fb2ceb35ee5a5e5ed85ad8170"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.2.1"
|
||||
permission_handler:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: permission_handler
|
||||
sha256: "284a66179cabdf942f838543e10413246f06424d960c92ba95c84439154fcac8"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "11.0.1"
|
||||
permission_handler_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: permission_handler_android
|
||||
sha256: f9fddd3b46109bd69ff3f9efa5006d2d309b7aec0f3c1c5637a60a2d5659e76e
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "11.1.0"
|
||||
permission_handler_apple:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: permission_handler_apple
|
||||
sha256: "99e220bce3f8877c78e4ace901082fb29fa1b4ebde529ad0932d8d664b34f3f5"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "9.1.4"
|
||||
permission_handler_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: permission_handler_platform_interface
|
||||
sha256: "6760eb5ef34589224771010805bea6054ad28453906936f843a8cc4d3a55c4a4"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.12.0"
|
||||
permission_handler_windows:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: permission_handler_windows
|
||||
sha256: cc074aace208760f1eee6aa4fae766b45d947df85bc831cde77009cdb4720098
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.1.3"
|
||||
platform:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: platform
|
||||
sha256: "0a279f0707af40c890e80b1e9df8bb761694c074ba7e1d4ab1bc4b728e200b59"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.1.3"
|
||||
plugin_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: plugin_platform_interface
|
||||
sha256: da3fdfeccc4d4ff2da8f8c556704c08f912542c5fb3cf2233ed75372384a034d
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.6"
|
||||
pool:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: pool
|
||||
sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.5.1"
|
||||
pub_semver:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: pub_semver
|
||||
sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.4"
|
||||
pubspec_parse:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: pubspec_parse
|
||||
sha256: c63b2876e58e194e4b0828fcb080ad0e06d051cb607a6be51a9e084f47cb9367
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.3"
|
||||
recase:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: recase
|
||||
sha256: e4eb4ec2dcdee52dcf99cb4ceabaffc631d7424ee55e56f280bc039737f89213
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.1.0"
|
||||
shelf:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: shelf
|
||||
sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.4.1"
|
||||
shelf_web_socket:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: shelf_web_socket
|
||||
sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.4"
|
||||
sky_engine:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.99"
|
||||
sliver_tools:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: sliver_tools
|
||||
sha256: eae28220badfb9d0559207badcbbc9ad5331aac829a88cb0964d330d2a4636a6
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.2.12"
|
||||
source_gen:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: source_gen
|
||||
sha256: "2d79738b6bbf38a43920e2b8d189e9a3ce6cc201f4b8fc76be5e4fe377b1c38d"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.6"
|
||||
source_span:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: source_span
|
||||
sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250
|
||||
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.9.1"
|
||||
version: "1.10.0"
|
||||
sqflite:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: sqflite
|
||||
sha256: "500d6fec583d2c021f2d25a056d96654f910662c64f836cd2063167b8f1fa758"
|
||||
sha256: "591f1602816e9c31377d5f008c2d9ef7b8aca8941c3f89cc5fd9d84da0c38a9a"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.2.6"
|
||||
version: "2.3.0"
|
||||
sqflite_common:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: sqflite_common
|
||||
sha256: "963dad8c4aa2f814ce7d2d5b1da2f36f31bd1a439d8f27e3dc189bb9d26bc684"
|
||||
sha256: "8ed044102f3135add97be8653662052838859f5400075ef227f8ad72ae320803"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.4.3"
|
||||
version: "2.5.0+1"
|
||||
sqlite3:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: sqlite3
|
||||
sha256: "281b672749af2edf259fc801f0fcba092257425bcd32a0ce1c8237130bc934c7"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.11.2"
|
||||
sqlite3_flutter_libs:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: sqlite3_flutter_libs
|
||||
sha256: "3e3583b77cf888a68eae2e49ee4f025f66b86623ef0d83c297c8d903daa14871"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.5.18"
|
||||
sqlparser:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: sqlparser
|
||||
sha256: "9ed8f4a24a2a243e23ad267bb50378cb75c7de0b200b5336229b2d6096e6a5df"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.22.0"
|
||||
stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -168,6 +773,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.1"
|
||||
stream_transform:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stream_transform
|
||||
sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
string_scanner:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -180,10 +793,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: synchronized
|
||||
sha256: "33b31b6beb98100bf9add464a36a8dd03eb10c7a8cf15aeec535e9b054aaf04b"
|
||||
sha256: "5fcbd27688af6082f5abd611af56ee575342c30e87541d0245f7ff99faa02c60"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.1"
|
||||
version: "3.1.0"
|
||||
term_glyph:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -196,10 +809,34 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: test_api
|
||||
sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206
|
||||
sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.4.16"
|
||||
version: "0.6.0"
|
||||
timing:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: timing
|
||||
sha256: "70a3b636575d4163c477e6de42f247a23b315ae20e86442bebe32d3cabf61c32"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.1"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: typed_data
|
||||
sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.3.2"
|
||||
uuid:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: uuid
|
||||
sha256: "648e103079f7c64a36dc7d39369cabb358d377078a051d6ae2ad3aa539519313"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.7"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -208,6 +845,54 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.4"
|
||||
watcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: watcher
|
||||
sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: web
|
||||
sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.1.4-beta"
|
||||
web_socket_channel:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: web_socket_channel
|
||||
sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.4.0"
|
||||
win32:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: win32
|
||||
sha256: "350a11abd2d1d97e0cc7a28a81b781c08002aa2864d9e3f192ca0ffa18b06ed3"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.0.9"
|
||||
xdg_directories:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: xdg_directories
|
||||
sha256: "589ada45ba9e39405c198fe34eb0f607cddb2108527e658136120892beac46d2"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.3"
|
||||
yaml:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: yaml
|
||||
sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.1.2"
|
||||
sdks:
|
||||
dart: ">=2.19.5 <3.0.0"
|
||||
flutter: ">=3.3.0"
|
||||
dart: ">=3.1.0-185.0.dev <4.0.0"
|
||||
flutter: ">=3.10.0"
|
||||
|
||||
+13
-1
@@ -36,6 +36,18 @@ dependencies:
|
||||
cupertino_icons: ^1.0.2
|
||||
path: ^1.8.2
|
||||
sqflite: ^2.2.6
|
||||
moor_flutter: ^4.1.0
|
||||
build_runner: ^2.3.3
|
||||
moor_generator: ^4.6.0+1
|
||||
path_provider: ^2.0.14
|
||||
sqlite3_flutter_libs: ^0.5.13
|
||||
moor: ^4.6.1+1
|
||||
file_picker: ^6.1.1
|
||||
audioplayers: ^5.2.0
|
||||
intl: ^0.18.0
|
||||
permission_handler: ^11.0.1
|
||||
infinite_scroll_pagination: ^4.0.0
|
||||
csv: ^5.1.1
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
@@ -46,7 +58,7 @@ dev_dependencies:
|
||||
# activated in the `analysis_options.yaml` file located at the root of your
|
||||
# package. See that file for information about deactivating specific lint
|
||||
# rules and activating additional ones.
|
||||
flutter_lints: ^2.0.0
|
||||
flutter_lints: ^3.0.1
|
||||
|
||||
# For information on the generic Dart part of this file, see the
|
||||
# following page: https://dart.dev/tools/pub/pubspec
|
||||
|
||||
@@ -6,6 +6,15 @@
|
||||
|
||||
#include "generated_plugin_registrant.h"
|
||||
|
||||
#include <audioplayers_windows/audioplayers_windows_plugin.h>
|
||||
#include <permission_handler_windows/permission_handler_windows_plugin.h>
|
||||
#include <sqlite3_flutter_libs/sqlite3_flutter_libs_plugin.h>
|
||||
|
||||
void RegisterPlugins(flutter::PluginRegistry* registry) {
|
||||
AudioplayersWindowsPluginRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("AudioplayersWindowsPlugin"));
|
||||
PermissionHandlerWindowsPluginRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin"));
|
||||
Sqlite3FlutterLibsPluginRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("Sqlite3FlutterLibsPlugin"));
|
||||
}
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
#
|
||||
|
||||
list(APPEND FLUTTER_PLUGIN_LIST
|
||||
audioplayers_windows
|
||||
permission_handler_windows
|
||||
sqlite3_flutter_libs
|
||||
)
|
||||
|
||||
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
||||
|
||||
@@ -31,6 +31,11 @@ bool FlutterWindow::OnCreate() {
|
||||
this->Show();
|
||||
});
|
||||
|
||||
// Flutter can complete the first frame before the "show window" callback is
|
||||
// registered. The following call ensures a frame is pending to ensure the
|
||||
// window is shown. It is a no-op if the first frame hasn't completed yet.
|
||||
flutter_controller_->ForceRedraw();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user