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/workout.dart';
|
||||
import 'package:smoke_cess_app/services/database_service.dart';
|
||||
// ignore: depend_on_referenced_packages
|
||||
import 'package:sqflite_common/sqlite_api.dart';
|
||||
|
||||
class DatabaseMock implements DatabaseService {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import 'package:flutter/material.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/workout_provider.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<Sleep> sleeps = await globals.databaseService.getSleepRecords();
|
||||
List<Relapse> relapses = await globals.databaseService.getRelapseRecords();
|
||||
for (Mood mood in moods) {
|
||||
print(mood.toCSV());
|
||||
}
|
||||
for (Sleep sleep in sleeps) {
|
||||
print(sleep.toCSV());
|
||||
}
|
||||
for (Relapse relapse in relapses) {
|
||||
print(relapse.toCSV());
|
||||
}
|
||||
moods;
|
||||
sleeps;
|
||||
relapses;
|
||||
}
|
||||
|
||||
void loadJSON(BuildContext context) async {
|
||||
|
|
|
@ -83,7 +83,7 @@ class DatabaseService {
|
|||
return await db.insert('relapse', relapse.toMap());
|
||||
}
|
||||
|
||||
String _createMoodTable = '''
|
||||
final String _createMoodTable = '''
|
||||
CREATE TABLE IF NOT EXISTS mood(
|
||||
id INTEGER PRIMARY KEY,
|
||||
value INTEGER,
|
||||
|
@ -92,7 +92,7 @@ class DatabaseService {
|
|||
)
|
||||
''';
|
||||
|
||||
String _createSleepTable = '''
|
||||
final String _createSleepTable = '''
|
||||
CREATE TABLE IF NOT EXISTS sleep(
|
||||
id INTEGER PRIMARY KEY,
|
||||
value INTEGER,
|
||||
|
@ -105,7 +105,7 @@ class DatabaseService {
|
|||
)
|
||||
''';
|
||||
|
||||
String _createRelapseTable = '''
|
||||
final String _createRelapseTable = '''
|
||||
CREATE TABLE IF NOT EXISTS relapse(
|
||||
id INTEGER PRIMARY KEY,
|
||||
date TEXT,
|
||||
|
@ -114,7 +114,7 @@ class DatabaseService {
|
|||
)
|
||||
''';
|
||||
|
||||
String _createWorkoutTable = '''
|
||||
final String _createWorkoutTable = '''
|
||||
CREATE TABLE IF NOT EXISTS workout(
|
||||
id INTEGER PRIMARY KEY,
|
||||
date TEXT,
|
||||
|
|
|
@ -23,13 +23,6 @@ Future<int?> getMoodQueryMinutes() => _getIntSetting('mood_query_minutes');
|
|||
Future<int?> getChessHours() => _getIntSetting('chess_hours');
|
||||
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) =>
|
||||
SharedPreferences.getInstance()
|
||||
.then((pref) => pref.setInt(settingKey, settingValue));
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
import 'package:flutter/material.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/submit_form_button.dart';
|
||||
import 'package:smoke_cess_app/widgets/text_formfield.dart';
|
||||
|
|
Loading…
Reference in New Issue