mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-22 15:30:59 +00:00
28 lines
715 B
Dart
28 lines
715 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:lightmeter/generated/l10n.dart';
|
|
|
|
class CaffeineListTile extends StatefulWidget {
|
|
const CaffeineListTile({super.key});
|
|
|
|
@override
|
|
State<CaffeineListTile> createState() => _CaffeineListTileState();
|
|
}
|
|
|
|
class _CaffeineListTileState extends State<CaffeineListTile> {
|
|
bool _isCaffeineOn = false;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return SwitchListTile(
|
|
secondary: const Icon(Icons.coffee),
|
|
title: Text(S.of(context).caffeine),
|
|
subtitle: Text(S.of(context).keepsScreenOn),
|
|
value: _isCaffeineOn,
|
|
onChanged: (value) {
|
|
setState(() {
|
|
_isCaffeineOn = value;
|
|
});
|
|
},
|
|
);
|
|
}
|
|
}
|