Search in service request, preventive maintenance, gas refill, and transfer to arrange the requests from most recent to earliestt
parent
4d548e1048
commit
11f95b9578
@ -0,0 +1,44 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:test_sa/views/widgets/titles/app_sub_title.dart';
|
||||||
|
|
||||||
|
import '../app_style/colors.dart';
|
||||||
|
import '../app_style/sizing.dart';
|
||||||
|
|
||||||
|
class ASwitchButton extends StatelessWidget {
|
||||||
|
final String title;
|
||||||
|
final bool value;
|
||||||
|
final void Function(bool) onChange;
|
||||||
|
|
||||||
|
const ASwitchButton({
|
||||||
|
@required this.title,
|
||||||
|
@required this.value,
|
||||||
|
@required this.onChange,
|
||||||
|
Key key,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||||
|
margin: const EdgeInsets.symmetric(vertical: 8),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: AColors.inputFieldBackgroundColor,
|
||||||
|
border: Border.all(
|
||||||
|
color: const Color(0xffefefef),
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(AppStyle.borderRadius * AppStyle.getScaleFactor(context)),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
ASubTitle(title),
|
||||||
|
Switch.adaptive(
|
||||||
|
value: value,
|
||||||
|
activeColor: AColors.primaryColor,
|
||||||
|
onChanged: onChange,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue