Skip to content

Commit

Permalink
feat: Update Ansible Semaphore Client.
Browse files Browse the repository at this point in the history
  • Loading branch information
GSMLG-BOT committed Sep 29, 2023
1 parent 4118f8b commit bc27d9f
Show file tree
Hide file tree
Showing 81 changed files with 6,602 additions and 791 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2022 Jonathan Gao
Copyright (c) 2023 Jonathan Gao

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ Run ansible task from your phone.

## Getting Started

Download from
Download from

- [AppStore]()
- [PlayStore](https://play.google.com/store/apps/details?id=org.gsmlg.semaphore)
- [F-Droid]()

## Screens

![](docs/screens/drawer.png)
![](docs/screens/template.png)
![](docs/screens/task_output.png)
Light Mode | Dark Mode
:-------------------------:|:-------------------------:
![](fastlane/metadata/android/en-US/images/phoneScreenshots/1.png) | ![](fastlane/metadata/android/en-US/images/phoneScreenshots/2.png)
![](fastlane/metadata/android/en-US/images/phoneScreenshots/4.png) | ![](fastlane/metadata/android/en-US/images/phoneScreenshots/3.png)
11 changes: 11 additions & 0 deletions lib/adaptive/alert_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ adaptiveAlertDialog({
message: content,
//horizontalActions: false,
primaryButton: PushButton(
color: primaryButton.color,
controlSize: ControlSize.large,
onPressed: primaryButton.onPressed,
child: primaryButton.child,
),
secondaryButton: secondaryButton != null
? PushButton(
color: secondaryButton.color,
secondary: true,
controlSize: ControlSize.large,
onPressed: secondaryButton.onPressed,
Expand All @@ -45,16 +47,25 @@ adaptiveAlertDialog({
actions: secondaryButton == null
? <Widget>[
TextButton(
style: ButtonStyle(
textStyle: MaterialStateProperty.all(
TextStyle(color: primaryButton.color))),
onPressed: primaryButton.onPressed,
child: primaryButton.child,
),
]
: <Widget>[
TextButton(
style: ButtonStyle(
textStyle: MaterialStateProperty.all(
TextStyle(color: secondaryButton.color))),
onPressed: secondaryButton.onPressed,
child: secondaryButton.child,
),
TextButton(
style: ButtonStyle(
textStyle: MaterialStateProperty.all(
TextStyle(color: primaryButton.color))),
onPressed: primaryButton.onPressed,
child: primaryButton.child,
),
Expand Down
16 changes: 11 additions & 5 deletions lib/adaptive/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ class AdaptiveApp extends StatelessWidget {
final String title;
final RouterConfig<Object>? routerConfig;
final ThemeMode themeMode;
final AppThemeData appThemeData;
final Color accentColor;

const AdaptiveApp({
super.key,
this.title = Constants.appName,
this.debugShowCheckedModeBanner = false,
this.routerConfig,
this.themeMode = ThemeMode.system,
required this.appThemeData,
required this.accentColor,
});

const AdaptiveApp.router({
Expand All @@ -27,12 +27,17 @@ class AdaptiveApp extends StatelessWidget {
this.debugShowCheckedModeBanner = false,
this.routerConfig,
this.themeMode = ThemeMode.system,
required this.appThemeData,
required this.accentColor,
});

@override
Widget build(BuildContext context) {
if (Platform.isMacOS) {
final lightTheme = MacosThemeData.light().copyWith(
primaryColor: accentColor,
);
final darkTheme =
MacosThemeData.dark().copyWith(primaryColor: accentColor);
return MacosApp.router(
localizationsDelegates: const <LocalizationsDelegate<dynamic>>[
DefaultMaterialLocalizations.delegate,
Expand All @@ -42,11 +47,12 @@ class AdaptiveApp extends StatelessWidget {
routerConfig: routerConfig,
title: title,
themeMode: themeMode,
// theme: MacosThemeData.light(),
darkTheme: MacosThemeData.dark(),
theme: lightTheme,
darkTheme: darkTheme,
);
}

final appThemeData = AppThemeData.fromSeed(accentColor);
return MaterialApp.router(
debugShowCheckedModeBanner: debugShowCheckedModeBanner,
routerConfig: routerConfig,
Expand Down
13 changes: 11 additions & 2 deletions lib/adaptive/button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,36 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:macos_ui/macos_ui.dart';
import 'package:material_neumorphic/material_neumorphic.dart'
show NeumorphicButton;
show NeumorphicButton, NeumorphicTheme;

class AdaptiveButton extends StatelessWidget {
final Function()? onPressed;
final Widget child;
final ControlSize controlSize;
final Color? color;

const AdaptiveButton({
super.key,
this.onPressed,
this.color,
this.child = const SizedBox(),
this.controlSize = ControlSize.regular,
});

@override
Widget build(BuildContext context) {
if (Platform.isMacOS) {
// final macosTheme = MacosTheme.of(context);
return PushButton(
controlSize: controlSize, onPressed: onPressed, child: child);
color: color,
controlSize: controlSize,
onPressed: onPressed,
child: child);
}
final theme = Theme.of(context);
final neumorphicTheme = theme.extension<NeumorphicTheme>()!;
return NeumorphicButton(
style: neumorphicTheme.styleWith(color: color),
onPressed: onPressed,
child: child,
);
Expand Down
5 changes: 4 additions & 1 deletion lib/adaptive/dropdown.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ class AdaptiveDropdownMenu<T> extends StatelessWidget {
children: [
decoration?.labelText != null
? Text(decoration!.labelText!, style: theme.typography.headline)
: Container(),
: const SizedBox(),
decoration?.labelText != null
? const SizedBox(height: 12.0)
: const SizedBox(),
MacosPopupButton<T?>(
key: key,
value: value,
Expand Down
1 change: 1 addition & 0 deletions lib/adaptive/floatingAction.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class AdaptiveFloatingAction {

Widget floatingActionButton() {
return NeumorphicFloatingActionButton(
tooltip: label,
onPressed: onPressed,
child: icon,
);
Expand Down
16 changes: 11 additions & 5 deletions lib/adaptive/icon_button.dart
Original file line number Diff line number Diff line change
@@ -1,27 +1,33 @@
import 'dart:io' show Platform;

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:macos_ui/macos_ui.dart';

class AdaptiveIconButton extends StatelessWidget {
final Function()? onPressed;
final IconData? iconData;
final Widget icon;
final String? label;

const AdaptiveIconButton({
super.key,
this.onPressed,
this.iconData,
this.label,
required this.icon,
});

@override
Widget build(BuildContext context) {
if (Platform.isMacOS) {
return MacosIconButton(onPressed: onPressed, icon: MacosIcon(iconData));
return MacosIconButton(
semanticLabel: label,
onPressed: onPressed,
icon: icon,
);
}
return IconButton(
tooltip: label,
onPressed: onPressed,
icon: Icon(iconData),
icon: icon,
);
}
}
24 changes: 19 additions & 5 deletions lib/adaptive/scaffold.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,31 @@ class AdaptiveScaffold extends ConsumerWidget {
Widget build(BuildContext context, WidgetRef ref) {
if (Platform.isMacOS) {
final toolbarAction = floatingAction?.toolBarIconButton();
final dynamic extraActions = appBar?.actions ?? [];
final toolbarExtraActions = extraActions
.map<ToolbarItem>((a) => ToolBarIconButton(
icon: a.icon ?? const SizedBox(),
onPressed: a.onPressed,
showLabel: a.showLabel ?? false,
label: a.label,
))
.toList();
return MacosWindow(
titleBar: appBar?.title != null
? TitleBar(title: Text(appBar!.title))
: null,
sidebar: buildSidebar(context),
sidebar: drawer != null ? buildSidebar(context) : null,
child: MacosScaffold(
backgroundColor: const Color.fromRGBO(0xff, 0xff, 0xff, 0),
toolBar: toolbarAction != null
? ToolBar(actions: [
toolbarAction,
])
toolBar: toolbarAction != null || appBar?.leading != null
? ToolBar(
leading: appBar?.leading,
actions: toolbarAction != null
? [
toolbarAction,
...toolbarExtraActions,
]
: toolbarExtraActions)
: null,
children: [
ContentArea(builder: (context, scrollController) {
Expand Down
28 changes: 28 additions & 0 deletions lib/adaptive/switch.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import 'dart:io' show Platform;

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:macos_ui/macos_ui.dart';
import 'package:material_neumorphic/material_neumorphic.dart';

class AdaptiveSwitch extends StatelessWidget {
final void Function(bool)? onChanged;
final bool value;

const AdaptiveSwitch({
super.key,
this.onChanged,
this.value = false,
});

@override
Widget build(BuildContext context) {
if (Platform.isMacOS) {
return MacosSwitch(onChanged: onChanged, value: value);
}
return NeumorphicSwitch(
value: value,
onChanged: onChanged ?? (value) {},
);
}
}
71 changes: 71 additions & 0 deletions lib/adaptive/tab_view.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import 'dart:io' show Platform;

import 'package:flutter/material.dart';
import 'package:macos_ui/macos_ui.dart';

class AdaptiveTabView extends StatefulWidget {
final List<String> tabs;
final List<Widget> children;
final int initialIndex;

const AdaptiveTabView({
super.key,
required this.tabs,
required this.children,
this.initialIndex = 0,
});

@override
State<StatefulWidget> createState() => _AdaptiveTabViewState();
}

class _AdaptiveTabViewState extends State<AdaptiveTabView>
with TickerProviderStateMixin {
late TabController _tabController;
late MacosTabController _macosTabController;

@override
initState() {
super.initState();
final length = widget.tabs.length;
_tabController = TabController(
length: length, vsync: this, initialIndex: widget.initialIndex);
_macosTabController =
MacosTabController(length: length, initialIndex: widget.initialIndex);
}

@override
Widget build(BuildContext context) {
if (Platform.isMacOS) {
return MacosTabView(
controller: _macosTabController,
tabs: widget.tabs.map<MacosTab>((tab) => MacosTab(label: tab)).toList(),
children: widget.children,
);
}
final theme = Theme.of(context);
return Column(
children: [
Container(
color: theme.colorScheme.primary,
child: TabBar(
controller: _tabController,
tabs: widget.tabs
.map<Tab>((tab) => Tab(
child: Text(tab,
style: const TextStyle()
.copyWith(color: theme.colorScheme.onPrimary))))
.toList(),
),
),
Flexible(
child: TabBarView(
clipBehavior: Clip.none,
controller: _tabController,
children: widget.children,
),
)
],
);
}
}
Loading

0 comments on commit bc27d9f

Please sign in to comment.