💄 More transparency

This commit is contained in:
LittleSheep 2024-10-06 23:06:33 +08:00
parent 2e9c4d166e
commit d7e6fe2d8f
9 changed files with 1019 additions and 1041 deletions

View File

@ -4,7 +4,6 @@ import 'package:get/get.dart';
import 'package:intl/intl.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:solian/widgets/root_container.dart';
import 'package:solian/widgets/sized_container.dart';
import 'package:url_launcher/url_launcher_string.dart';
@ -16,8 +15,7 @@ class AboutScreen extends StatelessWidget {
const denseButtonStyle =
ButtonStyle(visualDensity: VisualDensity(vertical: -4));
return RootContainer(
child: SizedBox(
return SizedBox(
width: double.infinity,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
@ -142,7 +140,6 @@ class AboutScreen extends StatelessWidget {
),
],
),
),
);
}
}

View File

@ -7,7 +7,6 @@ import 'package:solian/providers/account_status.dart';
import 'package:solian/providers/relation.dart';
import 'package:solian/router.dart';
import 'package:solian/widgets/account/account_heading.dart';
import 'package:solian/widgets/root_container.dart';
import 'package:solian/widgets/sized_container.dart';
import 'package:badges/badges.dart' as badges;
@ -50,8 +49,7 @@ class _AccountScreenState extends State<AccountScreen> {
final AuthProvider auth = Get.find();
return RootContainer(
child: SafeArea(
return SafeArea(
child: Obx(() {
if (auth.isAuthorized.isFalse) {
return Center(
@ -155,7 +153,6 @@ class _AccountScreenState extends State<AccountScreen> {
),
);
}),
),
);
}
}

View File

@ -6,7 +6,6 @@ import 'package:google_fonts/google_fonts.dart';
import 'package:solian/exceptions/request.dart';
import 'package:solian/exts.dart';
import 'package:solian/providers/auth.dart';
import 'package:solian/widgets/root_container.dart';
class NotificationPreferencesScreen extends StatefulWidget {
const NotificationPreferencesScreen({super.key});
@ -75,8 +74,7 @@ class _NotificationPreferencesScreenState
@override
Widget build(BuildContext context) {
return RootContainer(
child: Column(
return Column(
children: [
if (_isBusy) const LinearProgressIndicator().animate().scaleX(),
ListTile(
@ -112,7 +110,6 @@ class _NotificationPreferencesScreenState
),
),
],
),
);
}
}

View File

@ -187,8 +187,7 @@ class _PersonalizeScreenState extends State<PersonalizeScreen> {
Widget build(BuildContext context) {
const double padding = 32;
return RootContainer(
child: ListView(
return ListView(
children: [
if (_isBusy) const LinearProgressIndicator().animate().scaleX(),
const Gap(24),
@ -343,7 +342,6 @@ class _PersonalizeScreenState extends State<PersonalizeScreen> {
],
).paddingSymmetric(horizontal: padding),
],
),
);
}

View File

@ -217,8 +217,7 @@ class _SignInScreenState extends State<SignInScreen> {
@override
Widget build(BuildContext context) {
return RootContainer(
child: CenteredContainer(
return CenteredContainer(
maxWidth: 360,
child: Theme(
data: Theme.of(context).copyWith(canvasColor: Colors.transparent),
@ -243,10 +242,9 @@ class _SignInScreenState extends State<SignInScreen> {
Align(
alignment: Alignment.centerLeft,
child: ClipRRect(
borderRadius:
const BorderRadius.all(Radius.circular(8)),
child: Image.asset('assets/logo.png',
width: 64, height: 64),
borderRadius: const BorderRadius.all(Radius.circular(8)),
child:
Image.asset('assets/logo.png', width: 64, height: 64),
).paddingOnly(bottom: 8, left: 4),
),
Text(
@ -272,8 +270,7 @@ class _SignInScreenState extends State<SignInScreen> {
Icons.question_mark,
),
title: Text(
_factorLabelMap[x.type]?.$1 ??
'unknown'.tr,
_factorLabelMap[x.type]?.$1 ?? 'unknown'.tr,
),
enabled: !_currentTicket!.factorTrail
.contains(x.id),
@ -303,8 +300,8 @@ class _SignInScreenState extends State<SignInScreen> {
onPressed: (_isBusy || _period > 1)
? null
: () => _previousStep(),
style: TextButton.styleFrom(
foregroundColor: Colors.grey),
style:
TextButton.styleFrom(foregroundColor: Colors.grey),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
@ -335,10 +332,9 @@ class _SignInScreenState extends State<SignInScreen> {
Align(
alignment: Alignment.centerLeft,
child: ClipRRect(
borderRadius:
const BorderRadius.all(Radius.circular(8)),
child: Image.asset('assets/logo.png',
width: 64, height: 64),
borderRadius: const BorderRadius.all(Radius.circular(8)),
child:
Image.asset('assets/logo.png', width: 64, height: 64),
).paddingOnly(bottom: 8, left: 4),
),
Text(
@ -372,8 +368,7 @@ class _SignInScreenState extends State<SignInScreen> {
),
onTapOutside: (_) =>
FocusManager.instance.primaryFocus?.unfocus(),
onSubmitted:
_isBusy ? null : (_) => _performCheckTicket(),
onSubmitted: _isBusy ? null : (_) => _performCheckTicket(),
),
const Gap(12),
Row(
@ -381,8 +376,8 @@ class _SignInScreenState extends State<SignInScreen> {
children: [
TextButton(
onPressed: _isBusy ? null : () => _previousStep(),
style: TextButton.styleFrom(
foregroundColor: Colors.grey),
style:
TextButton.styleFrom(foregroundColor: Colors.grey),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
@ -392,8 +387,7 @@ class _SignInScreenState extends State<SignInScreen> {
),
),
TextButton(
onPressed:
_isBusy ? null : () => _performCheckTicket(),
onPressed: _isBusy ? null : () => _performCheckTicket(),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
@ -413,10 +407,9 @@ class _SignInScreenState extends State<SignInScreen> {
Align(
alignment: Alignment.centerLeft,
child: ClipRRect(
borderRadius:
const BorderRadius.all(Radius.circular(8)),
child: Image.asset('assets/logo.png',
width: 64, height: 64),
borderRadius: const BorderRadius.all(Radius.circular(8)),
child:
Image.asset('assets/logo.png', width: 64, height: 64),
).paddingOnly(bottom: 8, left: 4),
),
Text(
@ -448,8 +441,8 @@ class _SignInScreenState extends State<SignInScreen> {
TextButton(
onPressed:
_isBusy ? null : () => _requestResetPassword(),
style: TextButton.styleFrom(
foregroundColor: Colors.grey),
style:
TextButton.styleFrom(foregroundColor: Colors.grey),
child: Text('forgotPassword'.tr),
),
TextButton(
@ -475,10 +468,8 @@ class _SignInScreenState extends State<SignInScreen> {
Text(
'termAcceptNextWithAgree'.tr,
textAlign: TextAlign.end,
style: Theme.of(context)
.textTheme
.bodySmall!
.copyWith(
style:
Theme.of(context).textTheme.bodySmall!.copyWith(
color: Theme.of(context)
.colorScheme
.onSurface
@ -509,7 +500,6 @@ class _SignInScreenState extends State<SignInScreen> {
),
},
),
),
).paddingAll(24),
);
}

View File

@ -3,7 +3,6 @@ import 'package:gap/gap.dart';
import 'package:get/get.dart';
import 'package:solian/exts.dart';
import 'package:solian/services.dart';
import 'package:solian/widgets/root_container.dart';
import 'package:solian/widgets/sized_container.dart';
import 'package:url_launcher/url_launcher_string.dart';
@ -66,8 +65,7 @@ class _SignUpScreenState extends State<SignUpScreen> {
@override
Widget build(BuildContext context) {
return RootContainer(
child: CenteredContainer(
return CenteredContainer(
maxWidth: 360,
child: ListView(
shrinkWrap: true,
@ -96,8 +94,7 @@ class _SignUpScreenState extends State<SignUpScreen> {
border: const OutlineInputBorder(),
labelText: 'username'.tr,
),
onTapOutside: (_) =>
FocusManager.instance.primaryFocus?.unfocus(),
onTapOutside: (_) => FocusManager.instance.primaryFocus?.unfocus(),
),
const Gap(12),
TextField(
@ -110,8 +107,7 @@ class _SignUpScreenState extends State<SignUpScreen> {
border: const OutlineInputBorder(),
labelText: 'nickname'.tr,
),
onTapOutside: (_) =>
FocusManager.instance.primaryFocus?.unfocus(),
onTapOutside: (_) => FocusManager.instance.primaryFocus?.unfocus(),
),
const Gap(12),
TextField(
@ -124,8 +120,7 @@ class _SignUpScreenState extends State<SignUpScreen> {
border: const OutlineInputBorder(),
labelText: 'email'.tr,
),
onTapOutside: (_) =>
FocusManager.instance.primaryFocus?.unfocus(),
onTapOutside: (_) => FocusManager.instance.primaryFocus?.unfocus(),
),
const Gap(12),
TextField(
@ -139,8 +134,7 @@ class _SignUpScreenState extends State<SignUpScreen> {
border: const OutlineInputBorder(),
labelText: 'password'.tr,
),
onTapOutside: (_) =>
FocusManager.instance.primaryFocus?.unfocus(),
onTapOutside: (_) => FocusManager.instance.primaryFocus?.unfocus(),
onSubmitted: (_) => _performAction(context),
),
const Gap(8),
@ -206,7 +200,6 @@ class _SignUpScreenState extends State<SignUpScreen> {
),
)
],
),
).paddingAll(24),
);
}

View File

@ -19,7 +19,6 @@ import 'package:solian/providers/database/database.dart';
import 'package:solian/providers/theme_switcher.dart';
import 'package:solian/router.dart';
import 'package:solian/widgets/reports/abuse_report.dart';
import 'package:solian/widgets/root_container.dart';
class SettingScreen extends StatefulWidget {
const SettingScreen({super.key});
@ -83,8 +82,7 @@ class _SettingScreenState extends State<SettingScreen> {
@override
Widget build(BuildContext context) {
return RootContainer(
child: ListView(
return ListView(
children: [
_buildCaptionHeader('theme'.tr),
ListTile(
@ -110,12 +108,16 @@ class _SettingScreenState extends State<SettingScreen> {
children: [
Icon(Icons.circle, color: item.seedColor),
const Gap(8),
Text(
Expanded(
child: Text(
item.id.tr,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: const TextStyle(
fontSize: 14,
),
),
),
],
),
))
@ -196,8 +198,7 @@ class _SettingScreenState extends State<SettingScreen> {
)
],
),
value:
_prefs?.getBool('service_background_notification') ?? false,
value: _prefs?.getBool('service_background_notification') ?? false,
onChanged: (value) {
_prefs
?.setBool('service_background_notification', value ?? false)
@ -215,9 +216,7 @@ class _SettingScreenState extends State<SettingScreen> {
subtitle: Text('updateCheckStrictlyDesc'.tr),
value: _prefs?.getBool('check_update_strictly') ?? false,
onChanged: (value) {
_prefs
?.setBool('check_update_strictly', value ?? false)
.then((_) {
_prefs?.setBool('check_update_strictly', value ?? false).then((_) {
setState(() {});
});
},
@ -335,7 +334,6 @@ class _SettingScreenState extends State<SettingScreen> {
},
),
],
),
);
}
}

View File

@ -39,10 +39,13 @@ abstract class AppTheme {
brightness: brightness,
seedColor: seedColor ?? const Color.fromRGBO(154, 98, 91, 1),
),
scaffoldBackgroundColor: Colors.transparent,
snackBarTheme: const SnackBarThemeData(
behavior: SnackBarBehavior.floating,
),
scaffoldBackgroundColor: Colors.transparent,
appBarTheme: const AppBarTheme(
backgroundColor: Colors.transparent,
),
fontFamily: 'Comfortaa',
fontFamilyFallback: [
'NotoSansSC',
@ -74,6 +77,7 @@ abstract class AppTheme {
behavior: SnackBarBehavior.floating,
),
scaffoldBackgroundColor: Colors.transparent,
appBarTheme: const AppBarTheme(backgroundColor: Colors.transparent),
fontFamily: data.fontFamily ?? 'Comfortaa',
fontFamilyFallback: data.fontFamilyFallback ??
[

View File

@ -43,6 +43,10 @@ class MarkdownTextContent extends StatelessWidget {
if (isAutoWarp) {
paragraph = paragraph.replaceAll('\n', '\\\n');
}
const charactersToTrim = '\\\n\t\r ';
final trimPattern =
RegExp('^[$charactersToTrim]+|[$charactersToTrim]+\$');
paragraph = paragraph.trim().replaceAll(trimPattern, '');
// Matching stickers
final stickerMatch = stickerRegex.allMatches(paragraph);
@ -184,7 +188,7 @@ class MarkdownTextContent extends StatelessWidget {
);
if (idx < paragraphs.length - 1) {
contentWidgets.add(const Gap(4));
contentWidgets.add(isAutoWarp ? const Gap(4) : const Gap(8));
}
}