Skip to content

Commit

Permalink
fix: drop svg support to avoid readme screen frozen
Browse files Browse the repository at this point in the history
closes #112
  • Loading branch information
pd4d10 committed Oct 8, 2020
1 parent 62b02ed commit 968019b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
15 changes: 7 additions & 8 deletions lib/screens/gl_project.dart
@@ -1,7 +1,6 @@
import 'package:filesize/filesize.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_svg/svg.dart';
import 'package:git_touch/models/auth.dart';
import 'package:git_touch/models/gitlab.dart';
import 'package:git_touch/scaffolds/refresh_stateful.dart';
Expand Down Expand Up @@ -77,13 +76,13 @@ class GlProjectScreen extends StatelessWidget {
owner: p.namespace.name,
name: p.name,
description: p.description,
trailings: <Widget>[
if (badges.isNotEmpty)
Wrap(spacing: 4, runSpacing: 4, children: [
for (var label in badges)
SvgPicture.network(label.renderedImageUrl, height: 20),
])
],
// trailings: <Widget>[
// if (badges.isNotEmpty)
// Wrap(spacing: 4, runSpacing: 4, children: [
// for (var label in badges)
// SvgPicture.network(label.renderedImageUrl, height: 20),
// ])
// ],
),
CommonStyle.border,
Row(
Expand Down
13 changes: 6 additions & 7 deletions lib/widgets/markdown_view.dart
@@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_markdown/flutter_markdown.dart';
import 'package:flutter_svg/svg.dart';
import 'package:git_touch/models/code.dart';
import 'package:git_touch/models/theme.dart';
import 'package:git_touch/utils/utils.dart';
Expand Down Expand Up @@ -33,13 +32,13 @@ class MarkdownView extends StatelessWidget {
selectable: true,
imageBuilder: (uri, title, alt) {
if (uri.scheme == 'http' || uri.scheme == 'https') {
if (uri.path.endsWith('.svg')) {
return SvgPicture.network(uri.toString());
} else {
return Image.network(uri.toString());
}
// TODO: svg support
// if (uri.path.endsWith('.svg')) {
// return SvgPicture.network(uri.toString());
// }
return Image.network(uri.toString());
} else {
return Container();
return Container(); // TODO: relative path image
}
},
onTapLink: (url) {
Expand Down

0 comments on commit 968019b

Please sign in to comment.