-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
don't implement them yet because we want to merge with 3i's
- Loading branch information
1 parent
7ee949b
commit e02da40
Showing
9 changed files
with
181 additions
and
152 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 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
31 changes: 31 additions & 0 deletions
31
lib/ui/pages/headphones_settings/huawei/auto_pause_section.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,31 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_gen/gen_l10n/app_localizations.dart'; | ||
|
||
import '../../../../headphones/framework/headphones_settings.dart'; | ||
import '../../../../headphones/huawei/settings.dart'; | ||
import '../../../common/list_tile_switch.dart'; | ||
|
||
class AutoPauseSection extends StatelessWidget { | ||
final HeadphonesSettings<HuaweiFreeBuds4iSettings> headphones; | ||
|
||
const AutoPauseSection(this.headphones, {super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final l = AppLocalizations.of(context)!; | ||
return StreamBuilder( | ||
stream: headphones.settings.map((s) => s.autoPause), | ||
initialData: false, | ||
builder: (_, snap) { | ||
return ListTileSwitch( | ||
title: Text(l.autoPause), | ||
subtitle: Text(l.autoPauseDesc), | ||
value: snap.data ?? false, | ||
onChanged: (newVal) => headphones.setSettings( | ||
HuaweiFreeBuds4iSettings(autoPause: newVal), | ||
), | ||
); | ||
}, | ||
); | ||
} | ||
} |
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
Oops, something went wrong.