Skip to content

Commit

Permalink
fix: webLanding on small screen
Browse files Browse the repository at this point in the history
  • Loading branch information
MuZhou233 committed Feb 2, 2024
1 parent 06172f1 commit e37f921
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
8 changes: 6 additions & 2 deletions lib/route.dart
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,12 @@ GoRouter getRouter(MainBloc mainBloc, ApiHelper apiHelper) {
),
GoRoute(
path: AppRoutes.webLanding.toString(),
pageBuilder: (context, state) =>
const NoTransitionPage(child: WebLandingPage()),
pageBuilder: (context, state) => NoTransitionPage(
child: MainWindow(
key: mainWindowKey,
child: const WebLandingPage(),
),
),
),
GoRoute(
path: '${AppRoutes._imageViewer}/:index',
Expand Down
24 changes: 17 additions & 7 deletions lib/view/pages/web_landing_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import '../../bloc/main_bloc.dart';
import '../../common/platform.dart';
import '../../consts.dart';
import '../../l10n/l10n.dart';
import '../../model/common_model.dart';
import '../../route.dart';
import '../components/toast.dart';
import '../helper/spacing.dart';
Expand Down Expand Up @@ -63,8 +64,11 @@ class WebLandingPage extends StatelessWidget {
if (DotEnvValue.host.isNotEmpty)
Container(
padding: const EdgeInsets.only(top: 16),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
child: Wrap(
alignment: WrapAlignment.center,
runAlignment: WrapAlignment.center,
spacing: 16,
runSpacing: 16,
children: [
ElevatedButton.icon(
onPressed: () async {
Expand All @@ -85,7 +89,6 @@ class WebLandingPage extends StatelessWidget {
.icon),
label: Text(S.of(context).connectInClient),
),
const SizedBox(width: 16),
ElevatedButton.icon(
onPressed: () async {
final host = DotEnvValue.host;
Expand Down Expand Up @@ -128,8 +131,11 @@ class WebLandingPage extends StatelessWidget {
S.of(context).downloadClient,
),
const SizedBox(height: 16),
Row(
mainAxisAlignment: MainAxisAlignment.center,
Wrap(
alignment: WrapAlignment.center,
runAlignment: WrapAlignment.center,
spacing: 16,
runSpacing: 16,
children: [
ElevatedButton.icon(
onPressed:
Expand All @@ -149,7 +155,6 @@ class WebLandingPage extends StatelessWidget {
const FaIcon(FontAwesomeIcons.windows).icon),
label: const Text('Windows'),
),
const SizedBox(width: 16),
ElevatedButton.icon(
onPressed:
DotEnvValue.andClientDownloadUrl.isNotEmpty
Expand All @@ -175,7 +180,12 @@ class WebLandingPage extends StatelessWidget {
const SizedBox(height: 16),
OutlinedButton(
onPressed: () {
ServerSelectOverlay.of(context)?.fullscreen();
AppRoutes.tiphereth.go(context);
context.read<MainBloc>().add(
MainSetNextServerConfigEvent(
ServerConfig.empty(),
),
);
},
child: Text(S.of(context).continueInWebVersion),
),
Expand Down

0 comments on commit e37f921

Please sign in to comment.