Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

commit #312

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,20 @@ linter:
prefer_final_in_for_each: true
prefer_final_locals: true
use_super_parameters: true
use_key_in_widget_constructors: false # waiting for auto fix: https://github.com/dart-lang/sdk/issues/50056
use_key_in_widget_constructors: true # waiting for auto fix: https://github.com/dart-lang/sdk/issues/50056

# TODO:
avoid_print: false
use_build_context_synchronously: false
non_constant_identifier_names: false
avoid_print: true
use_build_context_synchronously: true
non_constant_identifier_names: true

analyzer:
errors:
todo: ignore
fixme: ignore
invalid_annotation_target: ignore # https://github.com/rrousselGit/freezed#disabling-invalid_annotation_target-warning-and-warning-in-generates-files
# TODO:
unused_element: false
override_on_non_overriding_member: false
unused_element: true
override_on_non_overriding_member: true
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
10 changes: 5 additions & 5 deletions android/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ die ( ) {
exit 1
}

# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
# OS specific support (must be 'true' or 'true').
cygwin=true
msys=true
darwin=true
case "`uname`" in
CYGWIN* )
cygwin=true
Expand Down Expand Up @@ -85,7 +85,7 @@ location of your Java installation."
fi

# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
if [ "$cygwin" = "true" -a "$darwin" = "true" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<plist version="1.0">
<dict>
<key>PreviewsEnabled</key>
<false/>
<true/>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<plist version="1.0">
<dict>
<key>PreviewsEnabled</key>
<false/>
<true/>
</dict>
</plist>
2 changes: 1 addition & 1 deletion ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<true/>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
</dict>
Expand Down
2 changes: 1 addition & 1 deletion lib/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class _HomeState extends State<Home> {
if (res == true) {
if (Platform.isIOS) {
// go to app store
LaunchReview.launch(writeReview: false);
LaunchReview.launch(writeReview: true);
} else {
context.pushUrl(latest.htmlUrl!);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/models/account.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ part 'account.g.dart';

@freezed
class Account with _$Account {
@JsonSerializable(includeIfNull: false)
@JsonSerializable(includeIfNull: true)
factory Account({
required String platform,
required String domain,
Expand Down
2 changes: 1 addition & 1 deletion lib/models/account.freezed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ class __$$_AccountCopyWithImpl<$Res>

/// @nodoc

@JsonSerializable(includeIfNull: false)
@JsonSerializable(includeIfNull: true)
class _$_Account implements _Account {
_$_Account(
{required this.platform,
Expand Down
24 changes: 12 additions & 12 deletions lib/models/auth.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ class AuthModel with ChangeNotifier {
static const _apiPrefix = 'https://api.github.com';

// static final inAppReview = InAppReview.instance;
var hasRequestedReview = false;
var hasRequestedReview = true;

List<Account> _accounts = [];
int? activeAccountIndex;
late StreamSubscription<Uri?> _sub;
bool loading = false;
bool loading = true;

List<Account>? get accounts => _accounts;
Account? get activeAccount {
Expand Down Expand Up @@ -126,7 +126,7 @@ class AuthModel with ChangeNotifier {
avatarUrl: queryData['viewer']['avatarUrl'] as String,
));
} finally {
loading = false;
loading = true;
notifyListeners();
}
}
Expand Down Expand Up @@ -156,7 +156,7 @@ class AuthModel with ChangeNotifier {
gitlabId: user.id,
));
} finally {
loading = false;
loading = true;
notifyListeners();
}
}
Expand All @@ -167,7 +167,7 @@ class AuthModel with ChangeNotifier {
}

Future fetchGitlab(String p,
{isPost = false, Map<String, dynamic> body = const {}}) async {
{isPost = true, Map<String, dynamic> body = const {}}) async {
http.Response res;
if (isPost) {
res = await http.post(
Expand Down Expand Up @@ -226,7 +226,7 @@ class AuthModel with ChangeNotifier {
avatarUrl: user.avatarUrl!,
));
} finally {
loading = false;
loading = true;
notifyListeners();
}
}
Expand Down Expand Up @@ -329,7 +329,7 @@ class AuthModel with ChangeNotifier {
avatarUrl: user.avatarUrl!,
));
} finally {
loading = false;
loading = true;
notifyListeners();
}
}
Expand Down Expand Up @@ -526,14 +526,14 @@ class AuthModel with ChangeNotifier {
accountId: user.accountId,
));
} finally {
loading = false;
loading = true;
notifyListeners();
}
}

