-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4d45056
commit 911b2b1
Showing
9 changed files
with
66 additions
and
84 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 was deleted.
Oops, something went wrong.
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
18 changes: 0 additions & 18 deletions
18
packages/uni_app/lib/view/settings/widgets/feature_flags/feature_switch.dart
This file was deleted.
Oops, something went wrong.
27 changes: 27 additions & 0 deletions
27
packages/uni_app/lib/view/settings/widgets/feature_flags/feature_switch_tile.dart
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,27 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:uni/model/feature_flags/generic_feature_flag.dart'; | ||
|
||
class FeatureSwitchTile extends StatelessWidget { | ||
const FeatureSwitchTile({ | ||
required this.featureFlag, | ||
required this.refreshDialog, | ||
super.key, | ||
}); | ||
|
||
final GenericFeatureFlag featureFlag; | ||
final void Function() refreshDialog; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return ListTile( | ||
title: Text(featureFlag.getName(context)), | ||
trailing: Switch.adaptive( | ||
value: featureFlag.isEnabled(), | ||
onChanged: (value) async { | ||
await featureFlag.setEnabled(enabled: value); | ||
refreshDialog(); | ||
}, | ||
), | ||
); | ||
} | ||
} |