Gitea CI / Build Android APK (pull_request) Canceled after 0s
Gitea CI / Build Windows x64 app (pull_request) Canceled after 0s
Gitea CI / Audit and package Windows x64 (pull_request) Canceled after 0s
Gitea CI / Assemble and validate CI artifacts (pull_request) Canceled after 0s
Gitea CI / Gitea CI passed (pull_request) Canceled after 0s
Gitea CI / Check code and tests (pull_request) Canceled after 6m29s
36 lines
1.1 KiB
Dart
36 lines
1.1 KiB
Dart
import 'dart:math' as math;
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:cutdex_ui/theme.dart';
|
|
import 'package:cutdex_ui/widgets.dart';
|
|
|
|
import '../../l10n/l10n.dart';
|
|
import 'settings_content.dart';
|
|
|
|
/// Dialog adapter for embedded settings hosts.
|
|
class SettingsDialog extends StatelessWidget {
|
|
const SettingsDialog({super.key, this.workspace, this.initialTab = 0});
|
|
final (String, String)? workspace;
|
|
final int initialTab;
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final viewport = MediaQuery.sizeOf(context);
|
|
return Theme(
|
|
data: AppTheme.settingsContentTheme(Theme.of(context)),
|
|
child: AppDialog(
|
|
title: context.l10n.settings,
|
|
closeLabel: context.l10n.closeSettings,
|
|
width: math.min(1120, math.max(560, viewport.width * .9)),
|
|
height: math.min(704, math.max(520, viewport.height * .88)),
|
|
contentOnly: true,
|
|
scrollContent: false,
|
|
child: SettingsContent(
|
|
workspace: workspace,
|
|
initialTab: initialTab,
|
|
onBack: () => Navigator.of(context).pop(),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|