@@ -2,7 +2,9 @@ import 'package:atm_flutter_app/pages/server/server_controller.dart';
2
2
import 'package:atm_flutter_app/widgets/button_widget/check_box_widget.dart' ;
3
3
import 'package:atm_flutter_app/widgets/textfield_widget/underline_text_field_widget.dart' ;
4
4
import 'package:flutter/material.dart' ;
5
+ import 'package:flutter_slidable/flutter_slidable.dart' ;
5
6
import 'package:get/get.dart' ;
7
+ import '../../resources/app_strings.dart' ;
6
8
import '../../widgets/button_widget/button_widget.dart' ;
7
9
import '../../widgets/text_widget/text_widget.dart' ;
8
10
@@ -53,65 +55,71 @@ class ServerPage extends GetView<ServerController> {
53
55
() => ListView .builder (
54
56
itemCount: controller.serverList.length,
55
57
itemBuilder: (BuildContext context, int index) {
56
- return CheckBoxWidget (
57
- url: controller.serverList[index].serverUrl! ,
58
- isChecked: controller.serverList[index].serverStatus! ,
59
- onChanged: (value) => controller.onchangeValue (value, index));
60
- // return Slidable(
61
- // key: const ValueKey(0),
62
- // enabled: true,
63
- // child: Padding(
64
- // padding: const EdgeInsets.all(5.0),
65
- // child: Card(
66
- // elevation:
67
- // controller.serverList[index].serverStatus! ? 5 : 0,
68
- // color: controller.serverList[index].serverStatus!
69
- // ? Theme.of(context).primaryColor
70
- // : Theme.of(context).textTheme.bodyText1!.color!,
71
- // child: ListTile(
72
- // // leading:
73
- // title: TextWidget(
74
- // text:
75
- // controller.serverList[index].serverUrl.toString(),
76
- // textColor: controller.serverList[index].serverStatus!
77
- // ? Theme.of(context).textTheme.bodyText1!.color!
78
- // : Theme.of(context).textTheme.subtitle1!.color!,
79
- // ),
80
- // ),
81
- // ),
82
- // ),
83
- // startActionPane: ActionPane(
84
- // extentRatio: 0.20,
85
- // dragDismissible: false,
86
- // motion: const DrawerMotion(),
87
- // dismissible: DismissiblePane(onDismissed: () {}),
88
- // children: [
89
- // SlidableAction(
90
- // onPressed: (BuildContext context) =>
91
- // controller.onItemDelete(index),
92
- // backgroundColor: const Color(0xFFFE4A49),
93
- // foregroundColor:
94
- // Theme.of(context).textTheme.bodyText1!.color!,
95
- // icon: Icons.delete,
96
- // label: AppStrings.txtDelete,
97
- // spacing: 10.0,
98
- // )
99
- // ],
100
- // ),
101
- // endActionPane: ActionPane(
102
- // extentRatio: 0.20,
103
- // dragDismissible: false,
104
- // motion: const ScrollMotion(),
105
- // children: [
106
- // SlidableAction(
107
- // onPressed: (BuildContext context) =>
108
- // controller.onItemSelected(index),
109
- // backgroundColor: const Color(0xFF7BC043),
110
- // foregroundColor:
111
- // Theme.of(context).textTheme.bodyText1!.color!,
112
- // icon: Icons.arrow_forward,
113
- // ),
114
- // ]));
58
+ // return CheckBoxWidget(
59
+ // url: controller.serverList[index].serverUrl!,
60
+ // isChecked: controller.serverList[index].serverStatus!,
61
+ // onChanged: (value) => controller.onchangeValue(value, index));
62
+ return Slidable (
63
+ key: const ValueKey (0 ),
64
+ enabled: true ,
65
+ // Padding(
66
+ // padding: const EdgeInsets.all(5.0),
67
+ // child: Card(
68
+ // elevation:
69
+ // controller.serverList[index].serverStatus! ? 5 : 0,
70
+ // color: controller.serverList[index].serverStatus!
71
+ // ? Theme.of(context).primaryColor
72
+ // : Theme.of(context).textTheme.bodyText1!.color!,
73
+ // child: ListTile(
74
+ // // leading:
75
+ // title: TextWidget(
76
+ // text:
77
+ // controller.serverList[index].serverUrl.toString(),
78
+ // textColor: controller.serverList[index].serverStatus!
79
+ // ? Theme.of(context).textTheme.bodyText1!.color!
80
+ // : Theme.of(context).textTheme.subtitle1!.color!,
81
+ // ),
82
+ // ),
83
+ // ),
84
+ // ),
85
+ startActionPane: ActionPane (
86
+ extentRatio: 0.20 ,
87
+ dragDismissible: false ,
88
+ motion: const DrawerMotion (),
89
+ dismissible: DismissiblePane (onDismissed: () {}),
90
+ children: [
91
+ SlidableAction (
92
+ onPressed: (BuildContext context) =>
93
+ controller.onItemDelete (index),
94
+ backgroundColor: const Color (0xFFFE4A49 ),
95
+ foregroundColor:
96
+ Theme .of (context).textTheme.bodyText1! .color! ,
97
+ icon: Icons .delete,
98
+ label: AppStrings .txtDelete,
99
+ spacing: 10.0 ,
100
+ )
101
+ ],
102
+ ),
103
+ child: CheckBoxWidget (
104
+ url: controller.serverList[index].serverUrl! ,
105
+ isChecked: controller.serverList[index].serverStatus! ,
106
+ onChanged: (value) =>
107
+ controller.onchangeValue (value, index)),
108
+ // endActionPane: ActionPane(
109
+ // extentRatio: 0.20,
110
+ // dragDismissible: false,
111
+ // motion: const ScrollMotion(),
112
+ // children: [
113
+ // SlidableAction(
114
+ // onPressed: (BuildContext context) =>
115
+ // controller.onItemSelected(index),
116
+ // backgroundColor: const Color(0xFF7BC043),
117
+ // foregroundColor:
118
+ // Theme.of(context).textTheme.bodyText1!.color!,
119
+ // icon: Icons.arrow_forward,
120
+ // ),
121
+ // ])
122
+ );
115
123
}),
116
124
),
117
125
);
0 commit comments