mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-26 08:36:50 +08:00
NullSafety++
This commit is contained in:
@ -1,13 +1,10 @@
|
||||
// @dart=2.9
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:meta/meta.dart';
|
||||
|
||||
class NoteImage extends Equatable {
|
||||
final String url;
|
||||
final String alt;
|
||||
|
||||
NoteImage({@required this.url, @required this.alt});
|
||||
NoteImage({required this.url, required this.alt});
|
||||
|
||||
@override
|
||||
List<Object> get props => [url, alt];
|
||||
@ -26,7 +23,7 @@ class ImageExtractor {
|
||||
var alt = match.group(1);
|
||||
var url = match.group(2);
|
||||
|
||||
images.add(NoteImage(alt: alt, url: url));
|
||||
images.add(NoteImage(alt: alt ?? "", url: url ?? ""));
|
||||
}
|
||||
|
||||
return images;
|
||||
|
@ -1,5 +1,3 @@
|
||||
// @dart=2.9
|
||||
|
||||
/*
|
||||
(c) Copyright 2020 Vishesh Handa
|
||||
|
||||
@ -26,12 +24,10 @@
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
import 'package:meta/meta.dart';
|
||||
|
||||
class InlineTagsProcessor {
|
||||
final Set<String> tagPrefixes;
|
||||
|
||||
InlineTagsProcessor({@required this.tagPrefixes});
|
||||
InlineTagsProcessor({required this.tagPrefixes});
|
||||
|
||||
Set<String> extractTags(String text) {
|
||||
var tags = <String>{};
|
||||
@ -46,7 +42,7 @@ class InlineTagsProcessor {
|
||||
var regexp = RegExp(r'(^|\s)' + p + r'([^\s]+)(\s|$)');
|
||||
var matches = regexp.allMatches(text);
|
||||
for (var match in matches) {
|
||||
var tag = match.group(2);
|
||||
var tag = match.group(2)!;
|
||||
|
||||
if (tag.endsWith('.') || tag.endsWith('!') || tag.endsWith('?')) {
|
||||
tag = tag.substring(0, tag.length - 1);
|
||||
|
@ -1,5 +1,3 @@
|
||||
// @dart=2.9
|
||||
|
||||
/*
|
||||
Code adapted from https://github.com/TheAlphamerc/flutter_login_signup/
|
||||
|
||||
@ -43,9 +41,9 @@ import 'package:gitjournal/widgets/scroll_view_without_animation.dart';
|
||||
// const _prodServer = 'https://api.gitjournal.io/auth/';
|
||||
|
||||
class LoginPage extends StatefulWidget {
|
||||
LoginPage({Key key, this.title}) : super(key: key);
|
||||
LoginPage({Key? key, this.title}) : super(key: key);
|
||||
|
||||
final String title;
|
||||
final String? title;
|
||||
|
||||
@override
|
||||
_LoginPageState createState() => _LoginPageState();
|
||||
@ -90,9 +88,7 @@ class _LoginPageState extends State<LoginPage> {
|
||||
);
|
||||
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
_loginAction();
|
||||
},
|
||||
onTap: _loginAction,
|
||||
child: c,
|
||||
);
|
||||
}
|
||||
@ -318,7 +314,7 @@ class FormTitle extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var textTheme = Theme.of(context).textTheme;
|
||||
var style = textTheme.headline2.copyWith(fontFamily: "Lato");
|
||||
var style = textTheme.headline2!.copyWith(fontFamily: "Lato");
|
||||
return Text('GitJournal', style: style);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,3 @@
|
||||
// @dart=2.9
|
||||
|
||||
/*
|
||||
Copyright 2020-2021 Vishesh Handa <me@vhanda.in>
|
||||
|
||||
|
@ -1,9 +1,6 @@
|
||||
// @dart=2.9
|
||||
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:git_bindings/git_bindings.dart' as gb;
|
||||
import 'package:meta/meta.dart';
|
||||
import 'package:path/path.dart' as p;
|
||||
|
||||
import 'package:gitjournal/utils/logger.dart';
|
||||
@ -16,15 +13,15 @@ class SshKey {
|
||||
final String password;
|
||||
|
||||
const SshKey({
|
||||
@required this.publicKey,
|
||||
@required this.privateKey,
|
||||
@required this.password,
|
||||
required this.publicKey,
|
||||
required this.privateKey,
|
||||
required this.password,
|
||||
});
|
||||
}
|
||||
|
||||
final bool useDartKeyGen = false;
|
||||
|
||||
Future<SshKey> generateSSHKeys({@required String comment}) async {
|
||||
Future<SshKey?> generateSSHKeys({required String comment}) async {
|
||||
if (useDartKeyGen) {
|
||||
//return generateSSHKeysDart(comment: comment);
|
||||
} else {}
|
||||
@ -51,7 +48,7 @@ Future<SshKey> generateSSHKeysDart({@required String comment}) async {
|
||||
}
|
||||
*/
|
||||
|
||||
Future<SshKey> generateSSHKeysNative({@required String comment}) async {
|
||||
Future<SshKey?> generateSSHKeysNative({required String comment}) async {
|
||||
try {
|
||||
var stopwatch = Stopwatch()..start();
|
||||
var dir = await Directory.systemTemp.createTemp('keys');
|
||||
|
@ -1,5 +1,3 @@
|
||||
// @dart=2.9
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ScrollViewWithoutAnimation extends StatelessWidget {
|
||||
@ -7,7 +5,7 @@ class ScrollViewWithoutAnimation extends StatelessWidget {
|
||||
final Axis scrollDirection;
|
||||
|
||||
ScrollViewWithoutAnimation({
|
||||
@required this.child,
|
||||
required this.child,
|
||||
this.scrollDirection = Axis.vertical,
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user