Skip to content

Commit

Permalink
[Presentation] Minor improvements to the settings page
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolfteam committed Sep 18, 2022
1 parent 99bdbd6 commit 0136c83
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 4 deletions.
5 changes: 4 additions & 1 deletion CastIt.Android/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 2YH5NN7YP5;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
Expand Down Expand Up @@ -498,6 +499,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 2YH5NN7YP5;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
Expand Down Expand Up @@ -528,6 +530,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 2YH5NN7YP5;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
Expand Down Expand Up @@ -576,4 +579,4 @@
/* End XCConfigurationList section */
};
rootObject = 97C146E61CF9000F007C117D /* Project object */;
}
}
66 changes: 63 additions & 3 deletions CastIt.Android/lib/presentation/settings/settings_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,32 @@ import 'package:castit/presentation/settings/widgets/player_settings_card.dart';
import 'package:castit/presentation/settings/widgets/theme_settings_card.dart';
import 'package:castit/presentation/shared/page_header.dart';
import 'package:flutter/material.dart';
import 'package:responsive_builder/responsive_builder.dart';

class SettingsPage extends StatelessWidget {
const SettingsPage({super.key});

class SettingsPage extends StatefulWidget {
@override
_SettingsPageState createState() => _SettingsPageState();
Widget build(BuildContext context) {
final isPortrait = MediaQuery.of(context).orientation == Orientation.portrait;
return Scaffold(
body: SafeArea(
child: ResponsiveBuilder(
builder: (ctx, size) => isPortrait ? const _MobileLayout() : const _DesktopTabletLayout(),
),
),
);
}
}

class _SettingsPageState extends State<SettingsPage> with AutomaticKeepAliveClientMixin<SettingsPage> {
class _MobileLayout extends StatefulWidget {
const _MobileLayout();

@override
State<_MobileLayout> createState() => _MobileLayoutState();
}

class _MobileLayoutState extends State<_MobileLayout> with AutomaticKeepAliveClientMixin<_MobileLayout> {
final _scrollController = ScrollController();

@override
Expand Down Expand Up @@ -50,3 +69,44 @@ class _SettingsPageState extends State<SettingsPage> with AutomaticKeepAliveClie
);
}
}

class _DesktopTabletLayout extends StatelessWidget {
const _DesktopTabletLayout();

@override
Widget build(BuildContext context) {
final i18n = S.of(context);
return ListView(
padding: const EdgeInsets.all(10),
shrinkWrap: true,
children: [
PageHeader(
title: i18n.settings,
icon: Icons.settings,
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
children: const [
ThemeSettingsCard(),
AccentColorSettingsCard(),
LanguageSettingsCard(),
AboutSettingsCard(),
],
),
),
Expanded(
child: Column(
children: const [
PlayerSettingsCard(),
],
),
),
],
),
],
);
}
}

0 comments on commit 0136c83

Please sign in to comment.