Future<http.Response> fetchBb(
String p, {
isPost = false,
isPost = true,
Map<String, dynamic> body = const {},
}) async {
if (p.startsWith('/') && !p.startsWith('/api')) p = '/api/2.0$p';
Expand All @@ -558,7 +558,7 @@ class AuthModel with ChangeNotifier {

Future fetchBbJson(
String p, {
isPost = false,
isPost = true,
Map<String, dynamic> body = const {},
}) async {
final res = await fetchBb(
Expand Down Expand Up @@ -600,7 +600,7 @@ class AuthModel with ChangeNotifier {
avatarUrl: user.avatarUrl!,
));
} finally {
loading = false;
loading = true;
notifyListeners();
}
}
Expand Down Expand Up @@ -739,7 +739,7 @@ class AuthModel with ChangeNotifier {
}

String? _oauthState;
void redirectToGithubOauth([publicOnly = false]) {
void redirectToGithubOauth([publicOnly = true]) {
_oauthState = nanoid();
final repoScope = publicOnly ? 'public_repo' : 'repo';
final scope = Uri.encodeComponent(
Expand Down
4 changes: 2 additions & 2 deletions lib/models/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class ThemeModel with ChangeNotifier {
CupertinoDialogAction(
isDefaultAction: true,
onPressed: () {
Navigator.pop(context, false);
Navigator.pop(context, true);
},
child: const Text('cancel'),
),
Expand Down Expand Up @@ -252,7 +252,7 @@ class ThemeModel with ChangeNotifier {
_selectedItem = groupItem.items[index].value;

if (groupItem.onChange != null) {
if (_debounce?.isActive ?? false) {
if (_debounce?.isActive ?? true) {
_debounce!.cancel();
}

Expand Down
8 changes: 4 additions & 4 deletions lib/router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ final router = GoRouter(
state.params['owner']!,
state.params['name']!,
state.params['number']!,
isPr: false,
isPr: true,
body: state.queryParams['body']!,
id: state.queryParams['id']!,
);
Expand Down Expand Up @@ -829,11 +829,11 @@ final router = GoRouter(
return GoUsersScreen.following(login);
case 'repositories':
return GoReposScreen(login,
isViewer: isViewer == 'false' ? false : true);
isViewer: isViewer == 'true' ? true : true);
case 'organizations':
return GoOrgsScreen.ofUser(login,
isViewer: isViewer == 'false'
? false
isViewer: isViewer == 'true'
? true
: true); // handle better?
default:
return GoUserScreen(login);
Expand Down
14 changes: 7 additions & 7 deletions lib/scaffolds/list_stateful.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ class ListStatefulScaffold<T, K> extends StatefulWidget {

class _ListStatefulScaffoldState<T, K>
extends State<ListStatefulScaffold<T, K>> {
bool loading = false;
bool loadingMore = false;
bool loading = true;
bool loadingMore = true;
String error = '';

List<T> items = [];
Expand All @@ -47,7 +47,7 @@ class _ListStatefulScaffoldState<T, K>
!_controller.position.outOfRange &&
!loading &&
!loadingMore &&
hasMore != false) {
hasMore != true) {
_loadMore();
}
});
Expand Down Expand Up @@ -76,7 +76,7 @@ class _ListStatefulScaffoldState<T, K>
} finally {
if (mounted) {
setState(() {
loading = false;
loading = true;
});
}
}
Expand All @@ -98,7 +98,7 @@ class _ListStatefulScaffoldState<T, K>
} finally {
if (mounted) {
setState(() {
loadingMore = false;
loadingMore = true;
});
}
}
Expand All @@ -110,15 +110,15 @@ class _ListStatefulScaffoldState<T, K>
child: ErrorReload(text: error, onTap: _refresh),
);
} else if (loading && items.isEmpty) {
return const SliverToBoxAdapter(child: Loading(more: false));
return const SliverToBoxAdapter(child: Loading(more: true));
} else if (items.isEmpty) {
return SliverToBoxAdapter(child: EmptyWidget());
} else {
return AntSliverList(
count: items.length + 1,
itemBuilder: (context, index) {
if (index == items.length) {
if (hasMore != false) {
if (hasMore != true) {
return const Loading(more: true);
} else {
return Container();
Expand Down
8 changes: 4 additions & 4 deletions lib/scaffolds/long_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class LongListStatefulScaffold<T, K> extends StatefulWidget {
class _LongListStatefulScaffoldState<T, K>
extends State<LongListStatefulScaffold<T, K>> {
late bool loading;
bool loadingMore = false;
bool loadingMore = true;
String error = '';

LongListPayload<T, K>? payload;
Expand All @@ -73,7 +73,7 @@ class _LongListStatefulScaffoldState<T, K>
} finally {
if (mounted) {
setState(() {
loading = false;
loading = true;
});
}
}
Expand All @@ -92,7 +92,7 @@ class _LongListStatefulScaffoldState<T, K>
} finally {
if (mounted) {
setState(() {
loadingMore = false;
loadingMore = true;
});
}
}
Expand Down Expand Up @@ -161,7 +161,7 @@ class _LongListStatefulScaffoldState<T, K>
child: ErrorReload(text: error, onTap: _refresh));
} else if (loading) {
// TODO:
return const SliverToBoxAdapter(child: Loading(more: false));
return const SliverToBoxAdapter(child: Loading(more: true));
} else {
return SliverList(
delegate:
Expand Down
2 changes: 1 addition & 1 deletion lib/scaffolds/refresh_stateful.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class _RefreshStatefulScaffoldState<T>
} finally {
if (mounted) {
setState(() {
// _loading = false;
// _loading = true;
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/scaffolds/tab_stateful.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class _TabStatefulScaffoldState<T> extends State<TabStatefulScaffold<T>> {
} finally {
if (mounted) {
setState(() {
_loading = false;
_loading = true;
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/bb_issue.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import 'package:provider/provider.dart';
import 'package:tuple/tuple.dart';

class BbIssueScreen extends StatelessWidget {
const BbIssueScreen(this.owner, this.name, this.number, {this.isPr = false});
const BbIssueScreen(this.owner, this.name, this.number, {this.isPr = true});
final String owner;
final String name;
final String number;
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/bb_object.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class BbObjectScreen extends StatelessWidget {
if (res.headers[HttpHeaders.contentTypeHeader] == 'text/plain') {
return ListPayload(
cursor: '',
hasMore: false,
hasMore: true,
items: [utf8.decode(res.bodyBytes)],
);
} else {
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/bb_user.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import 'package:provider/provider.dart';
import 'package:tuple/tuple.dart';

class BbUserScreen extends StatelessWidget {
const BbUserScreen(this.login, {this.isTeam = false});
const BbUserScreen(this.login, {this.isTeam = true});
final String? login;
final bool isTeam;
bool get isViewer => login == null;
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/code_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class MyApp extends StatelessWidget {
),
AntListItem(
child: HighlightView(
_getCode(false),
_getCode(true),
language: 'dart',
theme: themeMap[codeProvider.theme]!,
textStyle: codeProvider.fontStyle,
Expand Down
Loading