You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cloudsolutions-atoms/lib/views/widgets/status/users_menu.dart

110 lines
3.4 KiB
Dart

///todo deleted
// import 'package:flutter/material.dart';
// import 'package:test_sa/views/app_style/sizing.dart';
//
// import '../../../models/employee.dart';
//
// class UsersMenu extends StatefulWidget {
// final List<Employee> statuses;
// final Employee initialStatus;
// final Function(Employee) onSelect;
//
// const UsersMenu({Key? key, this.statuses, this.onSelect, this.initialStatus}) : super(key: key);
//
// @override
// _SingleUsersMenuState createState() => _SingleUsersMenuState();
// }
//
// class _SingleUsersMenuState extends State<UsersMenu> {
// Employee _selectedStatus;
//
// @override
// void setState(VoidCallback fn) {
// if (mounted) super.setState(fn);
// }
//
// @override
// void didUpdateWidget(covariant UsersMenu oldWidget) {
// if (widget.initialStatus != null) {
// final result = widget.statuses?.where((element) {
// return element == widget.initialStatus;
// });
// if (result.isNotEmpty) {
// _selectedStatus = result.first;
// } else {
// _selectedStatus = null;
// }
// if ((widget.initialStatus?.id ?? "") != (_selectedStatus?.id ?? "")) {
// widget.onSelect(_selectedStatus);
// }
// } else {
// _selectedStatus = null;
// }
// super.didUpdateWidget(oldWidget);
// }
//
// @override
// void initState() {
// if (widget.initialStatus != null) {
// final result = widget.statuses?.where((element) {
// return element == widget.initialStatus;
// });
// if (result.isNotEmpty) _selectedStatus = result.first;
// if (widget.initialStatus.id != _selectedStatus?.id) {
// widget.onSelect(_selectedStatus);
// }
// }
//
// super.initState();
// }
//
// @override
// Widget build(BuildContext context) {
// return Container(
// padding: const EdgeInsets.symmetric(horizontal: 16),
// decoration: BoxDecoration(
// // color: AColors.inputFieldBackgroundColor,
// border: Border.all(
// color: Color(0xffefefef),
// ),
// borderRadius: BorderRadius.circular(AppStyle.borderRadius * AppStyle.getScaleFactor(context)),
// // boxShadow: const [
// // AppStyle.boxShadow
// // ]
// ),
// child: DropdownButton<Employee>(
// value: _selectedStatus,
// iconSize: 24,
// icon: const Icon(Icons.keyboard_arrow_down_rounded),
// elevation: 0,
// isExpanded: true,
// hint: Text(
// "Select",
// style: Theme.of(context).textTheme.subtitle1,
// ),
// style: TextStyle(color: Theme.of(context).primaryColor),
// underline: SizedBox.shrink(),
// onChanged: (Employee newValue) {
// setState(() {
// _selectedStatus = newValue;
// });
// widget.onSelect(newValue);
// },
// items: widget.statuses.map<DropdownMenuItem<Employee>>((Employee value) {
// return DropdownMenuItem<Employee>(
// value: value,
// child: Text(
// value.name,
// style: Theme.of(context).textTheme.subtitle1.copyWith(
// color: Theme.of(context).primaryColor,
// fontSize: 11,
// //fontWeight: FontWeight.bold
// ),
// ),
// );
// }).toList(),
// ),
// );
// }
// }