Skip to content

Commit b5ce327

Browse files
committed
more bug fixes
1 parent dfaf852 commit b5ce327

14 files changed

+295
-752
lines changed

lib/common/app_scroll_view.dart

+15-18
Original file line numberDiff line numberDiff line change
@@ -99,24 +99,21 @@ class ScrollViewAppBar extends StatelessWidget {
9999
),
100100
bottom: PreferredSize(
101101
preferredSize: Size.fromHeight(bottomPadding ?? 0),
102-
child: Container(
103-
color: AppColor.background,
104-
child: Column(
105-
children: [
106-
Padding(
107-
padding: EdgeInsets.symmetric(horizontal: 24),
108-
child: bottomHeader ?? Container(),
109-
),
110-
AppTabBar(
111-
controller: tabController,
112-
tabs: List.generate(
113-
tabs!.length,
114-
(index) => AppTab(
115-
title: tabs![index],
116-
)),
117-
),
118-
],
119-
),
102+
child: Column(
103+
children: [
104+
Padding(
105+
padding: EdgeInsets.symmetric(horizontal: 24),
106+
child: bottomHeader ?? Container(),
107+
),
108+
AppTabBar(
109+
controller: tabController,
110+
tabs: List.generate(
111+
tabs!.length,
112+
(index) => AppTab(
113+
title: tabs![index],
114+
)),
115+
),
116+
],
120117
),
121118
),
122119
);

lib/common/app_tab_bar.dart

