Skip to content

Commit

Permalink
more bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
namanshergill committed Apr 4, 2021
1 parent dfaf852 commit b5ce327
Show file tree
Hide file tree
Showing 14 changed files with 295 additions and 752 deletions.
33 changes: 15 additions & 18 deletions lib/common/app_scroll_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -99,24 +99,21 @@ class ScrollViewAppBar extends StatelessWidget {
),
bottom: PreferredSize(
preferredSize: Size.fromHeight(bottomPadding ?? 0),
child: Container(
color: AppColor.background,
child: Column(
children: [
Padding(
padding: EdgeInsets.symmetric(horizontal: 24),
child: bottomHeader ?? Container(),
),
AppTabBar(
controller: tabController,
tabs: List.generate(
tabs!.length,
(index) => AppTab(
title: tabs![index],
)),
),
],
),
child: Column(
children: [
Padding(
padding: EdgeInsets.symmetric(horizontal: 24),
child: bottomHeader ?? Container(),
),
AppTabBar(
controller: tabController,
tabs: List.generate(
tabs!.length,
(index) => AppTab(
title: tabs![index],
)),
),
],
),
),
);
Expand Down
63 changes: 33 additions & 30 deletions lib/common/app_tab_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,39 @@ class AppTabBar extends StatelessWidget {
: _tabController = controller;
@override
Widget build(BuildContext context) {
return Column(
children: [
// Divider(
// height: 0,
// color: AppColor.grey3,
// thickness: 0.2,
// ),
TabBar(
physics: BouncingScrollPhysics(),
isScrollable: true,
controller: _tabController,
indicator: BoxDecoration(
borderRadius: AppThemeBorderRadius.bigBorderRadius,
color: AppColor.accent),
unselectedLabelColor: AppColor.grey3,
labelStyle: Theme.of(context)
.textTheme
.headline6!
.copyWith(fontSize: 14, fontWeight: FontWeight.w600),
indicatorPadding:
EdgeInsets.only(left: 8, right: 8, bottom: 8, top: 8),
labelPadding: EdgeInsets.only(left: 8, right: 8, bottom: 8, top: 8),
tabs: tabs!,
),
// Divider(
// height: 0,
// color: AppColor.grey3,
// thickness: 0.2,
// ),
],
return Container(
color: AppColor.background,
child: Column(
children: [
// Divider(
// height: 0,
// color: AppColor.grey3,
// thickness: 0.2,
// ),
TabBar(
physics: BouncingScrollPhysics(),
isScrollable: true,
controller: _tabController,
indicator: BoxDecoration(
borderRadius: AppThemeBorderRadius.bigBorderRadius,
color: AppColor.accent),
unselectedLabelColor: AppColor.grey3,
labelStyle: Theme.of(context)
.textTheme
.headline6!
.copyWith(fontSize: 14, fontWeight: FontWeight.w600),
indicatorPadding:
EdgeInsets.only(left: 8, right: 8, bottom: 8, top: 8),
labelPadding: EdgeInsets.only(left: 8, right: 8, bottom: 8, top: 8),
tabs: tabs!,
),
// Divider(
// height: 0,
// color: AppColor.grey3,
// thickness: 0.2,
// ),
],
),
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/common/bottom_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ void showScrollableBottomActionsMenu(BuildContext context,
builder: (context) {
final _media = MediaQuery.of(context).size;
return DraggableScrollableSheet(
initialChildSize: 1,
initialChildSize: 0.7,
maxChildSize: 1,
expand: false,
minChildSize: 0.6,
Expand Down
10 changes: 9 additions & 1 deletion lib/common/infinite_scroll_wrapper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ class InfiniteScrollWrapper<T> extends StatefulWidget {
/// First page loading indicator.
final WidgetBuilder? firstPageLoadingBuilder;

/// ListView ScrollController.
final ScrollController? scrollController;

InfiniteScrollWrapper(
{Key? key,
required this.future,
Expand All @@ -76,6 +79,7 @@ class InfiniteScrollWrapper<T> extends StatefulWidget {
this.topSpacing = 0,
this.firstDivider = true,
this.firstPageLoadingBuilder,
this.scrollController,
this.listEndIndicator = true,
this.spacing = 16})
: super(key: key);
Expand Down Expand Up @@ -161,6 +165,7 @@ class _InfiniteScrollWrapperState<T> extends State<InfiniteScrollWrapper<T?>> {
resetAndRefresh();
}),
child: PagedListView<int, T>(
scrollController: widget.scrollController,
physics: BouncingScrollPhysics(),
pagingController: _pagingController,
builderDelegate: PagedChildBuilderDelegate<T>(
Expand Down Expand Up @@ -191,7 +196,10 @@ class _InfiniteScrollWrapperState<T> extends State<InfiniteScrollWrapper<T?>> {
firstPageProgressIndicatorBuilder: (context) =>
widget.firstPageLoadingBuilder != null
? widget.firstPageLoadingBuilder!(context)
: LoadingIndicator(),
: Padding(
padding: const EdgeInsets.all(32.0),
child: LoadingIndicator(),
),
newPageProgressIndicatorBuilder: (context) => Padding(
padding: const EdgeInsets.all(32.0),
child: LoadingIndicator(),
Expand Down
2 changes: 2 additions & 0 deletions lib/common/markdown_body.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import 'package:onehub/common/image_loader.dart';
import 'package:onehub/common/shimmer_widget.dart';
import 'package:onehub/style/borderRadiuses.dart';
import 'package:onehub/style/colors.dart';
import 'package:onehub/utils/markdown_emoji.dart';
import 'package:onehub/utils/regex.dart';

class MarkdownBodyController {
Expand Down Expand Up @@ -43,6 +44,7 @@ class _MarkdownBodyState extends State<MarkdownBody> {
}

void updateData(String data) {
data = emoteText(data);
data = md.markdownToHtml(data);
var document = parse(data);
// The list of tags to perform modifications on.
Expand Down
7 changes: 4 additions & 3 deletions lib/models/issues/issue_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import 'dart:convert';

import 'package:onehub/models/issues/issue_timeline_event_model.dart';
import 'package:onehub/models/repositories/repository_model.dart';
import 'package:onehub/models/users/user_info_model.dart';

class IssueModel {
Expand Down Expand Up @@ -65,7 +66,7 @@ class IssueModel {
DateTime? closedAt;
AuthorAssociation? authorAssociation;
dynamic activeLockReason;
Repository? repository;
RepositoryModel? repository;
String? body;
String? timelineUrl;
dynamic performedViaGithubApp;
Expand Down Expand Up @@ -96,7 +97,7 @@ class IssueModel {
DateTime? closedAt,
AuthorAssociation? authorAssociation,
dynamic activeLockReason,
Repository? repository,
RepositoryModel? repository,
String? body,
String? timelineUrl,
dynamic performedViaGithubApp,
Expand Down Expand Up @@ -186,7 +187,7 @@ class IssueModel {
activeLockReason: json["active_lock_reason"],
repository: json["repository"] == null
? null
: Repository.fromJson(json["repository"]),
: RepositoryModel.fromJson(json["repository"]),
body: json["body"] == null ? null : json["body"],
timelineUrl: json["timeline_url"] == null ? null : json["timeline_url"],
performedViaGithubApp: json["performed_via_github_app"],
Expand Down
Loading

0 comments on commit b5ce327

Please sign in to comment.