mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-01 18:07:44 +00:00
dc623f3293
Updated pickers and settings screen
40 lines
1.2 KiB
Dart
40 lines
1.2 KiB
Dart
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
class StandartSwitch extends StatefulWidget {
|
|
const StandartSwitch({@required this.value, @required this.onTaped});
|
|
|
|
final bool value;
|
|
final VoidCallback onTaped;
|
|
|
|
@override
|
|
StandartSwitchState createState() => StandartSwitchState();
|
|
}
|
|
|
|
class StandartSwitchState extends State<StandartSwitch> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return GestureDetector(
|
|
onTap: widget.onTaped,
|
|
child: AnimatedContainer(
|
|
padding: EdgeInsets.only(left: 2.0, right: 2.0),
|
|
alignment: widget.value ? Alignment.centerRight : Alignment.centerLeft,
|
|
duration: Duration(milliseconds: 250),
|
|
width: 50,
|
|
height: 28,
|
|
decoration: BoxDecoration(
|
|
color: widget.value
|
|
? Theme.of(context).accentTextTheme.body2.color
|
|
: Theme.of(context).accentTextTheme.display4.color,
|
|
borderRadius: BorderRadius.all(Radius.circular(14.0))),
|
|
child: Container(
|
|
width: 24.0,
|
|
height: 24.0,
|
|
decoration: BoxDecoration(
|
|
color: Colors.white,
|
|
shape: BoxShape.circle),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|