@@ -100,6 +100,12 @@ class _TableScreenState extends State<TableScreen> {
100
100
appBar: AppBar (
101
101
title: const Text ("TableScreen" ),
102
102
actions: [
103
+ IconButton (
104
+ onPressed: () {
105
+ _showInfoSheet ();
106
+ },
107
+ icon: const Icon (Icons .info_outlined)),
108
+ const Gap (5 ),
103
109
IconButton (
104
110
onPressed: () {
105
111
_showInputSheet (context);
@@ -714,4 +720,70 @@ class _TableScreenState extends State<TableScreen> {
714
720
);
715
721
});
716
722
}
723
+
724
+ void _showInfoSheet () {
725
+ TextEditingController controller =
726
+ TextEditingController (text: widget.machine.description);
727
+
728
+ showModalBottomSheet (
729
+ useSafeArea: true ,
730
+ isScrollControlled: true ,
731
+ context: context,
732
+ isDismissible: true ,
733
+ enableDrag: false ,
734
+ builder: (context) {
735
+ return Padding (
736
+ padding: EdgeInsets .only (
737
+ bottom: MediaQuery .of (context).viewInsets.bottom,
738
+ ),
739
+ child: Container (
740
+ height: 320 ,
741
+ padding: const EdgeInsets .only (
742
+ bottom: 8.0 , top: 15 , left: 15 , right: 15 ),
743
+ child: Center (
744
+ child: Column (
745
+ children: [
746
+ const Text (
747
+ "Description " ,
748
+ style:
749
+ TextStyle (fontSize: 18 , fontWeight: FontWeight .bold),
750
+ ),
751
+ const Gap (20 ),
752
+ TextField (
753
+ maxLength: 500 ,
754
+ controller: controller,
755
+ maxLines: 5 ,
756
+ ),
757
+ const Gap (5 ),
758
+ Padding (
759
+ padding: const EdgeInsets .only (left: 5.0 ),
760
+ child: Row (
761
+ crossAxisAlignment: CrossAxisAlignment .center,
762
+ mainAxisAlignment: MainAxisAlignment .end,
763
+ children: [
764
+ ElevatedButton (
765
+ onPressed: () {
766
+ Navigator .pop (context);
767
+ },
768
+ child: const Text ("Cancel" ),
769
+ ),
770
+ const Gap (7.0 ),
771
+ ElevatedButton (
772
+ onPressed: () {
773
+ //saving code here
774
+ widget.machine.description = controller.text;
775
+ Navigator .pop (context);
776
+ },
777
+ child: const Text ("Okay" ),
778
+ )
779
+ ],
780
+ ),
781
+ ),
782
+ ],
783
+ ),
784
+ ),
785
+ ),
786
+ );
787
+ });
788
+ }
717
789
}
0 commit comments