@@ -30,114 +30,111 @@ class _ItemDetailsDrawerState extends State<ItemDetailsDrawer> {
30
30
31
31
@override
32
32
Widget build (BuildContext context) {
33
- return Drawer (
34
- width: 500 ,
35
- child: Stack (
36
- children: [
37
- Column (
38
- children: [
39
- Padding (
40
- padding: const EdgeInsets .all (16 ),
41
- child: Row (
42
- children: [
43
- ListenableBuilder (
44
- listenable: widget.controller,
45
- builder: (context, child) {
46
- return getIcon (widget.controller.item! );
47
- },
48
- ),
49
- const SizedBox (width: 8.0 ),
50
- Expanded (
51
- child: Text (
52
- '#${widget .controller .item !.number }' ,
53
- style: Theme .of (context).textTheme.titleLarge,
54
- ),
33
+ return Stack (
34
+ children: [
35
+ Column (
36
+ children: [
37
+ Padding (
38
+ padding: const EdgeInsets .all (16 ),
39
+ child: Row (
40
+ children: [
41
+ ListenableBuilder (
42
+ listenable: widget.controller,
43
+ builder: (context, child) {
44
+ return getIcon (widget.controller.item! );
45
+ },
46
+ ),
47
+ const SizedBox (width: 8.0 ),
48
+ Expanded (
49
+ child: Text (
50
+ '#${widget .controller .item !.number }' ,
51
+ style: Theme .of (context).textTheme.titleLarge,
55
52
),
56
- MenuAnchor (
57
- controller: menuController,
58
- menuChildren: [
59
- MenuItemButton (
60
- onPressed: convert,
61
- leadingIcon: const Icon (Icons .transform),
62
- child: const Text ('Convert' ),
63
- ),
64
- ],
65
- child: IconButton .filled (
66
- onPressed: () => menuController.open (),
67
- icon: const Icon (Icons .more_vert),
53
+ ),
54
+ MenuAnchor (
55
+ controller: menuController,
56
+ menuChildren: [
57
+ MenuItemButton (
58
+ onPressed: convert,
59
+ leadingIcon: const Icon (Icons .transform),
60
+ child: const Text ('Convert' ),
68
61
),
62
+ ],
63
+ child: IconButton .filled (
64
+ onPressed: () => menuController.open (),
65
+ icon: const Icon (Icons .more_vert),
69
66
),
70
- ] ,
71
- ) ,
67
+ ) ,
68
+ ] ,
72
69
),
73
- const Divider (height : 1 ),
74
- Expanded (
75
- child : SingleChildScrollView (
76
- child: Padding (
77
- padding : const EdgeInsets . all ( 16 ),
78
- child : Column (
79
- children : [
80
- ItemDetails (
81
- controller : widget.controller,
82
- item : widget.controller.item ! ,
83
- isThingHidden : widget.isHiddenLocked ,
84
- ) ,
85
- const SizedBox (height : 80 ),
86
- ] ,
87
- ) ,
70
+ ),
71
+ const Divider (height : 1 ),
72
+ Expanded (
73
+ child: SingleChildScrollView (
74
+ child : Padding (
75
+ padding : const EdgeInsets . all ( 16 ),
76
+ child : Column (
77
+ children : [
78
+ ItemDetails (
79
+ controller : widget.controller,
80
+ item : widget.controller.item ! ,
81
+ isThingHidden : widget.isHiddenLocked ,
82
+ ),
83
+ const SizedBox (height : 80 ) ,
84
+ ] ,
88
85
),
89
86
),
90
87
),
91
- ],
92
- ),
93
- Positioned (
94
- bottom: 0 ,
95
- left: 0 ,
96
- right: 0 ,
97
- child: Container (
98
- color: Theme .of (context).colorScheme.surface.withAlpha (180 ),
99
- child: Padding (
100
- padding: const EdgeInsets .all (16 ),
101
- child: Row (
102
- mainAxisAlignment: MainAxisAlignment .end,
103
- children: [
104
- ListenableBuilder (
105
- listenable: widget.controller,
106
- builder: (context, child) {
107
- if (! widget.controller.hasUnsavedChanges) {
108
- return child! ;
109
- }
88
+ ),
89
+ ],
90
+ ),
91
+ Positioned (
92
+ bottom: 0 ,
93
+ left: 0 ,
94
+ right: 0 ,
95
+ child: Container (
96
+ color: Theme .of (context).colorScheme.surface.withAlpha (180 ),
97
+ child: Padding (
98
+ padding: const EdgeInsets .all (16 ),
99
+ child: Row (
100
+ mainAxisAlignment: MainAxisAlignment .end,
101
+ children: [
102
+ ListenableBuilder (
103
+ listenable: widget.controller,
104
+ builder: (context, child) {
105
+ if (! widget.controller.hasUnsavedChanges) {
106
+ return child! ;
107
+ }
110
108
111
- return OutlinedButton (
112
- onPressed: () {
113
- widget.controller.discardChanges ();
114
- },
115
- child: const Text ('Discard' ),
116
- );
117
- },
118
- child: OutlinedButton (
119
- onPressed: () => Navigator .of (context).pop (),
120
- child: const Text ('Cancel' ),
121
- ),
109
+ return OutlinedButton (
110
+ onPressed: () {
111
+ widget.controller.discardChanges ();
112
+ },
113
+ child: const Text ('Discard' ),
114
+ );
115
+ },
116
+ child: OutlinedButton (
117
+ onPressed: () => Navigator .of (context).pop (),
118
+ child: const Text ('Cancel' ),
122
119
),
123
- const SizedBox (width : 8 ),
124
- ListenableBuilder (
125
- listenable : widget.controller,
126
- builder : (_, __) {
127
- return FilledProgressButton (
128
- onPressed : widget.controller.saveChanges,
129
- isLoading : isLoading ,
130
- child : const Text ( 'Save' ) ,
131
- );
132
- },
133
- ) ,
134
- ] ,
135
- ) ,
120
+ ),
121
+ const SizedBox (width : 8 ),
122
+ ListenableBuilder (
123
+ listenable : widget.controller,
124
+ builder : (_, __) {
125
+ return FilledProgressButton (
126
+ onPressed : widget.controller.saveChanges ,
127
+ isLoading : isLoading ,
128
+ child : const Text ( 'Save' ),
129
+ );
130
+ } ,
131
+ ) ,
132
+ ] ,
136
133
),
137
134
),
138
135
),
139
- ] ,
140
- ) ,
136
+ ) ,
137
+ ] ,
141
138
);
142
139
}
143
140
}
0 commit comments