mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-11-28 23:25:52 +01:00
Rename the Dart package, Android and iOS identifiers, Rust crates, native libraries, and Discord plugin. Preserve legacy data readers and compatibility aliases. Update localized branding, documentation, artwork, build tooling, and release artifacts. Route Telegram release notifications to @mornyeupdates and link @mornyecommunity.
60 lines
1.8 KiB
Dart
60 lines
1.8 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:material_3_expressive/material_3_expressive.dart';
|
|
import 'package:mornye/theme/material_expressive.dart';
|
|
|
|
/// Checkbox row for Material dialogs and sheets. Expressive builds use the
|
|
/// M3E checkbox; reduced motion falls back to the static Material tile.
|
|
/// Mornye call sites keep their own check-circle rows.
|
|
class AppCheckboxListTile extends StatelessWidget {
|
|
const AppCheckboxListTile({
|
|
super.key,
|
|
required this.value,
|
|
required this.onChanged,
|
|
required this.title,
|
|
this.subtitle,
|
|
this.secondary,
|
|
this.contentPadding,
|
|
this.controlAffinity = ListTileControlAffinity.platform,
|
|
});
|
|
|
|
final bool value;
|
|
final ValueChanged<bool?>? onChanged;
|
|
final Widget title;
|
|
final Widget? subtitle;
|
|
|
|
/// Icon on the side opposite the checkbox.
|
|
final Widget? secondary;
|
|
final EdgeInsetsGeometry? contentPadding;
|
|
final ListTileControlAffinity controlAffinity;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
if (!materialExpressiveEnabled(context)) {
|
|
return CheckboxListTile(
|
|
value: value,
|
|
onChanged: onChanged,
|
|
title: title,
|
|
subtitle: subtitle,
|
|
secondary: secondary,
|
|
contentPadding: contentPadding,
|
|
controlAffinity: controlAffinity,
|
|
);
|
|
}
|
|
final checkbox = MaterialExpressiveScope(
|
|
child: M3ECheckbox(value: value, onChanged: onChanged),
|
|
);
|
|
final checkboxLeads = controlAffinity == ListTileControlAffinity.leading;
|
|
return MergeSemantics(
|
|
child: ListTile(
|
|
title: title,
|
|
subtitle: subtitle,
|
|
contentPadding: contentPadding,
|
|
enabled: onChanged != null,
|
|
onTap: onChanged == null ? null : () => onChanged!(!value),
|
|
leading: checkboxLeads ? checkbox : secondary,
|
|
trailing: checkboxLeads ? secondary : checkbox,
|
|
),
|
|
);
|
|
}
|
|
}
|