parent
476dff1499
commit
0b69d37074
@ -0,0 +1,26 @@ |
||||
import 'package:flutter/material.dart'; |
||||
|
||||
class UserSwitch extends StatelessWidget { |
||||
final bool isOn; |
||||
final ValueChanged<bool> onChanged; |
||||
const UserSwitch({ |
||||
Key? key, |
||||
required this.isOn, |
||||
required this.onChanged, |
||||
}) : super(key: key); |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return Row( |
||||
mainAxisSize: MainAxisSize.min, |
||||
children: [ |
||||
const Icon(Icons.account_circle), |
||||
Switch( |
||||
value: isOn, |
||||
onChanged: onChanged, |
||||
activeColor: Colors.green, |
||||
) |
||||
], |
||||
); |
||||
} |
||||
} |
Loading…
Reference in new issue