Skip to content

Commit 84bf848

Browse files
authored
Merge pull request #101 from beerstorm-net/master
2 parents dd14938 + 9807037 commit 84bf848

File tree

3 files changed

+10
-16
lines changed

3 files changed

+10
-16
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ example/.flutter-plugins-dependencies
1212
# Directory created by dartdoc
1313
# If you don't generate documentation locally you can remove this line.
1414
doc/api/
15-
settings_ui.iml
1615
.idea
16+
*.iml

lib/src/cupertino_settings_item.dart

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,10 @@ class CupertinoSettingsItemState extends State<CupertinoSettingsItem> {
7777
final isLargeScreen = MediaQuery.of(context).size.width >= 768;
7878

7979
final ThemeData theme = Theme.of(context);
80-
final ListTileTheme tileTheme = ListTileTheme.of(context);
80+
final ListTileThemeData tileTheme = ListTileTheme.of(context);
8181

8282
final iconThemeData = IconThemeData(
83-
color: widget.enabled
84-
? _iconColor(theme, tileTheme)
85-
: CupertinoColors.inactiveGray,
83+
color: widget.enabled ? _iconColor(theme, tileTheme) : CupertinoColors.inactiveGray,
8684
);
8785

8886
Widget? leadingIcon;
@@ -164,8 +162,7 @@ class CupertinoSettingsItemState extends State<CupertinoSettingsItem> {
164162
child: CupertinoSwitch(
165163
value: widget.switchValue!,
166164
activeColor: widget.enabled
167-
? (widget.switchActiveColor ??
168-
Theme.of(context).accentColor)
165+
? (widget.switchActiveColor ?? Theme.of(context).accentColor)
169166
: CupertinoColors.inactiveGray,
170167
onChanged: !widget.enabled
171168
? null
@@ -242,8 +239,7 @@ class CupertinoSettingsItemState extends State<CupertinoSettingsItem> {
242239
return GestureDetector(
243240
behavior: HitTestBehavior.opaque,
244241
onTap: () {
245-
if ((widget.onPress != null || widget.onToggle != null) &&
246-
widget.enabled) {
242+
if ((widget.onPress != null || widget.onToggle != null) && widget.enabled) {
247243
if (mounted) {
248244
setState(() {
249245
pressed = true;
@@ -295,13 +291,10 @@ class CupertinoSettingsItemState extends State<CupertinoSettingsItem> {
295291
},
296292
child: Container(
297293
decoration: BoxDecoration(
298-
borderRadius:
299-
isLargeScreen ? BorderRadius.all(Radius.circular(20)) : null,
294+
borderRadius: isLargeScreen ? BorderRadius.all(Radius.circular(20)) : null,
300295
color: calculateBackgroundColor(context),
301296
),
302-
height: widget.subtitle == null && widget.subtitleWidget == null
303-
? 44.0
304-
: 57.0,
297+
height: widget.subtitle == null && widget.subtitleWidget == null ? 44.0 : 57.0,
305298
child: Row(
306299
children: rowChildren,
307300
),
@@ -318,7 +311,7 @@ class CupertinoSettingsItemState extends State<CupertinoSettingsItem> {
318311
? iosPressedTileColorDark
319312
: iosTileDarkColor;
320313

321-
Color? _iconColor(ThemeData theme, ListTileTheme tileTheme) {
314+
Color? _iconColor(ThemeData theme, ListTileThemeData tileTheme) {
322315
if (tileTheme.selectedColor != null) {
323316
return tileTheme.selectedColor;
324317
}

pubspec.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ version: 1.0.1
44
homepage: https://github.com/yako-dev/flutter-settings-ui
55

66
environment:
7-
sdk: '>=2.12.0 <3.0.0'
7+
sdk: ">=2.12.0 <3.0.0"
8+
flutter: ">=2.8.0"
89

910
dependencies:
1011
flutter:

0 commit comments

Comments
 (0)