mirror of
https://github.com/foss42/apidash.git
synced 2025-10-17 19:52:17 +08:00
Collection pane scrollbar visibility added to settings
This commit is contained in:
@ -5,12 +5,14 @@ import 'package:apidash/consts.dart';
|
||||
class SettingsModel {
|
||||
const SettingsModel(
|
||||
{this.isDark = false,
|
||||
this.alwaysShowCollectionPaneScrollbar = true,
|
||||
this.size,
|
||||
this.offset,
|
||||
this.defaultUriScheme = kDefaultUriScheme,
|
||||
this.saveResponses = true});
|
||||
|
||||
final bool isDark;
|
||||
final bool alwaysShowCollectionPaneScrollbar;
|
||||
final Size? size;
|
||||
final Offset? offset;
|
||||
final String defaultUriScheme;
|
||||
@ -18,6 +20,7 @@ class SettingsModel {
|
||||
|
||||
SettingsModel copyWith({
|
||||
bool? isDark,
|
||||
bool? alwaysShowCollectionPaneScrollbar,
|
||||
Size? size,
|
||||
Offset? offset,
|
||||
String? defaultUriScheme,
|
||||
@ -25,6 +28,8 @@ class SettingsModel {
|
||||
}) {
|
||||
return SettingsModel(
|
||||
isDark: isDark ?? this.isDark,
|
||||
alwaysShowCollectionPaneScrollbar: alwaysShowCollectionPaneScrollbar ??
|
||||
this.alwaysShowCollectionPaneScrollbar,
|
||||
size: size ?? this.size,
|
||||
defaultUriScheme: defaultUriScheme ?? this.defaultUriScheme,
|
||||
offset: offset ?? this.offset,
|
||||
@ -34,6 +39,8 @@ class SettingsModel {
|
||||
|
||||
factory SettingsModel.fromJson(Map<dynamic, dynamic> data) {
|
||||
final isDark = data["isDark"] as bool?;
|
||||
final alwaysShowCollectionPaneScrollbar =
|
||||
data["alwaysShowCollectionPaneScrollbar"] as bool?;
|
||||
final width = data["width"] as double?;
|
||||
final height = data["height"] as double?;
|
||||
final dx = data["dx"] as double?;
|
||||
@ -53,6 +60,7 @@ class SettingsModel {
|
||||
|
||||
return sm.copyWith(
|
||||
isDark: isDark,
|
||||
alwaysShowCollectionPaneScrollbar: alwaysShowCollectionPaneScrollbar,
|
||||
size: size,
|
||||
offset: offset,
|
||||
defaultUriScheme: defaultUriScheme,
|
||||
@ -63,6 +71,7 @@ class SettingsModel {
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
"isDark": isDark,
|
||||
"alwaysShowCollectionPaneScrollbar": alwaysShowCollectionPaneScrollbar,
|
||||
"width": size?.width,
|
||||
"height": size?.height,
|
||||
"dx": offset?.dx,
|
||||
|
Reference in New Issue
Block a user