feat(ui): full‑width ShadTable across app; fix rent dialog width; correct equipment pagination
- ShadTable: ensure full-width via LayoutBuilder+ConstrainedBox minWidth - BaseListScreen: default data area padding = 0 for table edge-to-edge - Vendor/Model/User/Company/Inventory/Zipcode: set columnSpanExtent per column and add final filler column to absorb remaining width; pin date/status/actions widths; ensure date text is single-line - Equipment: unify card/border style; define fixed column widths + filler; increase checkbox column to 56px to avoid overflow - Rent list: migrate to ShadTable.list with fixed widths + filler column - Rent form dialog: prevent infinite width by bounding ShadProgress with SizedBox and remove Expanded from option rows; add safe selectedOptionBuilder - Admin list: fix const with non-const argument in table column extents - Services/Controller: remove hardcoded perPage=10; use BaseListController perPage; trust server meta (total/totalPages) in equipment pagination - widgets/shad_table: ConstrainedBox(minWidth=viewport) so table stretches Run: flutter analyze → 0 errors (warnings remain).
This commit is contained in:
@@ -1,12 +1,16 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:get_it/get_it.dart';
|
||||
import 'package:superport/injection_container.dart' as di;
|
||||
import 'package:superport/data/datasources/remote/dashboard_remote_datasource.dart';
|
||||
import 'package:superport/data/datasources/remote/lookup_remote_datasource.dart';
|
||||
import 'package:superport/core/services/lookups_service.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
void main() {
|
||||
setUpAll(() async {
|
||||
TestWidgetsFlutterBinding.ensureInitialized();
|
||||
SharedPreferences.setMockInitialValues({});
|
||||
await di.init();
|
||||
});
|
||||
|
||||
@@ -61,4 +65,4 @@ void main() {
|
||||
expect(result.isLeft() || result.isRight(), isTrue);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,12 @@ import 'package:dio/dio.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:superport/core/config/environment.dart';
|
||||
|
||||
const bool RUN_EXTERNAL_TESTS = bool.fromEnvironment('RUN_EXTERNAL_TESTS');
|
||||
void main() {
|
||||
if (!RUN_EXTERNAL_TESTS) {
|
||||
test('External tests disabled', () {}, skip: 'Enable with --dart-define=RUN_EXTERNAL_TESTS=true');
|
||||
return;
|
||||
}
|
||||
late Dio dio;
|
||||
|
||||
setUpAll(() {
|
||||
@@ -145,4 +150,4 @@ void main() {
|
||||
print('\n========================================\n');
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,12 @@ import 'dart:io';
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
const bool RUN_EXTERNAL_TESTS = bool.fromEnvironment('RUN_EXTERNAL_TESTS');
|
||||
void main() {
|
||||
if (!RUN_EXTERNAL_TESTS) {
|
||||
test('External tests disabled', () {}, skip: 'Enable with --dart-define=RUN_EXTERNAL_TESTS=true');
|
||||
return;
|
||||
}
|
||||
final baseUrl = Platform.environment['INTEGRATION_API_BASE_URL'];
|
||||
final username = Platform.environment['INTEGRATION_LOGIN_USERNAME'];
|
||||
final password = Platform.environment['INTEGRATION_LOGIN_PASSWORD'];
|
||||
@@ -38,4 +43,3 @@ void main() {
|
||||
}, tags: ['integration']);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -506,7 +506,12 @@ class CheckboxEquipmentOutTest {
|
||||
}
|
||||
|
||||
/// 테스트 실행
|
||||
const bool RUN_EXTERNAL_TESTS = bool.fromEnvironment('RUN_EXTERNAL_TESTS');
|
||||
void main() async {
|
||||
if (!RUN_EXTERNAL_TESTS) {
|
||||
test('External tests disabled', () {}, skip: 'Enable with --dart-define=RUN_EXTERNAL_TESTS=true');
|
||||
return;
|
||||
}
|
||||
// 실제 API 환경 설정
|
||||
await RealApiTestHelper.setupTestEnvironment();
|
||||
final getIt = GetIt.instance;
|
||||
@@ -530,4 +535,4 @@ void main() async {
|
||||
await tester.runAllTests();
|
||||
}, timeout: Timeout(Duration(minutes: 5)));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -390,7 +390,12 @@ Future<TestResult> runCompanyTests({
|
||||
}
|
||||
|
||||
/// 독립 실행용 main 함수
|
||||
const bool RUN_EXTERNAL_TESTS = bool.fromEnvironment('RUN_EXTERNAL_TESTS');
|
||||
void main() {
|
||||
if (!RUN_EXTERNAL_TESTS) {
|
||||
test('External tests disabled', () {}, skip: 'Enable with --dart-define=RUN_EXTERNAL_TESTS=true');
|
||||
return;
|
||||
}
|
||||
late Dio dio;
|
||||
late String authToken;
|
||||
const String baseUrl = 'http://43.201.34.104:8080/api/v1';
|
||||
@@ -740,4 +745,4 @@ void main() {
|
||||
tearDownAll(() {
|
||||
dio.close();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -590,7 +590,12 @@ Future<TestResult> runEquipmentInTests({
|
||||
return result;
|
||||
}
|
||||
|
||||
const bool RUN_EXTERNAL_TESTS = bool.fromEnvironment('RUN_EXTERNAL_TESTS');
|
||||
void main() {
|
||||
if (!RUN_EXTERNAL_TESTS) {
|
||||
test('External tests disabled', () {}, skip: 'Enable with --dart-define=RUN_EXTERNAL_TESTS=true');
|
||||
return;
|
||||
}
|
||||
late GetIt getIt;
|
||||
late ApiClient apiClient;
|
||||
late AuthService authService;
|
||||
@@ -658,4 +663,4 @@ void main() {
|
||||
});
|
||||
|
||||
debugPrint('\n🎉 모든 장비 입고 테스트 완료!');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -605,7 +605,12 @@ Future<TestResult> runEquipmentOutTests({
|
||||
}
|
||||
|
||||
/// 독립 실행용 main 함수
|
||||
const bool RUN_EXTERNAL_TESTS = bool.fromEnvironment('RUN_EXTERNAL_TESTS');
|
||||
void main() {
|
||||
if (!RUN_EXTERNAL_TESTS) {
|
||||
test('External tests disabled', () {}, skip: 'Enable with --dart-define=RUN_EXTERNAL_TESTS=true');
|
||||
return;
|
||||
}
|
||||
late GetIt getIt;
|
||||
late ApiClient apiClient;
|
||||
late AuthService authService;
|
||||
@@ -1168,4 +1173,4 @@ void main() {
|
||||
});
|
||||
|
||||
debugPrint('\n🎉 모든 장비 출고 테스트 완료!');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,12 @@ import 'package:test/test.dart';
|
||||
// import 'screens/equipment/equipment_in_full_test.dart'; // 파일 삭제됨
|
||||
|
||||
/// 장비 테스트 실행기
|
||||
const bool RUN_EXTERNAL_TESTS = bool.fromEnvironment('RUN_EXTERNAL_TESTS');
|
||||
void main() {
|
||||
if (!RUN_EXTERNAL_TESTS) {
|
||||
test('External tests disabled', () {}, skip: 'Enable with --dart-define=RUN_EXTERNAL_TESTS=true');
|
||||
return;
|
||||
}
|
||||
group('장비 화면 자동 테스트', () {
|
||||
|
||||
setUpAll(() async {
|
||||
@@ -71,4 +76,4 @@ void main() {
|
||||
// reason: '${results['failedTests']}개의 테스트가 실패했습니다.');
|
||||
}, timeout: Timeout(Duration(minutes: 10)));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -651,7 +651,12 @@ class FilterSortTest {
|
||||
}
|
||||
|
||||
/// 테스트 실행
|
||||
const bool RUN_EXTERNAL_TESTS = bool.fromEnvironment('RUN_EXTERNAL_TESTS');
|
||||
void main() async {
|
||||
if (!RUN_EXTERNAL_TESTS) {
|
||||
test('External tests disabled', () {}, skip: 'Enable with --dart-define=RUN_EXTERNAL_TESTS=true');
|
||||
return;
|
||||
}
|
||||
// 실제 API 환경 설정
|
||||
await RealApiTestHelper.setupTestEnvironment();
|
||||
final getIt = GetIt.instance;
|
||||
@@ -675,4 +680,4 @@ void main() async {
|
||||
await tester.runAllTests();
|
||||
}, timeout: Timeout(Duration(minutes: 10)));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -590,7 +590,12 @@ class FormSubmissionTest {
|
||||
}
|
||||
|
||||
/// 테스트 실행
|
||||
const bool RUN_EXTERNAL_TESTS = bool.fromEnvironment('RUN_EXTERNAL_TESTS');
|
||||
void main() async {
|
||||
if (!RUN_EXTERNAL_TESTS) {
|
||||
test('External tests disabled', () {}, skip: 'Enable with --dart-define=RUN_EXTERNAL_TESTS=true');
|
||||
return;
|
||||
}
|
||||
// 실제 API 환경 설정
|
||||
await RealApiTestHelper.setupTestEnvironment();
|
||||
final getIt = GetIt.instance;
|
||||
@@ -614,4 +619,4 @@ void main() async {
|
||||
await tester.runAllTests();
|
||||
}, timeout: Timeout(Duration(minutes: 10)));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -487,7 +487,12 @@ class InteractiveSearchTest {
|
||||
}
|
||||
|
||||
/// 테스트 실행
|
||||
const bool RUN_EXTERNAL_TESTS = bool.fromEnvironment('RUN_EXTERNAL_TESTS');
|
||||
void main() async {
|
||||
if (!RUN_EXTERNAL_TESTS) {
|
||||
test('External tests disabled', () {}, skip: 'Enable with --dart-define=RUN_EXTERNAL_TESTS=true');
|
||||
return;
|
||||
}
|
||||
// 실제 API 환경 설정
|
||||
await RealApiTestHelper.setupTestEnvironment();
|
||||
final getIt = GetIt.instance;
|
||||
@@ -511,4 +516,4 @@ void main() async {
|
||||
await tester.runAllTests();
|
||||
}, timeout: Timeout(Duration(minutes: 5)));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -472,7 +472,12 @@ Future<TestResult> runOverviewTests({
|
||||
}
|
||||
|
||||
/// 독립 실행용 main 함수
|
||||
const bool RUN_EXTERNAL_TESTS = bool.fromEnvironment('RUN_EXTERNAL_TESTS');
|
||||
void main() {
|
||||
if (!RUN_EXTERNAL_TESTS) {
|
||||
test('External tests disabled', () {}, skip: 'Enable with --dart-define=RUN_EXTERNAL_TESTS=true');
|
||||
return;
|
||||
}
|
||||
late Dio dio;
|
||||
late String authToken;
|
||||
const String baseUrl = 'http://43.201.34.104:8080/api/v1';
|
||||
@@ -893,4 +898,4 @@ void main() {
|
||||
tearDownAll(() {
|
||||
dio.close();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ class PaginationTest {
|
||||
'page': 1,
|
||||
'perPage': 5,
|
||||
'count': page1.items.length,
|
||||
'firstItem': page1.items.isNotEmpty ? page1.items.first.name : null,
|
||||
'firstItem': page1.items.isNotEmpty ? page1.items.first.serialNumber : null,
|
||||
});
|
||||
|
||||
// 2. 두 번째 페이지 조회
|
||||
@@ -583,4 +583,4 @@ void main() async {
|
||||
await tester.runAllTests();
|
||||
}, timeout: Timeout(Duration(minutes: 10)));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,12 @@ import '../real_api/test_helper.dart';
|
||||
// import 'framework/core/test_auth_service.dart'; // 파일 삭제됨
|
||||
|
||||
/// 간단한 API 테스트 실행
|
||||
const bool RUN_EXTERNAL_TESTS = bool.fromEnvironment('RUN_EXTERNAL_TESTS');
|
||||
void main() {
|
||||
if (!RUN_EXTERNAL_TESTS) {
|
||||
test('External tests disabled', () {}, skip: 'Enable with --dart-define=RUN_EXTERNAL_TESTS=true');
|
||||
return;
|
||||
}
|
||||
group('간단한 API 연결 테스트', () {
|
||||
late GetIt getIt;
|
||||
late ApiClient apiClient;
|
||||
@@ -105,4 +110,4 @@ void main() {
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -429,7 +429,12 @@ Future<TestResult> runUserTests({
|
||||
);
|
||||
}
|
||||
|
||||
const bool RUN_EXTERNAL_TESTS = bool.fromEnvironment('RUN_EXTERNAL_TESTS');
|
||||
void main() async {
|
||||
if (!RUN_EXTERNAL_TESTS) {
|
||||
test('External tests disabled', () {}, skip: 'Enable with --dart-define=RUN_EXTERNAL_TESTS=true');
|
||||
return;
|
||||
}
|
||||
// 테스트용 Dio 인스턴스 생성
|
||||
final dio = Dio();
|
||||
dio.options.connectTimeout = const Duration(seconds: 10);
|
||||
@@ -465,4 +470,4 @@ void main() async {
|
||||
} finally {
|
||||
dio.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -511,7 +511,12 @@ Future<TestResult> runWarehouseTests({
|
||||
}
|
||||
|
||||
/// 독립 실행용 main 함수
|
||||
const bool RUN_EXTERNAL_TESTS = bool.fromEnvironment('RUN_EXTERNAL_TESTS');
|
||||
void main() {
|
||||
if (!RUN_EXTERNAL_TESTS) {
|
||||
test('External tests disabled', () {}, skip: 'Enable with --dart-define=RUN_EXTERNAL_TESTS=true');
|
||||
return;
|
||||
}
|
||||
late Dio dio;
|
||||
late String authToken;
|
||||
const String baseUrl = 'http://43.201.34.104:8080/api/v1';
|
||||
@@ -573,4 +578,4 @@ void main() {
|
||||
tearDownAll(() {
|
||||
dio.close();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,12 @@ import 'package:superport/models/address_model.dart';
|
||||
import 'package:superport/models/equipment_unified_model.dart';
|
||||
import 'package:superport/utils/phone_utils.dart';
|
||||
|
||||
const bool RUN_EXTERNAL_TESTS = bool.fromEnvironment('RUN_EXTERNAL_TESTS');
|
||||
void main() {
|
||||
if (!RUN_EXTERNAL_TESTS) {
|
||||
test('External tests disabled', () {}, skip: 'Enable with --dart-define=RUN_EXTERNAL_TESTS=true');
|
||||
return;
|
||||
}
|
||||
TestWidgetsFlutterBinding.ensureInitialized();
|
||||
late WarehouseService warehouseService;
|
||||
late CompanyService companyService;
|
||||
@@ -252,4 +257,4 @@ void main() {
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user