💄 Optimize design
This commit is contained in:
@ -3,7 +3,7 @@ import 'package:solian/screens/account.dart';
|
||||
import 'package:solian/screens/account/personalize.dart';
|
||||
import 'package:solian/screens/auth/signin.dart';
|
||||
import 'package:solian/screens/auth/signup.dart';
|
||||
import 'package:solian/screens/home.dart';
|
||||
import 'package:solian/screens/social.dart';
|
||||
import 'package:solian/screens/posts/publish.dart';
|
||||
import 'package:solian/shells/basic_shell.dart';
|
||||
import 'package:solian/shells/nav_shell.dart';
|
||||
@ -17,8 +17,8 @@ abstract class AppRouter {
|
||||
routes: [
|
||||
GoRoute(
|
||||
path: '/',
|
||||
name: 'home',
|
||||
builder: (context, state) => const HomeScreen(),
|
||||
name: 'social',
|
||||
builder: (context, state) => const SocialScreen(),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/account',
|
||||
|
@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_animate/flutter_animate.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:solian/exts.dart';
|
||||
import 'package:solian/models/post.dart';
|
||||
@ -150,7 +151,10 @@ class _PostPublishingScreenState extends State<PostPublishingScreen> {
|
||||
child: Column(
|
||||
children: [
|
||||
MaterialBanner(
|
||||
leading: const Icon(Icons.reply),
|
||||
leading: const FaIcon(
|
||||
FontAwesomeIcons.reply,
|
||||
size: 18,
|
||||
),
|
||||
leadingPadding:
|
||||
const EdgeInsets.only(left: 10, right: 20),
|
||||
backgroundColor: Colors.transparent,
|
||||
@ -181,7 +185,10 @@ class _PostPublishingScreenState extends State<PostPublishingScreen> {
|
||||
child: Column(
|
||||
children: [
|
||||
MaterialBanner(
|
||||
leading: const Icon(Icons.redo),
|
||||
leading: const FaIcon(
|
||||
FontAwesomeIcons.retweet,
|
||||
size: 18,
|
||||
),
|
||||
leadingPadding:
|
||||
const EdgeInsets.only(left: 10, right: 20),
|
||||
dividerColor: Colors.transparent,
|
||||
|
@ -9,14 +9,14 @@ import 'package:solian/router.dart';
|
||||
import 'package:solian/widgets/posts/post_action.dart';
|
||||
import 'package:solian/widgets/posts/post_item.dart';
|
||||
|
||||
class HomeScreen extends StatefulWidget {
|
||||
const HomeScreen({super.key});
|
||||
class SocialScreen extends StatefulWidget {
|
||||
const SocialScreen({super.key});
|
||||
|
||||
@override
|
||||
State<HomeScreen> createState() => _HomeScreenState();
|
||||
State<SocialScreen> createState() => _SocialScreenState();
|
||||
}
|
||||
|
||||
class _HomeScreenState extends State<HomeScreen> {
|
||||
class _SocialScreenState extends State<SocialScreen> {
|
||||
final PagingController<int, Post> _pagingController =
|
||||
PagingController(firstPageKey: 0);
|
||||
|
@ -9,7 +9,7 @@ class SolianMessages extends Translations {
|
||||
'next': 'Next',
|
||||
'reset': 'Reset',
|
||||
'page': 'Page',
|
||||
'home': 'Home',
|
||||
'social': 'Social',
|
||||
'apply': 'Apply',
|
||||
'cancel': 'Cancel',
|
||||
'confirm': 'Confirm',
|
||||
@ -84,7 +84,7 @@ class SolianMessages extends Translations {
|
||||
'edit': '编辑',
|
||||
'delete': '删除',
|
||||
'page': '页面',
|
||||
'home': '首页',
|
||||
'social': '社交',
|
||||
'apply': '应用',
|
||||
'reply': '回复',
|
||||
'repost': '转帖',
|
||||
|
@ -4,9 +4,9 @@ import 'package:get/utils.dart';
|
||||
abstract class AppNavigation {
|
||||
static List<AppNavigationDestination> destinations = [
|
||||
AppNavigationDestination(
|
||||
icon: const Icon(Icons.home),
|
||||
label: 'home'.tr,
|
||||
page: 'home',
|
||||
icon: const Icon(Icons.public),
|
||||
label: 'social'.tr,
|
||||
page: 'social',
|
||||
),
|
||||
AppNavigationDestination(
|
||||
icon: const Icon(Icons.account_circle),
|
||||
@ -21,5 +21,6 @@ class AppNavigationDestination {
|
||||
final String label;
|
||||
final String page;
|
||||
|
||||
AppNavigationDestination({required this.icon, required this.label, required this.page});
|
||||
AppNavigationDestination(
|
||||
{required this.icon, required this.label, required this.page});
|
||||
}
|
||||
|
@ -15,13 +15,15 @@ class _AppNavigationRailState extends State<AppNavigationRail> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return NavigationRail(
|
||||
destinations: AppNavigation.destinations.map(
|
||||
(e) => NavigationRailDestination(
|
||||
icon: e.icon,
|
||||
label: Text(e.label),
|
||||
),
|
||||
).toList(),
|
||||
labelType: NavigationRailLabelType.selected,
|
||||
destinations: AppNavigation.destinations
|
||||
.map(
|
||||
(e) => NavigationRailDestination(
|
||||
icon: e.icon,
|
||||
label: Text(e.label),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
labelType: NavigationRailLabelType.all,
|
||||
selectedIndex: _selectedIndex,
|
||||
onDestinationSelected: (idx) {
|
||||
setState(() => _selectedIndex = idx);
|
||||
|
@ -2,6 +2,7 @@ import 'dart:math';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_animate/flutter_animate.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:solian/exts.dart';
|
||||
import 'package:solian/models/post.dart';
|
||||
@ -68,7 +69,7 @@ class _PostActionState extends State<PostAction> {
|
||||
children: [
|
||||
ListTile(
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 24),
|
||||
leading: const Icon(Icons.reply),
|
||||
leading: const FaIcon(FontAwesomeIcons.reply, size: 20),
|
||||
title: Text('reply'.tr),
|
||||
onTap: () async {
|
||||
final value = await AppRouter.instance.pushNamed(
|
||||
@ -82,7 +83,7 @@ class _PostActionState extends State<PostAction> {
|
||||
),
|
||||
ListTile(
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 24),
|
||||
leading: const Icon(Icons.redo),
|
||||
leading: const FaIcon(FontAwesomeIcons.retweet, size: 20),
|
||||
title: Text('repost'.tr),
|
||||
onTap: () async {
|
||||
final value = await AppRouter.instance.pushNamed(
|
||||
|
@ -1,6 +1,7 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_markdown/flutter_markdown.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:get/get_utils/get_utils.dart';
|
||||
import 'package:solian/models/post.dart';
|
||||
import 'package:solian/widgets/account/account_avatar.dart';
|
||||
@ -38,9 +39,9 @@ class _PostItemState extends State<PostItem> {
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.reply,
|
||||
size: 18,
|
||||
FaIcon(
|
||||
FontAwesomeIcons.reply,
|
||||
size: 16,
|
||||
color: Theme.of(context).colorScheme.onSurface.withOpacity(0.75),
|
||||
),
|
||||
Text(
|
||||
@ -70,9 +71,9 @@ class _PostItemState extends State<PostItem> {
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.redo,
|
||||
size: 18,
|
||||
FaIcon(
|
||||
FontAwesomeIcons.retweet,
|
||||
size: 16,
|
||||
color: Theme.of(context).colorScheme.onSurface.withOpacity(0.75),
|
||||
),
|
||||
Text(
|
||||
@ -150,14 +151,16 @@ class _PostItemState extends State<PostItem> {
|
||||
.paddingOnly(left: 4),
|
||||
],
|
||||
),
|
||||
if (widget.item.replyTo != null) buildReply(context),
|
||||
if (widget.item.repostTo != null) buildRepost(context),
|
||||
Markdown(
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
data: item.content,
|
||||
padding: const EdgeInsets.all(0),
|
||||
).paddingOnly(left: 12, right: 8),
|
||||
if (widget.item.replyTo != null)
|
||||
buildReply(context).paddingOnly(top: 4),
|
||||
if (widget.item.repostTo != null)
|
||||
buildRepost(context).paddingOnly(top: 4),
|
||||
],
|
||||
),
|
||||
)
|
||||
|
Reference in New Issue
Block a user