mirror of
https://github.com/git-touch/git-touch
synced 2025-01-19 02:40:05 +01:00
chore(gl): commit screen
This commit is contained in:
parent
98f102faec
commit
b088ccaae7
@ -1,11 +1,17 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_highlight/flutter_highlight.dart';
|
||||
import 'package:flutter_highlight/theme_map.dart';
|
||||
import 'package:git_touch/models/auth.dart';
|
||||
import 'package:git_touch/models/code.dart';
|
||||
import 'package:git_touch/models/gitlab.dart';
|
||||
import 'package:git_touch/models/theme.dart';
|
||||
import 'package:git_touch/scaffolds/refresh_stateful.dart';
|
||||
import 'package:git_touch/utils/utils.dart';
|
||||
import 'package:git_touch/widgets/app_bar_title.dart';
|
||||
import 'package:git_touch/widgets/diff_view.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
// TODO:
|
||||
class GlCommitScreen extends StatelessWidget {
|
||||
final String id;
|
||||
final String sha;
|
||||
@ -20,6 +26,9 @@ class GlCommitScreen extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final codeProvider = Provider.of<CodeModel>(context);
|
||||
final theme = Provider.of<ThemeModel>(context);
|
||||
|
||||
return RefreshStatefulScaffold<List<GitlabDiff>>(
|
||||
title: AppBarTitle('Commits'),
|
||||
fetchData: () => _query(context),
|
||||
@ -27,7 +36,21 @@ class GlCommitScreen extends StatelessWidget {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
for (var item in items) DiffView(item.diff),
|
||||
for (var item in items)
|
||||
SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: HighlightView(
|
||||
item.diff,
|
||||
language: 'diff',
|
||||
theme: themeMap[theme.brightness == Brightness.dark
|
||||
? codeProvider.themeDark
|
||||
: codeProvider.theme],
|
||||
padding: CommonStyle.padding,
|
||||
textStyle: TextStyle(
|
||||
fontSize: codeProvider.fontSize.toDouble(),
|
||||
fontFamily: codeProvider.fontFamilyUsed),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user