✨ Account page
This commit is contained in:
@ -9,7 +9,6 @@ class Account {
|
||||
String banner;
|
||||
String description;
|
||||
String? emailAddress;
|
||||
int powerLevel;
|
||||
int? externalId;
|
||||
|
||||
Account({
|
||||
@ -23,7 +22,6 @@ class Account {
|
||||
required this.banner,
|
||||
required this.description,
|
||||
this.emailAddress,
|
||||
required this.powerLevel,
|
||||
this.externalId,
|
||||
});
|
||||
|
||||
@ -38,7 +36,6 @@ class Account {
|
||||
banner: json['banner'],
|
||||
description: json['description'],
|
||||
emailAddress: json['email_address'],
|
||||
powerLevel: json['power_level'],
|
||||
externalId: json['external_id'],
|
||||
);
|
||||
|
||||
@ -53,7 +50,6 @@ class Account {
|
||||
'banner': banner,
|
||||
'description': description,
|
||||
'email_address': emailAddress,
|
||||
'power_level': powerLevel,
|
||||
'external_id': externalId,
|
||||
};
|
||||
}
|
||||
|
@ -5,14 +5,13 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get_connect/http/src/request/request.dart';
|
||||
import 'package:solian/models/account.dart';
|
||||
import 'package:solian/services.dart';
|
||||
import 'package:oauth2/oauth2.dart' as oauth2;
|
||||
|
||||
class AuthProvider extends GetConnect {
|
||||
final deviceEndpoint = Uri.parse('/api/notifications/subscribe');
|
||||
final tokenEndpoint = Uri.parse('/api/auth/token');
|
||||
final userinfoEndpoint = Uri.parse('/api/users/me');
|
||||
final deviceEndpoint = Uri.parse('${ServiceFinder.services['passport']}/api/notifications/subscribe');
|
||||
final tokenEndpoint = Uri.parse('${ServiceFinder.services['passport']}/api/auth/token');
|
||||
final userinfoEndpoint = Uri.parse('${ServiceFinder.services['passport']}/api/users/me');
|
||||
final redirectUrl = Uri.parse('solian://auth');
|
||||
|
||||
static const clientId = 'solian';
|
||||
@ -57,9 +56,9 @@ class AuthProvider extends GetConnect {
|
||||
|
||||
void applyAuthenticator() {
|
||||
isAuthorized.then((status) async {
|
||||
final content = await storage.read(key: 'auth_credentials');
|
||||
credentials = oauth2.Credentials.fromJson(jsonDecode(content!));
|
||||
if (status) {
|
||||
final content = await storage.read(key: 'auth_credentials');
|
||||
credentials = oauth2.Credentials.fromJson(jsonDecode(content!));
|
||||
httpClient.addAuthenticator(reqAuthenticator);
|
||||
}
|
||||
});
|
||||
@ -96,5 +95,5 @@ class AuthProvider extends GetConnect {
|
||||
|
||||
Future<bool> get isAuthorized => storage.containsKey(key: 'auth_credentials');
|
||||
|
||||
Future<Response<Account>> get profile => get('/api/users/me', decoder: (data) => Account.fromJson(data));
|
||||
Future<Response> getProfile() => get('/api/users/me');
|
||||
}
|
||||
|
@ -1,9 +1,11 @@
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:solian/screens/account.dart';
|
||||
import 'package:solian/screens/auth/signin.dart';
|
||||
import 'package:solian/screens/auth/signup.dart';
|
||||
import 'package:solian/screens/home.dart';
|
||||
import 'package:solian/shells/nav_shell.dart';
|
||||
|
||||
class AppRouter {
|
||||
abstract class AppRouter {
|
||||
static GoRouter instance = GoRouter(
|
||||
routes: [
|
||||
ShellRoute(
|
||||
@ -19,6 +21,16 @@ class AppRouter {
|
||||
name: "account",
|
||||
builder: (context, state) => const AccountScreen(),
|
||||
),
|
||||
GoRoute(
|
||||
path: "/auth/sign-in",
|
||||
name: "signin",
|
||||
builder: (context, state) => const SignInScreen(),
|
||||
),
|
||||
GoRoute(
|
||||
path: "/auth/sign-up",
|
||||
name: "signup",
|
||||
builder: (context, state) => const SignUpScreen(),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
|
@ -1,12 +1,166 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:solian/providers/auth.dart';
|
||||
import 'package:solian/router.dart';
|
||||
import 'package:solian/widgets/account/account_avatar.dart';
|
||||
|
||||
class AccountScreen extends StatelessWidget {
|
||||
class AccountScreen extends StatefulWidget {
|
||||
const AccountScreen({super.key});
|
||||
|
||||
@override
|
||||
State<AccountScreen> createState() => _AccountScreenState();
|
||||
}
|
||||
|
||||
class _AccountScreenState extends State<AccountScreen> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Center(
|
||||
child: Text("Woah account"),
|
||||
final actionItems = [
|
||||
// (const Icon(Icons.color_lens), 'personalize'.tr, 'account.personalize'),
|
||||
// (const Icon(Icons.diversity_1), 'friend'.tr, 'account.friend'),
|
||||
];
|
||||
|
||||
final AuthProvider provider = Get.find();
|
||||
|
||||
return Material(
|
||||
color: Theme.of(context).colorScheme.background,
|
||||
child: FutureBuilder(
|
||||
future: provider.isAuthorized,
|
||||
builder: (context, snapshot) {
|
||||
if (!snapshot.hasData || snapshot.data == false) {
|
||||
return Center(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
ActionCard(
|
||||
icon: const Icon(Icons.login, color: Colors.white),
|
||||
title: 'signin'.tr,
|
||||
caption: 'signinCaption'.tr,
|
||||
onTap: () {
|
||||
AppRouter.instance.pushNamed('signin').then((_) {
|
||||
setState(() {});
|
||||
});
|
||||
},
|
||||
),
|
||||
ActionCard(
|
||||
icon: const Icon(Icons.add, color: Colors.white),
|
||||
title: 'signup'.tr,
|
||||
caption: 'signupCaption'.tr,
|
||||
onTap: () {
|
||||
AppRouter.instance.pushNamed('signup');
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
const AccountNameCard().paddingOnly(bottom: 8),
|
||||
...(actionItems.map(
|
||||
(x) => ListTile(
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 34),
|
||||
leading: x.$1,
|
||||
title: Text(x.$2),
|
||||
onTap: () {
|
||||
AppRouter.instance.pushNamed(x.$3);
|
||||
},
|
||||
),
|
||||
)),
|
||||
ListTile(
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 34),
|
||||
leading: const Icon(Icons.logout),
|
||||
title: Text('signout'.tr),
|
||||
onTap: () {
|
||||
provider.signout();
|
||||
setState(() {});
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class AccountNameCard extends StatelessWidget {
|
||||
const AccountNameCard({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final AuthProvider provider = Get.find();
|
||||
|
||||
return FutureBuilder(
|
||||
future: provider.getProfile(),
|
||||
builder: (context, snapshot) {
|
||||
if (!snapshot.hasData) {
|
||||
return const Center(
|
||||
child: CircularProgressIndicator(),
|
||||
);
|
||||
}
|
||||
|
||||
return Material(
|
||||
elevation: 2,
|
||||
child: ListTile(
|
||||
contentPadding: const EdgeInsets.only(left: 22, right: 34, top: 4, bottom: 4),
|
||||
leading: AccountAvatar(content: snapshot.data!.body?['avatar'], radius: 24),
|
||||
title: Text(snapshot.data!.body?['nick']),
|
||||
subtitle: Text(snapshot.data!.body?['name']),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class ActionCard extends StatelessWidget {
|
||||
final Widget icon;
|
||||
final String title;
|
||||
final String caption;
|
||||
final Function onTap;
|
||||
|
||||
const ActionCard({
|
||||
super.key,
|
||||
required this.onTap,
|
||||
required this.title,
|
||||
required this.caption,
|
||||
required this.icon,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Card(
|
||||
child: InkWell(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
onTap: () => onTap(),
|
||||
child: Container(
|
||||
width: 320,
|
||||
padding: const EdgeInsets.all(20),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
CircleAvatar(
|
||||
backgroundColor: Colors.indigo,
|
||||
child: icon,
|
||||
).paddingOnly(bottom: 12),
|
||||
Text(
|
||||
title,
|
||||
style: const TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w900,
|
||||
overflow: TextOverflow.clip,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
caption,
|
||||
style: const TextStyle(overflow: TextOverflow.clip),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
120
lib/screens/auth/signin.dart
Normal file
120
lib/screens/auth/signin.dart
Normal file
@ -0,0 +1,120 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:solian/providers/auth.dart';
|
||||
import 'package:solian/router.dart';
|
||||
import 'package:solian/services.dart';
|
||||
import 'package:url_launcher/url_launcher_string.dart';
|
||||
|
||||
class SignInScreen extends StatefulWidget {
|
||||
const SignInScreen({super.key});
|
||||
|
||||
@override
|
||||
State<SignInScreen> createState() => _SignInScreenState();
|
||||
}
|
||||
|
||||
class _SignInScreenState extends State<SignInScreen> {
|
||||
final _usernameController = TextEditingController();
|
||||
final _passwordController = TextEditingController();
|
||||
|
||||
void performAction(BuildContext context) {
|
||||
final AuthProvider provider = Get.find();
|
||||
|
||||
final username = _usernameController.value.text;
|
||||
final password = _passwordController.value.text;
|
||||
if (username.isEmpty || password.isEmpty) return;
|
||||
provider.signin(context, username, password).then((_) {
|
||||
AppRouter.instance.pop(true);
|
||||
}).catchError((e) {
|
||||
List<String> messages = e.toString().split('\n');
|
||||
if (messages.last.contains('risk')) {
|
||||
final ticketId = RegExp(r'ticketId=(\d+)').firstMatch(messages.last);
|
||||
if (ticketId == null) {
|
||||
Get.showSnackbar(GetSnackBar(
|
||||
title: 'errorHappened'.tr,
|
||||
message: 'requested to multi-factor authenticate, but the ticket id was not found',
|
||||
));
|
||||
}
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return AlertDialog(
|
||||
title: Text('riskDetection'.tr),
|
||||
content: Text('signinRiskDetected'.tr),
|
||||
actions: [
|
||||
TextButton(
|
||||
child: Text('next'.tr),
|
||||
onPressed: () {
|
||||
launchUrlString(
|
||||
'${ServiceFinder.services['passport']}/mfa?ticket=${ticketId!.group(1)}',
|
||||
);
|
||||
if (Navigator.canPop(context)) {
|
||||
Navigator.pop(context);
|
||||
}
|
||||
},
|
||||
)
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
} else {
|
||||
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
|
||||
content: Text(messages.last),
|
||||
));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Material(
|
||||
color: Theme.of(context).colorScheme.background,
|
||||
child: Center(
|
||||
child: Container(
|
||||
width: MediaQuery.of(context).size.width * 0.6,
|
||||
constraints: const BoxConstraints(maxWidth: 360),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
child: Image.asset('assets/logo.png', width: 72, height: 72),
|
||||
),
|
||||
TextField(
|
||||
autocorrect: false,
|
||||
enableSuggestions: false,
|
||||
controller: _usernameController,
|
||||
autofillHints: const [AutofillHints.username],
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
border: const OutlineInputBorder(),
|
||||
labelText: 'username'.tr,
|
||||
),
|
||||
onTapOutside: (_) => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
TextField(
|
||||
obscureText: true,
|
||||
autocorrect: false,
|
||||
enableSuggestions: false,
|
||||
autofillHints: const [AutofillHints.password],
|
||||
controller: _passwordController,
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
border: const OutlineInputBorder(),
|
||||
labelText: 'password'.tr,
|
||||
),
|
||||
onTapOutside: (_) => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
onSubmitted: (_) => performAction(context),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
ElevatedButton(
|
||||
child: Text('signin'.tr),
|
||||
onPressed: () => performAction(context),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
147
lib/screens/auth/signup.dart
Normal file
147
lib/screens/auth/signup.dart
Normal file
@ -0,0 +1,147 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:solian/router.dart';
|
||||
import 'package:solian/services.dart';
|
||||
|
||||
class SignUpScreen extends StatefulWidget {
|
||||
const SignUpScreen({super.key});
|
||||
|
||||
@override
|
||||
State<SignUpScreen> createState() => _SignUpScreenState();
|
||||
}
|
||||
|
||||
class _SignUpScreenState extends State<SignUpScreen> {
|
||||
final _emailController = TextEditingController();
|
||||
final _usernameController = TextEditingController();
|
||||
final _nicknameController = TextEditingController();
|
||||
final _passwordController = TextEditingController();
|
||||
|
||||
void performAction(BuildContext context) async {
|
||||
final email = _emailController.value.text;
|
||||
final username = _usernameController.value.text;
|
||||
final nickname = _passwordController.value.text;
|
||||
final password = _passwordController.value.text;
|
||||
if (email.isEmpty ||
|
||||
username.isEmpty ||
|
||||
nickname.isEmpty ||
|
||||
password.isEmpty) return;
|
||||
|
||||
final client = GetConnect();
|
||||
client.httpClient.baseUrl = ServiceFinder.services['passport'];
|
||||
final res = await client.post('/api/users', {
|
||||
'name': username,
|
||||
'nick': nickname,
|
||||
'email': email,
|
||||
'password': password,
|
||||
});
|
||||
|
||||
if (res.statusCode == 200) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return AlertDialog(
|
||||
title: Text('signupDone'.tr),
|
||||
content: Text('signupDoneCaption'.tr),
|
||||
actions: [
|
||||
TextButton(
|
||||
child: Text('confirmOkay'.tr),
|
||||
onPressed: () => Navigator.pop(context),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
).then((_) {
|
||||
AppRouter.instance.replaceNamed('auth.sign-in');
|
||||
});
|
||||
} else {
|
||||
Get.showSnackbar(GetSnackBar(
|
||||
title: 'errorHappened'.tr,
|
||||
message: res.bodyString,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Material(
|
||||
color: Theme.of(context).colorScheme.background,
|
||||
child: Center(
|
||||
child: Container(
|
||||
width: MediaQuery.of(context).size.width * 0.6,
|
||||
constraints: const BoxConstraints(maxWidth: 360),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
child: Image.asset('assets/logo.png', width: 72, height: 72),
|
||||
),
|
||||
TextField(
|
||||
autocorrect: false,
|
||||
enableSuggestions: false,
|
||||
controller: _usernameController,
|
||||
autofillHints: const [AutofillHints.username],
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
border: const OutlineInputBorder(),
|
||||
labelText: 'username'.tr,
|
||||
),
|
||||
onTapOutside: (_) =>
|
||||
FocusManager.instance.primaryFocus?.unfocus(),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
TextField(
|
||||
autocorrect: false,
|
||||
enableSuggestions: false,
|
||||
controller: _nicknameController,
|
||||
autofillHints: const [AutofillHints.nickname],
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
border: const OutlineInputBorder(),
|
||||
labelText: 'nickname'.tr,
|
||||
),
|
||||
onTapOutside: (_) =>
|
||||
FocusManager.instance.primaryFocus?.unfocus(),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
TextField(
|
||||
autocorrect: false,
|
||||
enableSuggestions: false,
|
||||
controller: _emailController,
|
||||
autofillHints: const [AutofillHints.email],
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
border: const OutlineInputBorder(),
|
||||
labelText: 'email'.tr,
|
||||
),
|
||||
onTapOutside: (_) =>
|
||||
FocusManager.instance.primaryFocus?.unfocus(),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
TextField(
|
||||
obscureText: true,
|
||||
autocorrect: false,
|
||||
enableSuggestions: false,
|
||||
autofillHints: const [AutofillHints.password],
|
||||
controller: _passwordController,
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
border: const OutlineInputBorder(),
|
||||
labelText: 'password'.tr,
|
||||
),
|
||||
onTapOutside: (_) =>
|
||||
FocusManager.instance.primaryFocus?.unfocus(),
|
||||
onSubmitted: (_) => performAction(context),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
ElevatedButton(
|
||||
child: Text('signup'.tr),
|
||||
onPressed: () => performAction(context),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -52,23 +52,26 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
);
|
||||
}
|
||||
|
||||
return RefreshIndicator(
|
||||
onRefresh: () {
|
||||
_data.clear();
|
||||
_pageKey = 0;
|
||||
_dataTotal = null;
|
||||
return getPosts();
|
||||
},
|
||||
child: ListView.separated(
|
||||
itemCount: _data.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
final item = _data[index];
|
||||
return GestureDetector(
|
||||
child: PostItem(key: Key('p${item.alias}'), item: item),
|
||||
onTap: () {},
|
||||
);
|
||||
return Material(
|
||||
color: Theme.of(context).colorScheme.background,
|
||||
child: RefreshIndicator(
|
||||
onRefresh: () {
|
||||
_data.clear();
|
||||
_pageKey = 0;
|
||||
_dataTotal = null;
|
||||
return getPosts();
|
||||
},
|
||||
separatorBuilder: (_, __) => const Divider(thickness: 0.3, height: 0.3),
|
||||
child: ListView.separated(
|
||||
itemCount: _data.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
final item = _data[index];
|
||||
return GestureDetector(
|
||||
child: PostItem(key: Key('p${item.alias}'), item: item),
|
||||
onTap: () {},
|
||||
);
|
||||
},
|
||||
separatorBuilder: (_, __) => const Divider(thickness: 0.3, height: 0.3),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:solian/router.dart';
|
||||
import 'package:solian/theme.dart';
|
||||
import 'package:solian/widgets/navigation/app_navigation_bottom_bar.dart';
|
||||
import 'package:solian/widgets/navigation/app_navigation_rail.dart';
|
||||
@ -13,12 +14,25 @@ class NavShell extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final backButton = IconButton(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
tooltip: MaterialLocalizations.of(context).backButtonTooltip,
|
||||
onPressed: () {
|
||||
if (AppRouter.instance.canPop()) {
|
||||
AppRouter.instance.pop();
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
final canPop = AppRouter.instance.canPop();
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(state.topRoute?.name?.tr ?? 'page'.tr),
|
||||
centerTitle: false,
|
||||
titleSpacing: canPop ? null : 24,
|
||||
elevation: SolianTheme.isLargeScreen(context) ? 1 : 0,
|
||||
titleSpacing: 24,
|
||||
leading: canPop ? backButton : null,
|
||||
),
|
||||
bottomNavigationBar: SolianTheme.isLargeScreen(context) ? null : const AppNavigationBottomBar(),
|
||||
body: SolianTheme.isLargeScreen(context)
|
||||
|
@ -4,16 +4,46 @@ class SolianMessages extends Translations {
|
||||
@override
|
||||
Map<String, Map<String, String>> get keys => {
|
||||
'en_US': {
|
||||
'next': 'Next',
|
||||
'page': 'Page',
|
||||
'home': 'Home',
|
||||
'errorHappened': 'An error occurred',
|
||||
'email': 'Email',
|
||||
'username': 'Username',
|
||||
'nickname': 'Nickname',
|
||||
'password': 'Password',
|
||||
'account': 'Account',
|
||||
'personalize': 'Personalize',
|
||||
'friend': 'Friend',
|
||||
'signin': 'Sign in',
|
||||
'signinCaption': 'Sign in to create post, start a realm, message your friend and more!',
|
||||
'signinRiskDetected': 'Risk detected, click Next to open a webpage and signin through it to pass security check.',
|
||||
'signup': 'Sign up',
|
||||
'signupCaption': 'Create an account on Solarpass and then get the access of entire Solar Network!',
|
||||
'signout': 'Sign out',
|
||||
'riskDetection': 'Risk Detected',
|
||||
'matureContent': 'Mature Content',
|
||||
'matureContentCaption': 'The content is rated and may not suitable for everyone to view'
|
||||
},
|
||||
'zh_CN': {
|
||||
'next': '下一步',
|
||||
'page': '页面',
|
||||
'home': '首页',
|
||||
'errorHappened': '发生错误了',
|
||||
'email': '邮件地址',
|
||||
'username': '用户名',
|
||||
'nickname': '显示名',
|
||||
'password': '密码',
|
||||
'account': '账号',
|
||||
'personalize': '个性化',
|
||||
'friend': '好友',
|
||||
'signin': '登录',
|
||||
'signinCaption': '登录以发表帖子、文章、创建领域、和你的朋友聊天,以及获取更多功能!',
|
||||
'signinRiskDetected': '检测到风险,点击下一步按钮来打开一个网页,并通过在其上面登录来通过安全检查。',
|
||||
'signup': '注册',
|
||||
'signupCaption': '在 Solarpass 注册一个账号以获得整个 Solar Network 的存取权!',
|
||||
'signout': '登出',
|
||||
'riskDetection': '检测到风险',
|
||||
'matureContent': '成人内容',
|
||||
'matureContentCaption': '该内容可能会对您的社会关系产生影响,请确认四下环境后再查看'
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ class _PostItemState extends State<PostItem> {
|
||||
Text(
|
||||
widget.item.author.nick,
|
||||
style: const TextStyle(fontWeight: FontWeight.bold),
|
||||
).paddingOnly(left: 8),
|
||||
).paddingOnly(left: 12),
|
||||
Text(format(widget.item.createdAt, locale: 'en_short')).paddingOnly(left: 4),
|
||||
],
|
||||
),
|
||||
@ -42,7 +42,7 @@ class _PostItemState extends State<PostItem> {
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
data: widget.item.content,
|
||||
padding: const EdgeInsets.all(0),
|
||||
).paddingSymmetric(horizontal: 8),
|
||||
).paddingOnly(left: 12, right: 8),
|
||||
],
|
||||
),
|
||||
)
|
||||
|
Reference in New Issue
Block a user