- Created generated_plugin_registrant.cc and generated_plugin_registrant.h to manage plugin registration. - Added generated_plugins.cmake for plugin configuration in CMake. - Implemented CMakeLists.txt for the Windows runner, defining build settings and dependencies. - Created Runner.rc for application resources including versioning and icons. - Developed flutter_window.cpp and flutter_window.h to manage the Flutter window lifecycle. - Implemented main.cpp as the entry point for the Windows application. - Added resource.h for resource definitions. - Included app icon in resources. - Created runner.exe.manifest for application settings. - Developed utils.cpp and utils.h for console management and command line argument handling. - Implemented win32_window.cpp and win32_window.h for high DPI-aware window management.
315 lines
14 KiB
Dart
315 lines
14 KiB
Dart
import 'package:marco/helpers/theme/theme_customizer.dart';
|
|
import 'package:marco/helpers/utils/mixins/ui_mixin.dart';
|
|
import 'package:marco/helpers/widgets/my_spacing.dart';
|
|
import 'package:marco/helpers/widgets/my_text.dart';
|
|
import 'package:marco/widgets/custom_switch.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
// typedef void OnLeftBarColorSchemeChange(LeftBarThemeType leftBarThemeType);
|
|
// typedef void OnTopBarColorSchemeChange(TopBarThemeType topBarThemeType);
|
|
// typedef void OnRightBarColorSchemeChange(RightBarThemeType topBarThemeType);
|
|
// typedef void OnContentSchemeChange(ContentThemeType contentThemeType);
|
|
|
|
class RightBar extends StatefulWidget {
|
|
// final RightBarThemeType rightBarThemeType;
|
|
// final LeftBarThemeType leftBarThemeType;
|
|
// final TopBarThemeType topBarThemeType;
|
|
// final ContentThemeType contentThemeType;
|
|
// final OnLeftBarColorSchemeChange onLeftBarColorSchemeChange;
|
|
// final OnTopBarColorSchemeChange onTopBarColorSchemeChange;
|
|
// final OnRightBarColorSchemeChange onRightBarColorSchemeChange;
|
|
// final OnContentSchemeChange onContentSchemeChange;
|
|
|
|
const RightBar({
|
|
super.key, // this.leftBarThemeType,
|
|
// this.topBarThemeType,
|
|
// this.contentThemeType,
|
|
// this.onLeftBarColorSchemeChange,
|
|
// this.onTopBarColorSchemeChange,
|
|
// this.onContentSchemeChange,
|
|
// this.onRightBarColorSchemeChange
|
|
});
|
|
|
|
@override
|
|
_RightBarState createState() => _RightBarState();
|
|
}
|
|
|
|
class _RightBarState extends State<RightBar>
|
|
with SingleTickerProviderStateMixin, UIMixin {
|
|
ThemeCustomizer customizer = ThemeCustomizer.instance;
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
customizer = ThemeCustomizer.instance;
|
|
return Container(
|
|
width: 280,
|
|
color: colorScheme.surface,
|
|
child: Column(
|
|
children: [
|
|
Container(
|
|
height: 60,
|
|
alignment: Alignment.centerLeft,
|
|
padding: MySpacing.x(24),
|
|
color: colorScheme.primaryContainer,
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
Expanded(
|
|
child: MyText.labelLarge(
|
|
"Settings",
|
|
color: colorScheme.onPrimaryContainer,
|
|
),
|
|
),
|
|
InkWell(
|
|
onTap: () {
|
|
Navigator.of(context).pop();
|
|
},
|
|
child: Icon(
|
|
Icons.close,
|
|
size: 18,
|
|
color: colorScheme.onPrimaryContainer,
|
|
),
|
|
)
|
|
],
|
|
),
|
|
),
|
|
Expanded(
|
|
child: Container(
|
|
padding: MySpacing.all(24),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
MyText.labelMedium("Color Scheme"),
|
|
Divider(),
|
|
MySpacing.height(8),
|
|
Row(
|
|
children: [
|
|
CustomSwitch.small(
|
|
value: customizer.theme == ThemeMode.light,
|
|
onChanged: (value) {
|
|
ThemeCustomizer.setTheme(ThemeMode.light);
|
|
},
|
|
),
|
|
MySpacing.width(12),
|
|
Text(
|
|
"Light",
|
|
)
|
|
],
|
|
),
|
|
MySpacing.height(8),
|
|
Row(
|
|
children: [
|
|
CustomSwitch.small(
|
|
value: customizer.theme == ThemeMode.dark,
|
|
onChanged: (value) {
|
|
ThemeCustomizer.setTheme(ThemeMode.dark);
|
|
},
|
|
),
|
|
MySpacing.width(12),
|
|
Text(
|
|
"Dark",
|
|
)
|
|
],
|
|
),
|
|
// Spacing.height(8),
|
|
// Row(
|
|
// children: [
|
|
// CustomSwitch.small(
|
|
// value: widget.contentThemeType == ContentThemeType.dark,
|
|
// activeBorderColor: rightBarTheme.activeSwitchBorderColor,
|
|
// inactiveBorderColor: rightBarTheme.inactiveSwitchBorderColor,
|
|
// inactiveTrackColor: rightBarTheme.disabled,
|
|
// activeTrackColor: rightBarTheme.primary,
|
|
// inactiveThumbColor: rightBarTheme.onDisabled,
|
|
// activeThumbColor: rightBarTheme.onPrimary,
|
|
// onChanged: (value) {
|
|
// if (value && widget.onContentSchemeChange != null) {
|
|
// widget.onContentSchemeChange(ContentThemeType.dark);
|
|
// }
|
|
// },
|
|
// ),
|
|
// Spacing.width(12),
|
|
// Text(
|
|
// "Dark",
|
|
// style: AppTheme.getTextStyle(themeData.textTheme.bodyText2,
|
|
// color: rightBarTheme.onBackground),
|
|
// )
|
|
// ],
|
|
// ),
|
|
// Spacing.height(36),
|
|
// Text("Left Bar",
|
|
// style: AppTheme.getTextStyle(themeData.textTheme.bodyText1,
|
|
// color: rightBarTheme.onBackground, fontWeight: 600)),
|
|
Divider(),
|
|
// Spacing.height(8),
|
|
// Row(
|
|
// children: [
|
|
// CustomSwitch.small(
|
|
// value: widget.leftBarThemeType == LeftBarThemeType.light,
|
|
// activeBorderColor: rightBarTheme.activeSwitchBorderColor,
|
|
// inactiveBorderColor: rightBarTheme.inactiveSwitchBorderColor,
|
|
// inactiveTrackColor: rightBarTheme.disabled,
|
|
// activeTrackColor: rightBarTheme.primary,
|
|
// inactiveThumbColor: rightBarTheme.onDisabled,
|
|
// activeThumbColor: rightBarTheme.onPrimary,
|
|
// onChanged: (value) {
|
|
// if (value && widget.onLeftBarColorSchemeChange != null) {
|
|
// widget.onLeftBarColorSchemeChange(LeftBarThemeType.light);
|
|
// }
|
|
// },
|
|
// ),
|
|
// Spacing.width(12),
|
|
// Text(
|
|
// "Light",
|
|
// style: AppTheme.getTextStyle(themeData.textTheme.bodyText2,
|
|
// color: rightBarTheme.onBackground),
|
|
// )
|
|
// ],
|
|
// ),
|
|
// Spacing.height(8),
|
|
// Row(
|
|
// children: [
|
|
// CustomSwitch.small(
|
|
// value: widget.leftBarThemeType == LeftBarThemeType.dark,
|
|
// activeBorderColor: rightBarTheme.activeSwitchBorderColor,
|
|
// inactiveBorderColor: rightBarTheme.inactiveSwitchBorderColor,
|
|
// inactiveTrackColor: rightBarTheme.disabled,
|
|
// activeTrackColor: rightBarTheme.primary,
|
|
// inactiveThumbColor: rightBarTheme.onDisabled,
|
|
// activeThumbColor: rightBarTheme.onPrimary,
|
|
// onChanged: (value) {
|
|
// if (value && widget.onLeftBarColorSchemeChange != null) {
|
|
// widget.onLeftBarColorSchemeChange(LeftBarThemeType.dark);
|
|
// }
|
|
// },
|
|
// ),
|
|
// Spacing.width(12),
|
|
// Text(
|
|
// "Dark",
|
|
// style: AppTheme.getTextStyle(themeData.textTheme.bodyText2,
|
|
// color: rightBarTheme.onBackground),
|
|
// )
|
|
// ],
|
|
// ),
|
|
// Spacing.height(36),
|
|
Text("Top Bar"),
|
|
Divider(),
|
|
// Spacing.height(8),
|
|
// Row(
|
|
// children: [
|
|
// CustomSwitch.small(
|
|
// value: widget.topBarThemeType == TopBarThemeType.light,
|
|
// inactiveTrackColor: rightBarTheme.disabled,
|
|
// activeBorderColor: rightBarTheme.activeSwitchBorderColor,
|
|
// inactiveBorderColor: rightBarTheme.inactiveSwitchBorderColor,
|
|
// activeTrackColor: rightBarTheme.primary,
|
|
// inactiveThumbColor: rightBarTheme.onDisabled,
|
|
// activeThumbColor: rightBarTheme.onPrimary,
|
|
// onChanged: (value) {
|
|
// if (value && widget.onTopBarColorSchemeChange != null) {
|
|
// widget.onTopBarColorSchemeChange(TopBarThemeType.light);
|
|
// }
|
|
// },
|
|
// ),
|
|
// Spacing.width(12),
|
|
// Text(
|
|
// "Light",
|
|
// style: AppTheme.getTextStyle(themeData.textTheme.bodyText2,
|
|
// color: rightBarTheme.onBackground),
|
|
// )
|
|
// ],
|
|
// ),
|
|
// Spacing.height(8),
|
|
// Row(
|
|
// children: [
|
|
// CustomSwitch.small(
|
|
// value: widget.topBarThemeType == TopBarThemeType.dark,
|
|
// inactiveTrackColor: rightBarTheme.disabled,
|
|
// activeBorderColor: rightBarTheme.activeSwitchBorderColor,
|
|
// inactiveBorderColor: rightBarTheme.inactiveSwitchBorderColor,
|
|
// activeTrackColor: rightBarTheme.primary,
|
|
// inactiveThumbColor: rightBarTheme.onDisabled,
|
|
// activeThumbColor: rightBarTheme.onPrimary,
|
|
// onChanged: (value) {
|
|
// if (value && widget.onTopBarColorSchemeChange != null) {
|
|
// widget.onTopBarColorSchemeChange(TopBarThemeType.dark);
|
|
// }
|
|
// },
|
|
// ),
|
|
// Spacing.width(12),
|
|
// Text(
|
|
// "Dark",
|
|
// style: AppTheme.getTextStyle(themeData.textTheme.bodyText2,
|
|
// color: rightBarTheme.onBackground),
|
|
// )
|
|
// ],
|
|
// ),
|
|
// Spacing.height(36),
|
|
// Text("Right Bar",
|
|
// style: AppTheme.getTextStyle(themeData.textTheme.bodyText1,
|
|
// color: rightBarTheme.onBackground, fontWeight: 600)),
|
|
// Divider(),
|
|
// Spacing.height(8),
|
|
// Row(
|
|
// children: [
|
|
// CustomSwitch.small(
|
|
// value: widget.rightBarThemeType == RightBarThemeType.light,
|
|
// inactiveTrackColor: rightBarTheme.disabled,
|
|
// activeBorderColor: rightBarTheme.activeSwitchBorderColor,
|
|
// inactiveBorderColor: rightBarTheme.inactiveSwitchBorderColor,
|
|
// activeTrackColor: rightBarTheme.primary,
|
|
// inactiveThumbColor: rightBarTheme.onDisabled,
|
|
// activeThumbColor: rightBarTheme.onPrimary,
|
|
// onChanged: (value) {
|
|
// if (value && widget.onRightBarColorSchemeChange != null) {
|
|
// widget.onRightBarColorSchemeChange(RightBarThemeType.light);
|
|
// }
|
|
// },
|
|
// ),
|
|
// Spacing.width(12),
|
|
// Text(
|
|
// "Light",
|
|
// style: AppTheme.getTextStyle(themeData.textTheme.bodyText2,
|
|
// color: rightBarTheme.onBackground),
|
|
// )
|
|
// ],
|
|
// ),
|
|
// Spacing.height(8),
|
|
// Row(
|
|
// children: [
|
|
// CustomSwitch.small(
|
|
// value: widget.rightBarThemeType == RightBarThemeType.dark,
|
|
// inactiveTrackColor: rightBarTheme.disabled,
|
|
// activeBorderColor: rightBarTheme.activeSwitchBorderColor,
|
|
// inactiveBorderColor: rightBarTheme.inactiveSwitchBorderColor,
|
|
// activeTrackColor: rightBarTheme.primary,
|
|
// inactiveThumbColor: rightBarTheme.onDisabled,
|
|
// activeThumbColor: rightBarTheme.onPrimary,
|
|
// onChanged: (value) {
|
|
// if (value && widget.onRightBarColorSchemeChange != null) {
|
|
// widget.onRightBarColorSchemeChange(RightBarThemeType.dark);
|
|
// }
|
|
// },
|
|
// ),
|
|
// Spacing.width(12),
|
|
// Text(
|
|
// "Dark",
|
|
// style: AppTheme.getTextStyle(themeData.textTheme.bodyText2,
|
|
// color: rightBarTheme.onBackground),
|
|
// )
|
|
// ],
|
|
// ),
|
|
],
|
|
),
|
|
))
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|