+33-30
Original file line numberDiff line numberDiff line change
@@ -9,36 +9,39 @@ class AppTabBar extends StatelessWidget {
99
: _tabController = controller;
1010
@override
1111
Widget build(BuildContext context) {
12-
return Column(
13-
children: [
14-
// Divider(
15-
// height: 0,
16-
// color: AppColor.grey3,
17-
// thickness: 0.2,
18-
// ),
19-
TabBar(
20-
physics: BouncingScrollPhysics(),
21-
isScrollable: true,
22-
controller: _tabController,
23-
indicator: BoxDecoration(
24-
borderRadius: AppThemeBorderRadius.bigBorderRadius,
25-
color: AppColor.accent),
26-
unselectedLabelColor: AppColor.grey3,
27-
labelStyle: Theme.of(context)
28-
.textTheme
29-
.headline6!
30-
.copyWith(fontSize: 14, fontWeight: FontWeight.w600),
31-
indicatorPadding:
32-
EdgeInsets.only(left: 8, right: 8, bottom: 8, top: 8),
33-
labelPadding: EdgeInsets.only(left: 8, right: 8, bottom: 8, top: 8),
34-
tabs: tabs!,
35-
),
36-
// Divider(
37-
// height: 0,
38-
// color: AppColor.grey3,
39-
// thickness: 0.2,
40-
// ),
41-
],
12+
return Container(
13+
color: AppColor.background,
14+
child: Column(
15+
children: [
16+
// Divider(
17+
// height: 0,
18+
// color: AppColor.grey3,
19+
// thickness: 0.2,
20+
// ),
21+
TabBar(
22+
physics: BouncingScrollPhysics(),
23+
isScrollable: true,
24+
controller: _tabController,
25+
indicator: BoxDecoration(
26+
borderRadius: AppThemeBorderRadius.bigBorderRadius,
27+
color: AppColor.accent),
28+
unselectedLabelColor: AppColor.grey3,
29+
labelStyle: Theme.of(context)
30+
.textTheme
31+
.headline6!
32+
.copyWith(fontSize: 14, fontWeight: FontWeight.w600),
33+
indicatorPadding:
34+
EdgeInsets.only(left: 8, right: 8, bottom: 8, top: 8),
35+
labelPadding: EdgeInsets.only(left: 8, right: 8, bottom: 8, top: 8),
36+
tabs: tabs!,
37+
),
38+
// Divider(
39+
// height: 0,
40+
// color: AppColor.grey3,
41+
// thickness: 0.2,
42+
// ),
43+
],
44+
),
4245
);
4346
}
4447
}

lib/common/bottom_sheet.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ void showScrollableBottomActionsMenu(BuildContext context,
129129
builder: (context) {
130130
final _media = MediaQuery.of(context).size;
131131
return DraggableScrollableSheet(
132-
initialChildSize: 1,
132+
initialChildSize: 0.7,
133133
maxChildSize: 1,
134134
expand: false,
135135
minChildSize: 0.6,

lib/common/infinite_scroll_wrapper.dart

+9-1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ class InfiniteScrollWrapper<T> extends StatefulWidget {
6262
/// First page loading indicator.
6363
final WidgetBuilder? firstPageLoadingBuilder;
6464

65+
/// ListView ScrollController.
66+
final ScrollController? scrollController;
67+
6568
InfiniteScrollWrapper(
6669
{Key? key,
6770
required this.future,
@@ -76,6 +79,7 @@ class InfiniteScrollWrapper<T> extends StatefulWidget {
7679
this.topSpacing = 0,
7780
this.firstDivider = true,
7881
this.firstPageLoadingBuilder,
82+
this.scrollController,
7983
this.listEndIndicator = true,
8084
this.spacing = 16})
8185
: super(key: key);
@@ -161,6 +165,7 @@ class _InfiniteScrollWrapperState<T> extends State<InfiniteScrollWrapper<T?>> {
161165
resetAndRefresh();
162166
}),
163167
child: PagedListView<int, T>(
168+
scrollController: widget.scrollController,
164169
physics: BouncingScrollPhysics(),
165170
pagingController: _pagingController,
166171
builderDelegate: PagedChildBuilderDelegate<T>(
@@ -191,7 +196,10 @@ class _InfiniteScrollWrapperState<T> extends State<InfiniteScrollWrapper<T?>> {
191196
firstPageProgressIndicatorBuilder: (context) =>
192197
widget.firstPageLoadingBuilder != null
193198
? widget.firstPageLoadingBuilder!(context)
194-
: LoadingIndicator(),
199+
: Padding(
200+
padding: const EdgeInsets.all(32.0),
201+
child: LoadingIndicator(),
202+
),
195203
newPageProgressIndicatorBuilder: (context) => Padding(
196204
padding: const EdgeInsets.all(32.0),
197205
child: LoadingIndicator(),

lib/common/markdown_body.dart

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import 'package:onehub/common/image_loader.dart';
1313
import 'package:onehub/common/shimmer_widget.dart';
1414
import 'package:onehub/style/borderRadiuses.dart';
1515
import 'package:onehub/style/colors.dart';
16+
import 'package:onehub/utils/markdown_emoji.dart';
1617
import 'package:onehub/utils/regex.dart';
1718

1819
class MarkdownBodyController {
@@ -43,6 +44,7 @@ class _MarkdownBodyState extends State<MarkdownBody> {
4344
}
4445

4546
void updateData(String data) {
47+
data = emoteText(data);
4648
data = md.markdownToHtml(data);
4749
var document = parse(data);
4850
// The list of tags to perform modifications on.

lib/models/issues/issue_model.dart

+4-3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import 'dart:convert';
66

77
import 'package:onehub/models/issues/issue_timeline_event_model.dart';
8+
import 'package:onehub/models/repositories/repository_model.dart';
89
import 'package:onehub/models/users/user_info_model.dart';
910

1011
class IssueModel {
@@ -65,7 +66,7 @@ class IssueModel {
6566
DateTime? closedAt;
6667
AuthorAssociation? authorAssociation;
6768
dynamic activeLockReason;
68-
Repository? repository;
69+
RepositoryModel? repository;
6970
String? body;
7071
String? timelineUrl;
7172
dynamic performedViaGithubApp;
@@ -96,7 +97,7 @@ class IssueModel {
9697
DateTime? closedAt,
9798
AuthorAssociation? authorAssociation,
9899
dynamic activeLockReason,
99-
Repository? repository,
100+
RepositoryModel? repository,
100101
String? body,
101102
String? timelineUrl,
102103
dynamic performedViaGithubApp,
@@ -186,7 +187,7 @@ class IssueModel {
186187
activeLockReason: json["active_lock_reason"],
187188
repository: json["repository"] == null
188189
? null
189-
: Repository.fromJson(json["repository"]),
190+
: RepositoryModel.fromJson(json["repository"]),
190191
body: json["body"] == null ? null : json["body"],
191192
timelineUrl: json["timeline_url"] == null ? null : json["timeline_url"],
192193
performedViaGithubApp: json["performed_via_github_app"],

0 commit comments

Comments
 (0)