-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Update Ansible Semaphore Client.
- Loading branch information
Showing
81 changed files
with
6,602 additions
and
791 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) {}, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
), | ||
) | ||
], | ||
); | ||
} | ||
} |
Oops, something went wrong.