대시보드 배너/타이틀 중앙정렬 + 타일 UI 편집(드래그 이동/크기조절) + 로그인 유지 기능 추가
- 이름/부제, "스마트 관리 시스템 메뉴" 제목을 중앙 정렬 - 타일을 1x1~4x4 크기로 자유 배치할 수 있는 편집 모드 추가 (6x4 캔버스, 삼성 One UI 위젯 편집 방식) - 타일 배치는 계정별로 서버에 저장/복원 (dashboard_layout_controller.dart) - 설정 화면(톱니바퀴 아이콘) > "UI 편집" 진입점 추가 - shared_preferences로 로그인 유지 기능 추가 (비밀번호는 저장하지 않음) Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
// 🧩 대시보드 타일의 격자 위치/크기(1x1 ~ 4x4)를 표현하는 값 객체.
|
||||
// 전체 배치 캔버스는 가로 6칸 × 세로 4칸으로 고정한다.
|
||||
const int kGridCols = 6;
|
||||
const int kGridRows = 4;
|
||||
const int kMinTileSize = 1;
|
||||
const int kMaxTileSize = 4;
|
||||
|
||||
class TileRect {
|
||||
final int x;
|
||||
final int y;
|
||||
final int w;
|
||||
final int h;
|
||||
|
||||
const TileRect({
|
||||
required this.x,
|
||||
required this.y,
|
||||
required this.w,
|
||||
required this.h,
|
||||
});
|
||||
|
||||
factory TileRect.fromJson(Map<String, dynamic> json) => TileRect(
|
||||
x: (json['x'] as num).toInt(),
|
||||
y: (json['y'] as num).toInt(),
|
||||
w: (json['w'] as num).toInt(),
|
||||
h: (json['h'] as num).toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson(String id) => {
|
||||
'id': id,
|
||||
'x': x,
|
||||
'y': y,
|
||||
'w': w,
|
||||
'h': h,
|
||||
};
|
||||
|
||||
TileRect copyWith({int? x, int? y, int? w, int? h}) =>
|
||||
TileRect(x: x ?? this.x, y: y ?? this.y, w: w ?? this.w, h: h ?? this.h);
|
||||
|
||||
bool overlaps(TileRect other) {
|
||||
return x < other.x + other.w &&
|
||||
x + w > other.x &&
|
||||
y < other.y + other.h &&
|
||||
y + h > other.y;
|
||||
}
|
||||
|
||||
bool get isWithinCanvas =>
|
||||
x >= 0 &&
|
||||
y >= 0 &&
|
||||
x + w <= kGridCols &&
|
||||
y + h <= kGridRows &&
|
||||
w >= kMinTileSize &&
|
||||
h >= kMinTileSize &&
|
||||
w <= kMaxTileSize &&
|
||||
h <= kMaxTileSize;
|
||||
}
|
||||
Reference in New Issue
Block a user