@@ -47,7 +47,6 @@ class _DocumentViewerScreenState extends State<DocumentViewerScreen> {
4747
4848 @override
4949 Widget build (BuildContext context) {
50- // Proveravamo da li je tastatura otvorena
5150 final bool isKeyboardVisible = MediaQuery .of (context).viewInsets.bottom > 0 ;
5251
5352 return Scaffold (
@@ -59,46 +58,46 @@ class _DocumentViewerScreenState extends State<DocumentViewerScreen> {
5958 ),
6059 body: Stack (
6160 children: [
62- Column (
63- children: [
64- Expanded (
65- child: Padding (
66- padding: const EdgeInsets .symmetric (horizontal: 16 ),
67- child: FleatherEditor (
68- controller: _controller! ,
69- focusNode: _focusNode,
70- padding: const EdgeInsets .only (bottom: 100 ), // Da tekst ne ide ispod pilule
71- ),
72- ),
61+ // Editor deo
62+ Positioned .fill (
63+ child: Padding (
64+ padding: const EdgeInsets .symmetric (horizontal: 16 ),
65+ child: FleatherEditor (
66+ controller: _controller! ,
67+ focusNode: _focusNode,
68+ padding: const EdgeInsets .only (top: 16 , bottom: 120 ),
7369 ),
74- ] ,
70+ ) ,
7571 ),
7672
77- // Pilula toolbar
73+ // Pilula toolbar koja lebdi iznad tastature
7874 if (isKeyboardVisible)
7975 Positioned (
80- bottom: MediaQuery .of (context).viewInsets.bottom + 10 ,
81- left: 20 ,
82- right: 20 ,
76+ bottom: MediaQuery .of (context).viewInsets.bottom + 16 ,
77+ left: 16 ,
78+ right: 16 ,
8379 child: Material (
84- elevation: 4 ,
80+ elevation: 6 ,
81+ shadowColor: Colors .black26,
8582 borderRadius: BorderRadius .circular (30 ),
8683 color: Theme .of (context).colorScheme.surfaceContainerHighest,
84+ clipBehavior: Clip .antiAlias,
8785 child: Container (
88- height: 50 ,
89- padding: const EdgeInsets .symmetric (horizontal: 10 ),
86+ height: 56 ,
87+ padding: const EdgeInsets .symmetric (horizontal: 8 ),
9088 child: Theme (
9189 data: Theme .of (context).copyWith (
92- iconTheme: const IconThemeData (size: 20 ),
90+ // Ovim čistimo toolbar od pozadina i viška linija
91+ dividerColor: Colors .transparent,
9392 ),
94- child: SingleChildScrollView (
95- scrollDirection : Axis .horizontal,
96- child : FleatherToolbar . basic (
97- controller : _controller ! ,
98- // Isključujemo nepotrebne stvari za čistiji izgled
99- hideHeading : false ,
100- hideIndentation : true ,
101- hideListNumbers : true ,
93+ child: Center (
94+ child : SingleChildScrollView (
95+ scrollDirection : Axis .horizontal,
96+ child : FleatherToolbar . basic (
97+ controller : _controller ! ,
98+ // Izbacili smo sve hideOvo parametre da build ne puca
99+ // Fleather će sam prikazati osnovne stvari
100+ ) ,
102101 ),
103102 ),
104103 ),
@@ -117,4 +116,4 @@ class _DocumentViewerScreenState extends State<DocumentViewerScreen> {
117116 _focusNode.dispose ();
118117 super .dispose ();
119118 }
120- }
119+ }
0 commit comments