Browse Source

fix example

lucky1213 4 years ago
parent
commit
d7bf355974

+ 2
- 5
packages/zefyr/example/lib/src/full_page.dart View File

161
           // ),
161
           // ),
162
           Expanded(
162
           Expanded(
163
             child: ZefyrScaffold(
163
             child: ZefyrScaffold(
164
-              child: ZefyrTheme(
165
-                data: ZefyrThemeData(),
166
-                child: ZefyrEditor(
164
+              child: ZefyrEditor(
167
                   autofocus: false,
165
                   autofocus: false,
168
                   controller: _controller,
166
                   controller: _controller,
169
                   focusNode: _focusNode,
167
                   focusNode: _focusNode,
176
                     print(_controller.document.toJson());
174
                     print(_controller.document.toJson());
177
                   },
175
                   },
178
                 ),
176
                 ),
179
-              ),
180
             ),
177
             ),
181
           ),
178
           ),
182
         ],
179
         ],
188
     return GestureDetector(
185
     return GestureDetector(
189
       behavior: HitTestBehavior.translucent,
186
       behavior: HitTestBehavior.translucent,
190
       onTap: () {
187
       onTap: () {
191
-        FocusScope.of(context).unfocus();
188
+        primaryFocus.unfocus();
192
       },
189
       },
193
       child: Theme(
190
       child: Theme(
194
         data: ThemeData(primarySwatch: Colors.cyan),
191
         data: ThemeData(primarySwatch: Colors.cyan),

+ 2
- 7
packages/zefyr/example/lib/src/images.dart View File

14
 
14
 
15
 /// Custom image delegate used by this example to load image from application
15
 /// Custom image delegate used by this example to load image from application
16
 /// assets.
16
 /// assets.
17
-class CustomImageDelegate implements ZefyrImageDelegate<ImageSource> {
18
-  @override
19
-  ImageSource get cameraSource => ImageSource.camera;
20
-
21
-  @override
22
-  ImageSource get gallerySource => ImageSource.gallery;
23
-
17
+class CustomImageDelegate implements ZefyrImageDelegate {
18
+  
24
   @override
19
   @override
25
   Future<String> pickImage(ImageSource source) async {
20
   Future<String> pickImage(ImageSource source) async {
26
     final file = await ImagePicker.pickImage(source: source);
21
     final file = await ImagePicker.pickImage(source: source);