This is the git image of Zefyr with the version number below. Pub can also search for [last version].

Zefyr: ^ 0.6.0&& image_picker: ^0.5.0

Image_picker is not the latest version and has not been updated by the author.


Example:

import 'dart:async';
import 'dart:convert';
import 'package:image_picker/image_picker.dart';
import 'package:flutter/material.dart';
import 'package:quill_delta/quill_delta.dart';
import 'package:zefyr/zefyr.dart';
import '.. /.. /.. /services/service_method.dart'; // Personal request (can be deleted) import'.. /.. /.. /services/service_path.dart'; Class ZefyrLogo extends StatelessWidget {@override Widget build(BuildContext context) {return Row(
      mainAxisAlignment: MainAxisAlignment.center,
      children: <Widget>[
        Text('MDEditor'),]); } } class UploadEdit extends StatefulWidget { @override _UploadEditState createState() => new _UploadEditState(); } // Load text (rendering can do this, not rendering can be empty) final doc = r'[{"insert":"Code blocks"},{"insert":"\n","attributes":{"heading":2}},{"insert":"Of course:\nimport 'package: flutter/material. The dart'; "}, {" insert ":" \ n ", "attributes" : {" block ":" code "}}, {" insert ", "import" package: zefyr/zefyr dart "; "},{"insert":"\n\n","attributes":{"block":"code"}},{"insert":"void main() {"},{"insert":"\n","attributes":{"block":"code"}},{"insert":" runApp(MyWAD()); "},{"insert":"\n","attributes":{"block":"code"}},{"insert":"}"},{"insert":"\n","attributes":{"block":"code"}},{"insert": "Uh-huh \ n \ n"}, {" insert ":" ", "attributes" : {" embed ": {" type" : "image", "source" : "http://192.168.1.111:9000/static/articlePictre/G WBLPQHUIKmmexport1501334097933.jpg"}}},{"insert":"\n\n"}]';

Delta getDelta() {
  return Delta.fromJson(json.decode(doc) as List);
}

class _UploadEditState extends State<UploadEdit> {
  final ZefyrController _controller =
      ZefyrController(NotusDocument.fromDelta(getDelta()));
  final FocusNode _focusNode = new FocusNode();
  bool _editing = false;
  StreamSubscription<NotusChange> _sub;

  @override
  void initState() { super.initState(); _sub = _controller. Document. Changes. Listen ((change) {/ / change the number of rows, and its contentprint('change.source is ${change.source}:\n change.change is ${change.change}'); // Convert to delta (normally converted to this processing)print("Delta() is>>>>>>>>>>>>>>>>>>>>. ${_controller.document.toDelta()} \n"); // Convert to Jsonprint("Json() is>>>>>>>>>>>>>>>>>>>>. ${json.encode(_controller.document.toJson()) } \n"); // Convert to stringprint("String() is>>>>>>>>>>>>>>>>>>>>. ${_controller.document.toString()} \n");
    });
  }

  @override
  void dispose() {// Release _sub.cancel(); super.dispose(); } @override Widget build(BuildContext context) {// Change the style final theme = new ZefyrThemeData(cursorColor: Colors.blue, toolbarTheme: ZefyrToolbarTheme.fallback(context).copyWith( color: Colors.grey.shade800, toggleColor: Colors.grey.shade900, iconColor: Colors.white, disabledIconColor: Colors.grey.shade500, ), ); finaldone = _editing
        ? [new FlatButton(onPressed: _stopEditing, child: Text('DONE'))]
        : [new FlatButton(onPressed: _startEditing, child: Text('EDIT'))];
        
    return Scaffold(
      resizeToAvoidBottomPadding: true, appBar: appBar (Elevation: 1.0, backgroundColor: color.grey. shade200, Thumbnail: Thumbnail. ZefyrLogo(), actions:done,
      ),
      body: ZefyrScaffold(
        child: ZefyrTheme(
          data: theme,
          child: ZefyrEditor(
            controller: _controller,
            focusNode: _focusNode,
            enabled: _editing,
            imageDelegate: new CustomImageDelegate(),
          ),
        ),
      ),
    );
  }

  void _startEditing() {
    setState(() {
      _editing = true;
    });
  }

  void _stopEditing() {
    setState(() {
      _editing = false;
    });
  }
}

/// Custom image delegate used by this example to load image from application
/// assets.
///
/// Default image delegate only supports [FileImage]s.
class CustomImageDelegate extends ZefyrDefaultImageDelegate {
  String url = "";
  
  @override
  Future<String> pickImage(ImageSource source) async {
    final file = await ImagePicker.pickImage(source: source);
    if (file == null) returnnull; // Use my storage service to upload selected file. The uploadImage method // returns unique ID of newly uploaded image Var request = await requestFile () var request = await requestfile("url",file, null);
    print(request);
    if(request["code"] = ="200") {
      print("Picture uploaded successfully");
    } else {
      print("Picture uploading failed");
    }
      url = "$SERVER_URL/static/articlePictre/${request["data"]}";
    return url;
  }

  @override
  Widget buildImage(BuildContext context, String imageSource) {
    // We use custom "asset" scheme to distinguish asset images from other files.
    print("imageSource is $imageSource"); // Get just now herereturnThe url is the text content of the delta. Do not use the above URL, just imageSourcereturnImage.network(imageSource); }}Copy the code

Lazy and did not reconstruct the Model and class classes to write, but the basic content can be satisfied, the video should be handled separately, this package does not provide such content.