mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-07-01 04:07:53 +08:00
MarkdownViewer: Use EditorScrollView
This way we don't show that annoying animation, and we now occupy the entire available width. Otheriwse if you had text which was required scrolling, but only had 1 word in each line, then you couldn't scroll by dragging on the empty area as the widget didn't occupy that space.
This commit is contained in:
@ -27,6 +27,7 @@ class EditorScrollView extends StatelessWidget {
|
||||
child: ConstrainedBox(
|
||||
constraints: BoxConstraints(
|
||||
minHeight: constraints.maxHeight,
|
||||
minWidth: constraints.maxWidth,
|
||||
),
|
||||
child: child,
|
||||
),
|
||||
|
@ -6,6 +6,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_markdown/flutter_markdown.dart';
|
||||
import 'package:gitjournal/folder_views/common.dart';
|
||||
import 'package:gitjournal/utils.dart';
|
||||
import 'package:gitjournal/widgets/editor_scroll_view.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import 'package:path/path.dart' as p;
|
||||
@ -46,7 +47,7 @@ class NoteViewer extends StatelessWidget {
|
||||
),
|
||||
);
|
||||
|
||||
var view = SingleChildScrollView(
|
||||
var view = EditorScrollView(
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
if (note.canHaveMetadata) NoteTitleHeader(note.title),
|
||||
@ -78,7 +79,6 @@ class NoteViewer extends StatelessWidget {
|
||||
],
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
),
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
);
|
||||
|
||||
return view;
|
||||
|
Reference in New Issue
Block a user