Created project base structure, state management, router and login

This commit is contained in:
Juan Gilsanz Polo
2024-02-21 23:53:22 +01:00
commit 460e13b2e9
168 changed files with 6966 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
class ApiResponse {
final bool successful;
final dynamic content;
final int? statusCode;
const ApiResponse({
required this.successful,
this.content,
this.statusCode,
});
}

View File

@@ -0,0 +1,12 @@
import 'package:my_linkding/models/server_instance.dart';
import 'package:shared_preferences/shared_preferences.dart';
class AppStatus {
AppStatus();
AppStatus copyWith({
SharedPreferences? sharedPreferences,
ServerInstance? serverInstance,
}) =>
AppStatus();
}

View File

@@ -0,0 +1,35 @@
class ServerInstance {
final String id;
final String method;
final String ipDomain;
final int? port;
final String? path;
final String token;
const ServerInstance({
required this.id,
required this.method,
required this.ipDomain,
this.port,
this.path,
required this.token,
});
factory ServerInstance.fromJson(Map<String, dynamic> data) => ServerInstance(
id: data['id'],
method: data['method'],
ipDomain: data['ipDomain'],
port: data['port'],
path: data['path'],
token: data['token'],
);
Map<String, dynamic> toJson() => {
"id": id,
"method": method,
"ipDomain": ipDomain,
"port": port,
"path": path,
"token": token,
};
}