mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-28 01:45:55 +08:00
null safety++
This commit is contained in:
6
lib/folder_views/common_types.dart
Normal file
6
lib/folder_views/common_types.dart
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
enum FolderViewType {
|
||||||
|
Standard,
|
||||||
|
Journal,
|
||||||
|
Card,
|
||||||
|
Grid,
|
||||||
|
}
|
@ -1,5 +1,3 @@
|
|||||||
// @dart=2.9
|
|
||||||
|
|
||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
@ -55,7 +53,7 @@ class FeatureTile extends StatelessWidget {
|
|||||||
subtitle += ' - ' + feature.subtitle;
|
subtitle += ' - ' + feature.subtitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
Color color;
|
late Color color;
|
||||||
var theme = Theme.of(context);
|
var theme = Theme.of(context);
|
||||||
|
|
||||||
if (feature.pro) {
|
if (feature.pro) {
|
||||||
@ -82,19 +80,19 @@ class _Tile extends StatelessWidget {
|
|||||||
final Color iconColor;
|
final Color iconColor;
|
||||||
|
|
||||||
_Tile({
|
_Tile({
|
||||||
@required this.title,
|
required this.title,
|
||||||
@required this.subTitle,
|
required this.subTitle,
|
||||||
@required this.iconText,
|
required this.iconText,
|
||||||
@required this.iconColor,
|
required this.iconColor,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
var theme = Theme.of(context);
|
var theme = Theme.of(context);
|
||||||
var textTheme = theme.textTheme;
|
var textTheme = theme.textTheme;
|
||||||
var titleTextStyle = textTheme.subtitle1.copyWith();
|
var titleTextStyle = textTheme.subtitle1!.copyWith();
|
||||||
var subTitleTextStyle = textTheme.bodyText2.copyWith(
|
var subTitleTextStyle = textTheme.bodyText2!.copyWith(
|
||||||
color: textTheme.caption.color,
|
color: textTheme.caption!.color,
|
||||||
);
|
);
|
||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
@ -137,7 +135,7 @@ class _Tile extends StatelessWidget {
|
|||||||
|
|
||||||
class _Sign extends StatelessWidget {
|
class _Sign extends StatelessWidget {
|
||||||
final String text;
|
final String text;
|
||||||
final Color color;
|
final Color? color;
|
||||||
|
|
||||||
_Sign(this.text, this.color);
|
_Sign(this.text, this.color);
|
||||||
|
|
||||||
@ -146,7 +144,7 @@ class _Sign extends StatelessWidget {
|
|||||||
var theme = Theme.of(context);
|
var theme = Theme.of(context);
|
||||||
var textStyle = theme.textTheme.subtitle2;
|
var textStyle = theme.textTheme.subtitle2;
|
||||||
if (color != null) {
|
if (color != null) {
|
||||||
textStyle = textStyle.copyWith(color: color);
|
textStyle = textStyle!.copyWith(color: color);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Text(text, style: textStyle);
|
return Text(text, style: textStyle);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// @dart=2.9
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
@ -17,8 +17,8 @@ class HomeScreen extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _HomeScreenState extends State<HomeScreen> {
|
class _HomeScreenState extends State<HomeScreen> {
|
||||||
NotesFolder notesFolder;
|
NotesFolder? notesFolder;
|
||||||
NotesFolderFS rootFolder;
|
NotesFolderFS? rootFolder;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
// @dart=2.9
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Copyright 2020-2021 Roland Fredenhagen <important@van-fredenhagen.de>
|
Copyright 2020-2021 Roland Fredenhagen <important@van-fredenhagen.de>
|
||||||
|
|
||||||
@ -93,7 +91,7 @@ class SettingsDisplayImagesScreenState
|
|||||||
)
|
)
|
||||||
: Text(
|
: Text(
|
||||||
NumberFormat("##.0").format(settings.maxImageZoom),
|
NumberFormat("##.0").format(settings.maxImageZoom),
|
||||||
style: theme.textTheme.subtitle2
|
style: theme.textTheme.subtitle2!
|
||||||
.copyWith(color: theme.accentColor),
|
.copyWith(color: theme.accentColor),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
))
|
))
|
||||||
|
@ -1,21 +1,19 @@
|
|||||||
// @dart=2.9
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
|
|
||||||
class ListPreference extends StatelessWidget {
|
class ListPreference extends StatelessWidget {
|
||||||
final String title;
|
final String title;
|
||||||
final String currentOption;
|
final String? currentOption;
|
||||||
final List<String> options;
|
final List<String> options;
|
||||||
final Function onChange;
|
final Function onChange;
|
||||||
final bool enabled;
|
final bool enabled;
|
||||||
|
|
||||||
ListPreference({
|
ListPreference({
|
||||||
@required this.title,
|
required this.title,
|
||||||
@required this.currentOption,
|
required this.currentOption,
|
||||||
@required this.options,
|
required this.options,
|
||||||
@required this.onChange,
|
required this.onChange,
|
||||||
this.enabled = true,
|
this.enabled = true,
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -23,14 +21,14 @@ class ListPreference extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ListTile(
|
return ListTile(
|
||||||
title: Text(title),
|
title: Text(title),
|
||||||
subtitle: Text(currentOption),
|
subtitle: Text(currentOption!),
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
var option = await showDialog<String>(
|
var option = await showDialog<String>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
var children = <Widget>[];
|
var children = <Widget>[];
|
||||||
for (var o in options) {
|
for (var o in options) {
|
||||||
var tile = LabeledRadio(
|
var tile = _LabeledRadio(
|
||||||
label: o,
|
label: o,
|
||||||
value: o,
|
value: o,
|
||||||
groupValue: currentOption,
|
groupValue: currentOption,
|
||||||
@ -66,17 +64,17 @@ class ListPreference extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class LabeledRadio extends StatelessWidget {
|
class _LabeledRadio extends StatelessWidget {
|
||||||
const LabeledRadio({
|
const _LabeledRadio({
|
||||||
this.label,
|
required this.label,
|
||||||
this.groupValue,
|
required this.groupValue,
|
||||||
this.value,
|
required this.value,
|
||||||
this.onChanged,
|
required this.onChanged,
|
||||||
});
|
});
|
||||||
|
|
||||||
final String label;
|
final String label;
|
||||||
final String groupValue;
|
final String? groupValue;
|
||||||
final String value;
|
final String? value;
|
||||||
final Function onChanged;
|
final Function onChanged;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -87,10 +85,10 @@ class LabeledRadio extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
child: Row(
|
child: Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Radio<String>(
|
Radio<String?>(
|
||||||
groupValue: groupValue,
|
groupValue: groupValue,
|
||||||
value: value,
|
value: value,
|
||||||
onChanged: onChanged,
|
onChanged: onChanged as void Function(String?)?,
|
||||||
),
|
),
|
||||||
Text(label),
|
Text(label),
|
||||||
],
|
],
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
// @dart=2.9
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:gitjournal/screens/login_screen.dart';
|
import 'package:gitjournal/screens/login_screen.dart';
|
||||||
|
|
||||||
class SignUpScreen extends StatefulWidget {
|
class SignUpScreen extends StatefulWidget {
|
||||||
SignUpScreen({Key key}) : super(key: key);
|
SignUpScreen({Key? key}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_SignUpScreenState createState() => _SignUpScreenState();
|
_SignUpScreenState createState() => _SignUpScreenState();
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// @dart=2.9
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ class TagListingScreen extends StatelessWidget {
|
|||||||
|
|
||||||
Widget _buildTagTile(BuildContext context, String tag) {
|
Widget _buildTagTile(BuildContext context, String tag) {
|
||||||
var theme = Theme.of(context);
|
var theme = Theme.of(context);
|
||||||
var titleColor = theme.textTheme.headline1.color;
|
var titleColor = theme.textTheme.headline1!.color;
|
||||||
|
|
||||||
return ListTile(
|
return ListTile(
|
||||||
leading: FaIcon(FontAwesomeIcons.tag, color: titleColor),
|
leading: FaIcon(FontAwesomeIcons.tag, color: titleColor),
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
// @dart=2.9
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
|
Reference in New Issue
Block a user