Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
63 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:git_touch/models/auth.dart'; | ||
import 'package:git_touch/models/gitee.dart'; | ||
import 'package:git_touch/scaffolds/refresh_stateful.dart'; | ||
import 'package:git_touch/widgets/action_entry.dart'; | ||
import 'package:git_touch/widgets/app_bar_title.dart'; | ||
import 'package:git_touch/widgets/blob_view.dart'; | ||
import 'package:provider/provider.dart'; | ||
|
||
class GeBlobScreen extends StatelessWidget { | ||
final String owner; | ||
final String name; | ||
final String sha; | ||
final String path; | ||
GeBlobScreen(this.owner, this.name, this.sha, this.path); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return RefreshStatefulScaffold<String>( | ||
title: AppBarTitle('File'), | ||
fetch: () async { | ||
final auth = context.read<AuthModel>(); | ||
final res = await auth.fetchGitee('/repos/$owner/$name/git/blobs/$sha'); | ||
return GiteeBlob.fromJson(res).content; | ||
}, | ||
action: ActionEntry(iconData: Icons.settings, url: '/choose-code-theme'), | ||
bodyBuilder: (content, _) { | ||
return BlobView(path, base64Text: content); | ||
}, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters