mirror of
https://ghfast.top/https://github.com/StarCitizenToolBox/app.git
synced 2025-06-28 02:04:44 +08:00
ui optimization
This commit is contained in:
@ -7,7 +7,6 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:starcitizen_doctor/api/analytics.dart';
|
||||
import 'package:starcitizen_doctor/common/helper/system_helper.dart';
|
||||
import 'package:starcitizen_doctor/ui/tools/tools_ui_model.dart';
|
||||
import 'package:starcitizen_doctor/widgets/widgets.dart';
|
||||
import 'package:url_launcher/url_launcher_string.dart';
|
||||
@ -168,15 +167,6 @@ class HomeUI extends HookConsumerWidget {
|
||||
),
|
||||
)),
|
||||
const SizedBox(width: 12),
|
||||
Button(
|
||||
onPressed: () =>
|
||||
SystemHelper.openDir("${homeState.scInstalledPath}"),
|
||||
child: const Padding(
|
||||
padding: EdgeInsets.all(6),
|
||||
child: Icon(FluentIcons.folder_open),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Button(
|
||||
onPressed: model.reScanPath,
|
||||
child: const Padding(
|
||||
|
@ -77,8 +77,9 @@ class LocalizationDialogUI extends HookConsumerWidget {
|
||||
}),
|
||||
),
|
||||
),
|
||||
makeToolsListContainer(context, model, state),
|
||||
makeListContainer(
|
||||
S.current.localization_info_translation_status,
|
||||
S.current.localization_info_translation,
|
||||
[
|
||||
if (state.patchStatus == null)
|
||||
makeLoading(context)
|
||||
@ -140,30 +141,41 @@ class LocalizationDialogUI extends HookConsumerWidget {
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Container(
|
||||
color: Colors.white.withOpacity(.1),
|
||||
height: 1,
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
if (state.apiLocalizationData == null)
|
||||
makeLoading(context)
|
||||
else if (state.apiLocalizationData!.isEmpty)
|
||||
Center(
|
||||
child: Text(
|
||||
S.current
|
||||
.localization_info_no_translation_available,
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: Colors.white.withOpacity(.8)),
|
||||
),
|
||||
)
|
||||
else
|
||||
AlignedGridView.count(
|
||||
crossAxisCount: 2,
|
||||
crossAxisSpacing: 12,
|
||||
mainAxisSpacing: 12,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
final item = state.apiLocalizationData!.entries
|
||||
.elementAt(index);
|
||||
return makeRemoteList(context, model, item, state);
|
||||
},
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemCount: state.apiLocalizationData?.length ?? 0,
|
||||
)
|
||||
],
|
||||
],
|
||||
context),
|
||||
makeListContainer(
|
||||
S.current.localization_info_community_translation,
|
||||
[
|
||||
if (state.apiLocalizationData == null)
|
||||
makeLoading(context)
|
||||
else if (state.apiLocalizationData!.isEmpty)
|
||||
Center(
|
||||
child: Text(
|
||||
S.current.localization_info_no_translation_available,
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: Colors.white.withOpacity(.8)),
|
||||
),
|
||||
)
|
||||
else
|
||||
for (final item in state.apiLocalizationData!.entries)
|
||||
makeRemoteList(context, model, item, state),
|
||||
],
|
||||
context,
|
||||
gridViewMode: true),
|
||||
makeToolsListContainer(context, model, state),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
@ -220,7 +220,14 @@ class ToolsUI extends HookConsumerWidget {
|
||||
padding: EdgeInsets.all(6),
|
||||
child: Icon(FluentIcons.folder_open),
|
||||
),
|
||||
onPressed: () => model.openDir(state.scInstalledPath))
|
||||
onPressed: () {
|
||||
if (state.scInstalledPath.trim().isEmpty) {
|
||||
showToast(context,
|
||||
S.current.tools_action_info_star_citizen_not_found);
|
||||
return;
|
||||
}
|
||||
model.openDir(state.scInstalledPath);
|
||||
})
|
||||
],
|
||||
);
|
||||
}
|
||||
@ -258,7 +265,16 @@ class ToolsUI extends HookConsumerWidget {
|
||||
padding: EdgeInsets.all(6),
|
||||
child: Icon(FluentIcons.folder_open),
|
||||
),
|
||||
onPressed: () => model.openDir(state.rsiLauncherInstalledPath))
|
||||
onPressed: () {
|
||||
if (state.scInstalledPath.trim().isEmpty) {
|
||||
showToast(
|
||||
context,
|
||||
S.current
|
||||
.tools_rsi_launcher_enhance_msg_error_launcher_notfound);
|
||||
return;
|
||||
}
|
||||
model.openDir(state.rsiLauncherInstalledPath);
|
||||
})
|
||||
],
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user