You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
655 B
27 lines
655 B
import 'package:flutter/material.dart';
|
|
import 'package:thesis_shop/benchmark_counter.dart';
|
|
|
|
class UserSwitch extends StatelessWidget {
|
|
final bool isOn;
|
|
final ValueChanged<bool> onChanged;
|
|
const UserSwitch({
|
|
required this.isOn,
|
|
required this.onChanged,
|
|
}) : super(key: const Key('user_switch'));
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
BenchmarkCounters.userSwitch++;
|
|
return Row(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
const Icon(Icons.account_circle),
|
|
Switch(
|
|
value: isOn,
|
|
onChanged: onChanged,
|
|
activeColor: Colors.green,
|
|
)
|
|
],
|
|
);
|
|
}
|
|
}
|
|
|