diff --git a/example/lib/main.dart b/example/lib/main.dart index ca7dde9..8741d99 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -12,18 +12,9 @@ class MyApp extends StatelessWidget { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( - // This is the theme of your application. - // - // Try running your application with "flutter run". You'll see the - // application has a blue toolbar. Then, without quitting the app, try - // changing the primarySwatch below to Colors.green and then invoke - // "hot reload" (press "r" in the console where you ran "flutter run", - // or simply save your changes to "hot reload" in a Flutter IDE). - // Notice that the counter didn't reset back to zero; the application - // is not restarted. primarySwatch: Colors.blue, ), - home: MyHomePage(title: 'Flutter Demo Home Page'), + home: MyHomePage(title: 'Rich Editor Demo'), ); } } diff --git a/lib/src/models/button.dart b/lib/src/models/button.dart index 0b9e030..6964e98 100644 --- a/lib/src/models/button.dart +++ b/lib/src/models/button.dart @@ -2,8 +2,9 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class Button { + String? slug; IconData? icon; Function? onTap; - Button({this.icon, this.onTap}); + Button({this.slug, this.icon, this.onTap}); } diff --git a/lib/src/rendering/rich_editor.dart b/lib/src/rendering/rich_editor.dart index 936abb6..ab85263 100644 --- a/lib/src/rendering/rich_editor.dart +++ b/lib/src/rendering/rich_editor.dart @@ -1,5 +1,7 @@ import 'dart:io'; +import 'package:flutter/foundation.dart'; +import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:rich_editor/src/services/local_server.dart'; import 'package:rich_editor/src/widgets/tabs.dart'; @@ -65,7 +67,7 @@ class _RichEditorState extends State { return Column( children: [ GroupedTab(controller: _controller), - Flexible( + Expanded( child: WebView( key: _mapKey, // initialUrl: @@ -82,6 +84,11 @@ class _RichEditorState extends State { } }, javascriptMode: JavascriptMode.unrestricted, + gestureNavigationEnabled: true, + gestureRecognizers: [ + Factory( + () => VerticalDragGestureRecognizer()..onUpdate = (_) {}), + ].toSet(), onWebResourceError: (e) { print("error ${e.description}"); }, diff --git a/lib/src/utils/constants.dart b/lib/src/utils/constants.dart index b9557a3..6c78fb6 100644 --- a/lib/src/utils/constants.dart +++ b/lib/src/utils/constants.dart @@ -16,7 +16,7 @@ List