fix flutter analyze problems
parent
da0bf43087
commit
5b3d615c8e
|
@ -4,6 +4,7 @@ import 'package:smoke_cess_app/models/relapse.dart';
|
||||||
import 'package:smoke_cess_app/models/sleep.dart';
|
import 'package:smoke_cess_app/models/sleep.dart';
|
||||||
import 'package:smoke_cess_app/models/workout.dart';
|
import 'package:smoke_cess_app/models/workout.dart';
|
||||||
import 'package:smoke_cess_app/services/database_service.dart';
|
import 'package:smoke_cess_app/services/database_service.dart';
|
||||||
|
// ignore: depend_on_referenced_packages
|
||||||
import 'package:sqflite_common/sqlite_api.dart';
|
import 'package:sqflite_common/sqlite_api.dart';
|
||||||
|
|
||||||
class DatabaseMock implements DatabaseService {
|
class DatabaseMock implements DatabaseService {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:smoke_cess_app/providers/input_provider.dart';
|
|
||||||
import 'package:smoke_cess_app/providers/timer_provider.dart';
|
import 'package:smoke_cess_app/providers/timer_provider.dart';
|
||||||
import 'package:smoke_cess_app/providers/workout_provider.dart';
|
import 'package:smoke_cess_app/providers/workout_provider.dart';
|
||||||
import 'package:smoke_cess_app/widgets/mute_button.dart';
|
import 'package:smoke_cess_app/widgets/mute_button.dart';
|
||||||
|
|
|
@ -17,15 +17,9 @@ class ScannerPage extends StatelessWidget {
|
||||||
List<Mood> moods = await globals.databaseService.getMoodRecords();
|
List<Mood> moods = await globals.databaseService.getMoodRecords();
|
||||||
List<Sleep> sleeps = await globals.databaseService.getSleepRecords();
|
List<Sleep> sleeps = await globals.databaseService.getSleepRecords();
|
||||||
List<Relapse> relapses = await globals.databaseService.getRelapseRecords();
|
List<Relapse> relapses = await globals.databaseService.getRelapseRecords();
|
||||||
for (Mood mood in moods) {
|
moods;
|
||||||
print(mood.toCSV());
|
sleeps;
|
||||||
}
|
relapses;
|
||||||
for (Sleep sleep in sleeps) {
|
|
||||||
print(sleep.toCSV());
|
|
||||||
}
|
|
||||||
for (Relapse relapse in relapses) {
|
|
||||||
print(relapse.toCSV());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void loadJSON(BuildContext context) async {
|
void loadJSON(BuildContext context) async {
|
||||||
|
|
|
@ -83,7 +83,7 @@ class DatabaseService {
|
||||||
return await db.insert('relapse', relapse.toMap());
|
return await db.insert('relapse', relapse.toMap());
|
||||||
}
|
}
|
||||||
|
|
||||||
String _createMoodTable = '''
|
final String _createMoodTable = '''
|
||||||
CREATE TABLE IF NOT EXISTS mood(
|
CREATE TABLE IF NOT EXISTS mood(
|
||||||
id INTEGER PRIMARY KEY,
|
id INTEGER PRIMARY KEY,
|
||||||
value INTEGER,
|
value INTEGER,
|
||||||
|
@ -92,7 +92,7 @@ class DatabaseService {
|
||||||
)
|
)
|
||||||
''';
|
''';
|
||||||
|
|
||||||
String _createSleepTable = '''
|
final String _createSleepTable = '''
|
||||||
CREATE TABLE IF NOT EXISTS sleep(
|
CREATE TABLE IF NOT EXISTS sleep(
|
||||||
id INTEGER PRIMARY KEY,
|
id INTEGER PRIMARY KEY,
|
||||||
value INTEGER,
|
value INTEGER,
|
||||||
|
@ -105,7 +105,7 @@ class DatabaseService {
|
||||||
)
|
)
|
||||||
''';
|
''';
|
||||||
|
|
||||||
String _createRelapseTable = '''
|
final String _createRelapseTable = '''
|
||||||
CREATE TABLE IF NOT EXISTS relapse(
|
CREATE TABLE IF NOT EXISTS relapse(
|
||||||
id INTEGER PRIMARY KEY,
|
id INTEGER PRIMARY KEY,
|
||||||
date TEXT,
|
date TEXT,
|
||||||
|
@ -114,7 +114,7 @@ class DatabaseService {
|
||||||
)
|
)
|
||||||
''';
|
''';
|
||||||
|
|
||||||
String _createWorkoutTable = '''
|
final String _createWorkoutTable = '''
|
||||||
CREATE TABLE IF NOT EXISTS workout(
|
CREATE TABLE IF NOT EXISTS workout(
|
||||||
id INTEGER PRIMARY KEY,
|
id INTEGER PRIMARY KEY,
|
||||||
date TEXT,
|
date TEXT,
|
||||||
|
|
|
@ -23,13 +23,6 @@ Future<int?> getMoodQueryMinutes() => _getIntSetting('mood_query_minutes');
|
||||||
Future<int?> getChessHours() => _getIntSetting('chess_hours');
|
Future<int?> getChessHours() => _getIntSetting('chess_hours');
|
||||||
Future<int?> getChessMinutes() => _getIntSetting('chess_minutes');
|
Future<int?> getChessMinutes() => _getIntSetting('chess_minutes');
|
||||||
|
|
||||||
void _setStringSetting(String settingKey, String settingValue) =>
|
|
||||||
SharedPreferences.getInstance()
|
|
||||||
.then((pref) => pref.setString(settingKey, settingValue));
|
|
||||||
|
|
||||||
Future<String?> _getStringSetting(String settingKey) =>
|
|
||||||
SharedPreferences.getInstance().then((pref) => pref.getString(settingKey));
|
|
||||||
|
|
||||||
void _setIntSetting(String settingKey, int settingValue) =>
|
void _setIntSetting(String settingKey, int settingValue) =>
|
||||||
SharedPreferences.getInstance()
|
SharedPreferences.getInstance()
|
||||||
.then((pref) => pref.setInt(settingKey, settingValue));
|
.then((pref) => pref.setInt(settingKey, settingValue));
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:smoke_cess_app/models/mood.dart';
|
|
||||||
import 'package:smoke_cess_app/services/database_service.dart';
|
|
||||||
import 'package:smoke_cess_app/widgets/slider.dart';
|
import 'package:smoke_cess_app/widgets/slider.dart';
|
||||||
import 'package:smoke_cess_app/widgets/submit_form_button.dart';
|
import 'package:smoke_cess_app/widgets/submit_form_button.dart';
|
||||||
import 'package:smoke_cess_app/widgets/text_formfield.dart';
|
import 'package:smoke_cess_app/widgets/text_formfield.dart';
|
||||||
|
|
Loading…
Reference in New Issue