init branch
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
parent
47046e347b
commit
19e667a2c2
@ -1,428 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Dart Packages" type="DartPackagesLibraryType">
|
||||
<properties>
|
||||
<option name="packageNameToDirsMap">
|
||||
<entry key="animations">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/animations-2.0.7/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="archive">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/archive-3.3.2/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="args">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/args-2.3.1/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="async">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/async-2.9.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="boolean_selector">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/boolean_selector-2.1.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="characters">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/characters-1.2.1/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="checked_yaml">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/checked_yaml-2.0.1/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="cli_util">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/cli_util-0.3.5/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="clock">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/clock-1.1.1/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="collection">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/collection-1.16.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="crypto">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/crypto-3.0.2/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="csslib">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/csslib-0.17.2/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="cupertino_icons">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/cupertino_icons-1.0.5/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="fake_async">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/fake_async-1.3.1/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="flutter">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/../../../../src/flutter/packages/flutter/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="flutter_launcher_icons">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/flutter_launcher_icons-0.10.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="flutter_lints">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/flutter_lints-2.0.1/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="flutter_native_splash">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/flutter_native_splash-2.2.11/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="flutter_test">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/../../../../src/flutter/packages/flutter_test/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="flutter_web_plugins">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/../../../../src/flutter/packages/flutter_web_plugins/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="fluttericon">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/fluttericon-2.0.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="fluttertoast">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/fluttertoast-8.1.1/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="graphs">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/graphs-2.1.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="html">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/html-0.15.1/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="http">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/http-0.13.5/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="http_parser">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/http_parser-4.0.2/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="image">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/image-3.2.2/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="js">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/js-0.6.4/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="json_annotation">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/json_annotation-4.7.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="lints">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/lints-2.0.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="matcher">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/matcher-0.12.12/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="material_color_utilities">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/material_color_utilities-0.1.5/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="meta">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/meta-1.8.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="nested">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/nested-1.0.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="page_transition">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/page_transition-2.0.9/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="path">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/path-1.8.2/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="petitparser">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/petitparser-5.0.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="provider">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/provider-6.0.4/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="rive">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/rive-0.9.1/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="sky_engine">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/../../../../src/flutter/bin/cache/pkg/sky_engine/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="source_span">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/source_span-1.9.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="stack_trace">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/stack_trace-1.10.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="stream_channel">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/stream_channel-2.1.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="string_scanner">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/string_scanner-1.1.1/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="term_glyph">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/term_glyph-1.2.1/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="test_api">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/test_api-0.4.12/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="typed_data">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/typed_data-1.3.1/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="universal_io">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/universal_io-2.0.4/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="vector_math">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/vector_math-2.1.2/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="vibration">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/vibration-1.7.6/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="xml">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/xml-6.1.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="yaml">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/yaml-3.1.1/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
</option>
|
||||
</properties>
|
||||
<CLASSES>
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/animations-2.0.7/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/archive-3.3.2/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/args-2.3.1/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/async-2.9.0/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/boolean_selector-2.1.0/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/characters-1.2.1/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/checked_yaml-2.0.1/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/cli_util-0.3.5/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/clock-1.1.1/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/collection-1.16.0/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/crypto-3.0.2/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/csslib-0.17.2/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/cupertino_icons-1.0.5/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/fake_async-1.3.1/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/flutter_launcher_icons-0.10.0/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/flutter_lints-2.0.1/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/flutter_native_splash-2.2.11/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/fluttericon-2.0.0/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/fluttertoast-8.1.1/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/graphs-2.1.0/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/html-0.15.1/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/http-0.13.5/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/http_parser-4.0.2/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/image-3.2.2/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/js-0.6.4/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/json_annotation-4.7.0/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/lints-2.0.0/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/matcher-0.12.12/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/material_color_utilities-0.1.5/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/meta-1.8.0/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/nested-1.0.0/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/page_transition-2.0.9/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/path-1.8.2/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/petitparser-5.0.0/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/provider-6.0.4/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/rive-0.9.1/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/source_span-1.9.0/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/stack_trace-1.10.0/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/stream_channel-2.1.0/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/string_scanner-1.1.1/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/term_glyph-1.2.1/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/test_api-0.4.12/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/typed_data-1.3.1/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/universal_io-2.0.4/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/vector_math-2.1.2/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/vibration-1.7.6/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/xml-6.1.0/lib" />
|
||||
<root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/yaml-3.1.1/lib" />
|
||||
<root url="file://$PROJECT_DIR$/../../../../src/flutter/bin/cache/pkg/sky_engine/lib" />
|
||||
<root url="file://$PROJECT_DIR$/../../../../src/flutter/packages/flutter/lib" />
|
||||
<root url="file://$PROJECT_DIR$/../../../../src/flutter/packages/flutter_test/lib" />
|
||||
<root url="file://$PROJECT_DIR$/../../../../src/flutter/packages/flutter_web_plugins/lib" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
@ -0,0 +1,35 @@
|
||||
import 'package:dafl_project_flutter/persistence/database_loader.dart';
|
||||
import 'package:dafl_project_flutter/persistence/database_saver.dart';
|
||||
import 'package:dafl_project_flutter/persistence/loader.dart';
|
||||
|
||||
import '../persistence/saver.dart';
|
||||
import '../persistence/loader.dart';
|
||||
import '../model/user.dart';
|
||||
|
||||
|
||||
class Controller{
|
||||
static Controller? _this;
|
||||
|
||||
static Saver? saver = DatabaseSaver();
|
||||
static Loader? loader = DatabaseLoader();
|
||||
|
||||
Future<User?>? currentUser;
|
||||
|
||||
factory Controller(){
|
||||
if (_this == null) _this = Controller._();
|
||||
return _this!;
|
||||
}
|
||||
|
||||
Controller._();
|
||||
|
||||
void save(User userToSave){
|
||||
saver?.save(userToSave);
|
||||
}
|
||||
|
||||
void load(String username, String password) async{
|
||||
currentUser = loader?.load(username, password);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -0,0 +1,21 @@
|
||||
import 'message.dart';
|
||||
import 'user.dart';
|
||||
|
||||
class Conversation{
|
||||
User firstUser;
|
||||
User secondUser;
|
||||
List<Message> messages=[];
|
||||
|
||||
Conversation(this.firstUser,this.secondUser);
|
||||
|
||||
void addMessage(User sender,String content){
|
||||
messages.add(Message(sender, content));
|
||||
}
|
||||
|
||||
void displayMessages(){
|
||||
print("-----Conversation entre $firstUser et $secondUser-----");
|
||||
for (var element in messages) {
|
||||
print(element);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
import 'user.dart';
|
||||
|
||||
class Message{
|
||||
User sender;
|
||||
String content;
|
||||
|
||||
Message(this.sender,this.content);
|
||||
|
||||
@override
|
||||
String toString() => "$sender : $content";
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
import 'conversation.dart';
|
||||
|
||||
class User{
|
||||
//attributes from DAFL
|
||||
int? idDafl;
|
||||
String? usernameDafl;
|
||||
String? passwDafl;
|
||||
//attributes to link with API
|
||||
String? usernameAPI;
|
||||
String? passwAPI;
|
||||
|
||||
//constructors
|
||||
User(this.usernameDafl, this.passwDafl);
|
||||
|
||||
User.name(this.usernameDafl);
|
||||
|
||||
User.fromDatabase(this.idDafl, this.usernameDafl);
|
||||
|
||||
|
||||
//lists
|
||||
Set<User> likedUsers={};
|
||||
Map<User,Conversation> conversations={};
|
||||
|
||||
|
||||
void like(User liked){
|
||||
likedUsers.add(liked);
|
||||
Conversation? conv = liked.conversations[this];
|
||||
if(conv==null) {
|
||||
conversations[liked]= Conversation(this, liked);
|
||||
} else {
|
||||
conversations[liked]= conv;
|
||||
}
|
||||
}
|
||||
|
||||
void chat(User recipient,String content){
|
||||
Conversation? conv = conversations[recipient];
|
||||
if(conv != null) conv.addMessage(this, content);
|
||||
}
|
||||
|
||||
void displayConversations(){
|
||||
conversations.forEach((k,v) => v.displayMessages());
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() => "$usernameDafl ($idDafl)";
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
import 'user.dart';
|
||||
|
||||
class UserCreator{
|
||||
|
||||
User? createUser(int id, String username){
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
postgres
|
||||
mdpDaflBd
|
||||
89.83.54.48
|
||||
BD-DaflMusic
|
||||
|
@ -0,0 +1,20 @@
|
||||
import '../model/user.dart';
|
||||
import 'package:postgresql2/constants.dart';
|
||||
import 'package:postgresql2/pool.dart';
|
||||
import 'package:postgresql2/postgresql.dart';
|
||||
|
||||
class DatabaseConnexion{
|
||||
String? psqlUser = 'postgres';
|
||||
String? psqlPswd = 'mdpDaflBd';
|
||||
String? psqlHost = '89.83.54.48';
|
||||
String? psqlDataBase = 'BD-DaflMusic';
|
||||
|
||||
|
||||
//Initialise connexion to the database
|
||||
Future<Connection> initConnexion(){
|
||||
var uri = 'postgres://$psqlUser:$psqlPswd@$psqlHost:5442/$psqlDataBase';
|
||||
|
||||
return connect(uri);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
import '../persistence/loader.dart';
|
||||
import '../model/user.dart';
|
||||
import 'database_connexion.dart';
|
||||
|
||||
class DatabaseLoader extends Loader{
|
||||
DatabaseConnexion dbConnexion = DatabaseConnexion();
|
||||
|
||||
|
||||
@override
|
||||
Future<User?> load(String? username, String? password) async {
|
||||
|
||||
final connection = await dbConnexion.initConnexion();
|
||||
|
||||
connection.query('select * from utilisateur where username = @username AND password = @password',
|
||||
{'username': username,
|
||||
'password': password}).toList()
|
||||
.then((result) {
|
||||
print(result); });
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,20 @@
|
||||
import 'dart:io';
|
||||
import 'database_connexion.dart';
|
||||
import 'saver.dart';
|
||||
import '../model/user.dart';
|
||||
|
||||
|
||||
class DatabaseSaver extends Saver{
|
||||
DatabaseConnexion dbConnexion = DatabaseConnexion();
|
||||
|
||||
@override
|
||||
void save(User userToSave) async{
|
||||
|
||||
final connection = await dbConnexion.initConnexion();
|
||||
|
||||
connection.execute('insert into utilisateur (username, password) values (@username, @password)',
|
||||
{ 'id' : '',
|
||||
'username': userToSave.usernameDafl,
|
||||
'password' : userToSave.passwDafl}).then((_) { print('Ajout'); });
|
||||
}
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
import '../model/user.dart';
|
||||
|
||||
abstract class Loader{
|
||||
Future<User?> load(String? username, String? password);
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
import '../model/user.dart';
|
||||
|
||||
abstract class Saver{
|
||||
void save(User userToSave);
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
import '../model/user.dart';
|
||||
|
||||
abstract class Search{
|
||||
|
||||
}
|
@ -1,150 +0,0 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:fluttericon/font_awesome5_icons.dart';
|
||||
|
||||
class ConversationPage extends StatefulWidget {
|
||||
const ConversationPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<ConversationPage> createState() => _ConversationPageState();
|
||||
}
|
||||
|
||||
class _ConversationPageState extends State<ConversationPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
double height = MediaQuery.of(context).size.height;
|
||||
double width = MediaQuery.of(context).size.width;
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: true,
|
||||
backgroundColor: Color(0xFF141414),
|
||||
appBar: AppBar(
|
||||
toolbarHeight: 100,
|
||||
title: Row(
|
||||
children: [
|
||||
Container(
|
||||
height: 60,
|
||||
width: 60,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(40),
|
||||
color: Colors.blue,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 20,),
|
||||
Text("Max"),
|
||||
|
||||
],
|
||||
),
|
||||
|
||||
backgroundColor: Color(0xFF141414),
|
||||
elevation: 0,
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
color: Color(0xFF141414),
|
||||
height: height*0.76,
|
||||
width: double.infinity,
|
||||
child: ListView(
|
||||
scrollDirection: Axis.vertical,
|
||||
children: [
|
||||
Message('Adolescebat autem obstinatum propositum erga haec et similia multa scrutanda, stimulos admovente regina, quae abrupte mariti fortunas trudebat in exitium praeceps, cum eum potius lenitate feminea ad veritatis humanitatisque viam reducere utilia suadendo deberet, ut in Gordianorum actibus factitasse Maximini truculenti illius imperatoris rettulimus coniugem.', 0),
|
||||
Message('Claudiopolis olim Seleucia Caesar potens quidem olim interneciva enim et.', 1),
|
||||
Message('Quae quae praeceps feminea quae truculenti humanitatisque cum humanitatisque in truculenti abrupte imperatoris mariti regina regina ad lenitate veritatis veritatis.', 1),
|
||||
Message('Quae quae praeceps feminea quae truculenti humanitatisque cum humanitatisque in truculenti abrupte imperatoris mariti regina regina ad lenitate veritatis veritatis.', 0),
|
||||
Message('Quae quae praeceps feminea quae truculenti humanitatisque cum humanitatisque in truculenti abrupte imperatoris mariti regina regina ad lenitate veritatis veritatis.', 0),
|
||||
Message('Quae quae praeceps feminea quae truculenti humanitatisque cum humanitatisque in truculenti abrupte imperatoris mariti regina regina ad lenitate veritatis veritatis.', 1),
|
||||
],
|
||||
),
|
||||
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
|
||||
children: [
|
||||
Container(
|
||||
height: height*0.08,
|
||||
color: Color(0xFF141414),
|
||||
width: width*0.8,
|
||||
child: Container(
|
||||
margin: EdgeInsets.fromLTRB(20, 10, 0, 10),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
color: Colors.white,
|
||||
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
|
||||
child: TextField(
|
||||
decoration: InputDecoration(
|
||||
border: InputBorder.none,
|
||||
hintText: "Envoyer un message..."
|
||||
),
|
||||
cursorColor: Colors.purple,
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 40,
|
||||
height: 40,
|
||||
margin: EdgeInsets.fromLTRB(0, 0, 0, 0),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
color: Colors.blue,
|
||||
),
|
||||
child: Icon(Icons.send, size: 20, color: Colors.white,),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget Message(String message, int user) {
|
||||
if(user == 0){
|
||||
return Container(
|
||||
margin: EdgeInsets.fromLTRB(40, 7, 80, 7),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.only(
|
||||
bottomRight: Radius.circular(20),
|
||||
topLeft: Radius.circular(20),
|
||||
topRight: Radius.circular(20),
|
||||
bottomLeft: Radius.circular(20),
|
||||
),
|
||||
border: Border.all(width: 1.5,
|
||||
color: Color(0xFF9C9C9C).withOpacity(0.3)),
|
||||
color: Color(0xFF191919),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.fromLTRB(20, 20, 20, 20),
|
||||
child: Text(message,style: TextStyle(fontFamily: 'DMSans', color: Colors.white ,fontSize: 19, fontWeight: FontWeight.w400),
|
||||
)),
|
||||
);
|
||||
}
|
||||
else{
|
||||
return Container(
|
||||
margin: EdgeInsets.fromLTRB(80, 7, 40, 7),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.only(
|
||||
bottomRight: Radius.circular(20),
|
||||
bottomLeft: Radius.circular(20),
|
||||
topLeft: Radius.circular(20),
|
||||
topRight: Radius.circular(20),
|
||||
),
|
||||
color: Color(0xFF2F2F2F),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.fromLTRB(20, 20, 20, 20),
|
||||
child: Text(message,style: TextStyle(fontFamily: 'DMSans', color: Colors.white ,fontSize: 19, fontWeight: FontWeight.w400),
|
||||
)),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
||||
|
@ -1,228 +0,0 @@
|
||||
import 'package:dafl_project_flutter/views/pages/main/p_conversation.dart';
|
||||
import 'package:dafl_project_flutter/views/pages/main/p_main.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:fluttericon/font_awesome5_icons.dart';
|
||||
import 'package:page_transition/page_transition.dart';
|
||||
|
||||
class MessagesWidget extends StatefulWidget {
|
||||
const MessagesWidget({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<MessagesWidget> createState() => _MessagesWidgetState();
|
||||
}
|
||||
|
||||
class _MessagesWidgetState extends State<MessagesWidget> {
|
||||
int indexSectedButton = 0;
|
||||
Widget listeActuelle = ListConfirmedWidget();
|
||||
|
||||
|
||||
var colorConfirm = Color(0xFFFFFFFF);
|
||||
var colorWaiting = Color(0xFFA8A8A8);
|
||||
void changeSelected(int num){
|
||||
if(indexSectedButton == num){
|
||||
return;
|
||||
}
|
||||
else{
|
||||
if(num == 0){
|
||||
setState((){
|
||||
colorConfirm = Color(0xFFFFFFFF);
|
||||
colorWaiting = Color(0xFFA8A8A8);
|
||||
listeActuelle = ListConfirmedWidget();
|
||||
indexSectedButton = num;
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
else{
|
||||
setState((){
|
||||
colorConfirm = Color(0xFFA8A8A8);
|
||||
colorWaiting = Color(0xFFFFFFFF);
|
||||
listeActuelle = ListWaitingWidget();
|
||||
indexSectedButton = num;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
Widget build(BuildContext context) {
|
||||
double height = MediaQuery.of(context).size.height;
|
||||
double width = MediaQuery.of(context).size.width;
|
||||
return Container(
|
||||
color: Color(0xFF141414),
|
||||
|
||||
child: Padding(padding: EdgeInsets.fromLTRB(30, 50, 30, 0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('Messages', style: TextStyle(color: Colors.white, fontWeight: FontWeight.w500, fontSize: 25)),
|
||||
Padding(padding: EdgeInsets.fromLTRB(0, 5, 0, 0)),
|
||||
Text('Retrouvez ici vos discussions.', style: TextStyle(color: Colors.grey.withOpacity(0.4), fontSize: 15),),
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(0, height*0.01, 0, 0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 35,
|
||||
width: width*0.35,
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: colorConfirm,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(15.0),
|
||||
),// background// foreground
|
||||
),
|
||||
onPressed: () {
|
||||
changeSelected(0);
|
||||
},
|
||||
child: Text("Validées",
|
||||
style: TextStyle(color: Colors.black ,fontSize: 17, fontWeight: FontWeight.bold),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),),
|
||||
SizedBox(
|
||||
height: 35,
|
||||
width: width*0.35,
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: colorWaiting,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(15.0),
|
||||
),// background// foreground
|
||||
),
|
||||
onPressed: () {
|
||||
changeSelected(1);
|
||||
},
|
||||
child: Text("En attente",
|
||||
style: TextStyle(color: Colors.black ,fontSize: 17, fontWeight: FontWeight.bold),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),),
|
||||
],
|
||||
),),
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child:
|
||||
listeActuelle,
|
||||
|
||||
|
||||
),
|
||||
],
|
||||
),),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MessagesButtonWidget extends StatelessWidget{
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
double height = MediaQuery.of(context).size.height;
|
||||
double width = MediaQuery.of(context).size.width;
|
||||
return Container(
|
||||
margin: EdgeInsets.fromLTRB(0, 0, 0, 10),
|
||||
child: Column(
|
||||
children: [
|
||||
|
||||
Container(
|
||||
color: Colors.transparent,
|
||||
margin: EdgeInsets.fromLTRB(0, 5, 0, 0),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
height: 60,
|
||||
width: 60,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: NetworkImage('https://www.goutemesdisques.com/uploads/tx_gmdchron/pi1/L_Etrange_Histoire_de_Mr_Anderson.jpg'),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
border: Border.all(width: 0, color: Colors.grey.withOpacity(0)),
|
||||
borderRadius: BorderRadius.all(Radius.circular(30)),
|
||||
),),
|
||||
Container(
|
||||
width: width-160,
|
||||
margin: EdgeInsets.fromLTRB(20, 0, 20, 0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Max',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(1) ,fontSize: 20, fontWeight: FontWeight.w800),),
|
||||
Text('1 jour(s)',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(0.8) ,fontSize: 15, fontWeight: FontWeight.w400),),
|
||||
],
|
||||
),
|
||||
Text('A envoyé un musique.',style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(0.6) ,fontSize: 16, fontWeight: FontWeight.w400),),
|
||||
|
||||
],
|
||||
),),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
],
|
||||
)
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class ListConfirmedWidget extends StatelessWidget{
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
double height = MediaQuery.of(context).size.height;
|
||||
double width = MediaQuery.of(context).size.width;
|
||||
return ListView(
|
||||
|
||||
children: [
|
||||
SizedBox(height: 40,),
|
||||
MessagesButtonWidget(),
|
||||
MessagesButtonWidget(),
|
||||
MessagesButtonWidget(),
|
||||
MessagesButtonWidget(),
|
||||
|
||||
|
||||
],
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class ListWaitingWidget extends StatelessWidget{
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
double height = MediaQuery.of(context).size.height;
|
||||
double width = MediaQuery.of(context).size.width;
|
||||
return ListView(
|
||||
|
||||
children: [
|
||||
SizedBox(height: 40,),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.of(context).push(PageTransition(
|
||||
duration: Duration(milliseconds: 200),
|
||||
reverseDuration: Duration(milliseconds: 200),
|
||||
type: PageTransitionType.rightToLeftWithFade,
|
||||
childCurrent: context.widget,
|
||||
child: ConversationPage()));
|
||||
},
|
||||
child: MessagesButtonWidget(),
|
||||
),
|
||||
|
||||
],
|
||||
);
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
import '../lib/controller/controller.dart';
|
||||
import '../lib/persistence/database_saver.dart';
|
||||
|
||||
|
||||
void main(){
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:dafl_project_flutter/persistence/database_connexion.dart';
|
||||
import 'package:postgresql2/postgresql.dart';
|
||||
|
||||
import '../lib/persistence/database_saver.dart';
|
||||
|
||||
|
||||
void main() async{
|
||||
DatabaseConnexion d = DatabaseConnexion();
|
||||
|
||||
final conn = await d.initConnexion();
|
||||
|
||||
conn.query('select * from utilisateur').toList().then((rows) {
|
||||
for (var row in rows) {
|
||||
print(row[0]); // Or by column index.
|
||||
}
|
||||
});
|
||||
|
||||
}
|
Loading…
Reference in new issue