Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@ class _ReservationSectionWidgetState
}

List<int> _floorsFrom(List<MachineModel> machines, int? userFloor) {
final floors = machines
.map((m) => m.floorNumber)
.whereType<int>()
.toSet();
final floors = machines.map((m) => m.floorNumber).whereType<int>().toSet();
if (userFloor != null) {
floors.add(userFloor);
}
Expand Down Expand Up @@ -220,8 +217,7 @@ class _ReservationSectionWidgetState
data: (data) {
final typedMachines = _machinesForType(data.machines);
final floors = _floorsFrom(typedMachines, userFloor);
final currentFloor =
_selectedFloor ?? (floors.isNotEmpty ? floors.first : 0);
final currentFloor = _selectedFloor ?? (userFloor ?? floors.first);
final items = _buildItems(
typedMachines,
activeReservations,
Expand Down
5 changes: 5 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:washer/core/env/app_environment.dart';
Expand All @@ -18,6 +19,10 @@ void main() async {
// μ„œλ‘œ 독립적인 μ΄ˆκΈ°ν™”λŠ” λ³‘λ ¬λ‘œ μ²˜λ¦¬ν•œλ‹€.
await Future.wait([
AppEnvironment.initialize(),
SystemChrome.setPreferredOrientations([
Comment thread
aiden30015 marked this conversation as resolved.
DeviceOrientation.portraitUp, // μ„Έλ‘œ λ°©ν–₯으둜 κ³ μ •
Comment thread
aiden30015 marked this conversation as resolved.
DeviceOrientation.portraitDown,
]),
Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform),
]);
if (kDebugMode) {
Expand Down
Loading