You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
dafl_music/Sources/dafl_project_flutter/lib/controller/controller.dart

36 lines
621 B

import '../model/user.dart';
class Controller{
static Controller? _this;
User currentUser = User(null, null);
factory Controller(){
if (_this == null) _this = Controller._();
return _this!;
}
Controller._();
void save(User userToSave){
}
void load(String username, String password) async{
}
User createUser(String username, String password){
return User(username, password);
}
void changeCurrentUser(User user){
this.currentUser = user;
}
void changeUsernameCourant(String newName){
if(newName !=null){
this.currentUser?.usernameDafl = newName;
}
}
}