Created project base structure, state management, router and login
This commit is contained in:
11
lib/models/api_response.dart
Normal file
11
lib/models/api_response.dart
Normal 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,
|
||||
});
|
||||
}
|
||||
12
lib/models/app_status.dart
Normal file
12
lib/models/app_status.dart
Normal 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();
|
||||
}
|
||||
35
lib/models/server_instance.dart
Normal file
35
lib/models/server_instance.dart
Normal 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,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user