Compare commits

..

8 Commits

Author SHA1 Message Date
root
aff2afd5b0 fix: 修复导航栏消失问题 - BottomNavigationBar 添加 type: fixed 和选中颜色 - activity_list_screen 移除嵌套 Scaffold 2026-02-19 17:51:59 +00:00
Ubuntu
27efd05038 fix: 根本性修复导航架构,统一由main_screen管理 2026-02-20 01:42:05 +08:00
Ubuntu
c87a6756db fix: 修复底部导航栏被覆盖和FAB消失问题 2026-02-20 01:23:49 +08:00
Ubuntu
f4c5369792 fix: 使用正式签名 + APK入库 2026-02-20 00:50:21 +08:00
Ubuntu
8687bbb86a feat: 添加关于页面 2026-02-20 00:35:13 +08:00
Ubuntu
1a35899c41 feat: 添加版本检查脚本 2026-02-20 00:05:12 +08:00
Ubuntu
8ebc6e1928 fix: v1.1.9+11 - 修复消息页面和我的页面点击无反应(双Scaffold嵌套)
问题原因: ActivityListScreen 在展示 MessagesScreen/ProfileScreen 时,
外层 Scaffold 的 AppBar 和 FloatingActionButton 仍然显示,
导致双层 Scaffold 嵌套,页面交互被遮挡/挤压。

修复方案: 当 _selectedIndex 为消息(3)或我的(4)时,
外层 Scaffold 不渲染 AppBar 和 FAB,
让内嵌的 MessagesScreen/ProfileScreen 自己的 Scaffold 正常工作。
2026-02-19 21:49:47 +08:00
Ubuntu
e9505b37d1 fix: 修复 main_screen.dart const 错误 2026-02-19 21:32:21 +08:00
10 changed files with 148 additions and 165 deletions

View File

@ -30,11 +30,18 @@ android {
versionName = flutter.versionName versionName = flutter.versionName
} }
signingConfigs {
release {
storeFile file('/home/ubuntu/banxiang-release.jks')
storePassword 'banxiang2026'
keyAlias 'banxiang'
keyPassword 'banxiang2026'
}
}
buildTypes { buildTypes {
release { release {
// TODO: Add your own signing config for the release build. signingConfig = signingConfigs.release
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig = signingConfigs.debug
} }
} }
} }

View File

@ -0,0 +1,45 @@
import 'package:flutter/material.dart';
class AboutScreen extends StatelessWidget {
const AboutScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('关于'),
),
body: const Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'伴享',
style: TextStyle(
fontSize: 28,
fontWeight: FontWeight.bold,
),
),
SizedBox(height: 16),
Text(
'当前版本: 1.1.9+11',
style: TextStyle(
fontSize: 16,
color: Colors.grey,
),
),
SizedBox(height: 16),
Padding(
padding: EdgeInsets.symmetric(horizontal: 32),
child: Text(
'伴享 — 专为银发族打造的社交平台',
textAlign: TextAlign.center,
style: TextStyle(fontSize: 16),
),
),
],
),
),
);
}
}

View File

@ -1,10 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
import 'publish_screen.dart';
import 'activity_detail_screen.dart'; import 'activity_detail_screen.dart';
import 'friends_screen.dart';
import 'messages_screen.dart';
import 'profile_screen.dart';
class ActivityListScreen extends StatefulWidget { class ActivityListScreen extends StatefulWidget {
@override @override
@ -12,8 +8,6 @@ class ActivityListScreen extends StatefulWidget {
} }
class _ActivityListScreenState extends State<ActivityListScreen> { class _ActivityListScreenState extends State<ActivityListScreen> {
int _selectedIndex = 0;
final _feedKey = GlobalKey<RefreshIndicatorState>();
String? _selectedTime; String? _selectedTime;
// //
@ -82,46 +76,13 @@ class _ActivityListScreenState extends State<ActivityListScreen> {
await Future.delayed(const Duration(milliseconds: 200)); await Future.delayed(const Duration(milliseconds: 200));
} }
void _onItemTapped(int index) {
if (index == 0 && _selectedIndex == 0) {
_feedKey.currentState?.show();
return;
}
if (index == 2) {
// -
Navigator.push(
context,
MaterialPageRoute(builder: (context) => PublishScreen()),
);
return;
}
if (index == 1) {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => const FriendsScreen()),
);
return;
}
if (index == 3 || index == 4) {
if (_selectedIndex != index) {
setState(() {
_selectedIndex = index;
});
}
return;
}
if (_selectedIndex != index) {
setState(() {
_selectedIndex = index;
});
}
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Container(
backgroundColor: const Color(0xFFFFF8F0), color: const Color(0xFFFFF8F0),
appBar: AppBar( child: Column(
children: [
AppBar(
title: Text('伴享', style: TextStyle(fontWeight: FontWeight.bold)), title: Text('伴享', style: TextStyle(fontWeight: FontWeight.bold)),
centerTitle: true, centerTitle: true,
actions: [ actions: [
@ -135,28 +96,15 @@ class _ActivityListScreenState extends State<ActivityListScreen> {
), ),
], ],
), ),
body: _buildBody(), Expanded(child: _buildFeed()),
bottomNavigationBar: _buildBottomNavigationBar(), ],
floatingActionButton: _buildFloatingActionButton(), ),
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
); );
} }
Widget _buildBody() {
switch (_selectedIndex) {
case 3:
return const MessagesScreen();
case 4:
return const ProfileScreen();
default:
return _buildFeed();
}
}
Widget _buildFeed() { Widget _buildFeed() {
final filteredActivities = _getFilteredActivities(); final filteredActivities = _getFilteredActivities();
return RefreshIndicator( return RefreshIndicator(
key: _feedKey,
onRefresh: _refreshActivities, onRefresh: _refreshActivities,
child: ListView( child: ListView(
physics: const AlwaysScrollableScrollPhysics(), physics: const AlwaysScrollableScrollPhysics(),
@ -375,91 +323,4 @@ class _ActivityListScreenState extends State<ActivityListScreen> {
); );
} }
Widget _buildBottomNavigationBar() {
return Container(
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.05),
blurRadius: 10,
offset: Offset(0, -2),
),
],
),
child: SafeArea(
child: Container(
height: 60,
child: Row(
children: [
_buildNavItem(0, Icons.home, '首页'),
_buildNavItem(1, Icons.people, '好友'),
SizedBox(width: 60), //
_buildNavItem(3, Icons.message, '消息'),
_buildNavItem(4, Icons.person, '我的'),
],
),
),
),
);
}
Widget _buildNavItem(int index, IconData icon, String label) {
final isSelected = _selectedIndex == index;
return Expanded(
child: GestureDetector(
onTap: () => _onItemTapped(index),
behavior: HitTestBehavior.opaque,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
icon,
color: isSelected ? Color(0xFFFF6B35) : Color(0xFF999999),
size: 24,
),
SizedBox(height: 4),
Text(
label,
style: TextStyle(
fontSize: 11,
color: isSelected ? Color(0xFFFF6B35) : Color(0xFF999999),
),
),
],
),
),
);
}
Widget _buildFloatingActionButton() {
return Container(
width: 56,
height: 56,
margin: EdgeInsets.only(top: 30),
decoration: BoxDecoration(
shape: BoxShape.circle,
gradient: LinearGradient(
colors: [Color(0xFFFF6B35), Color(0xFFFFB84D)],
begin: Alignment.topLeft,
end: Alignment.bottomRight,
),
boxShadow: [
BoxShadow(
color: Color(0xFFFF6B35).withOpacity(0.4),
blurRadius: 12,
offset: Offset(0, 4),
),
],
),
child: Material(
color: Colors.transparent,
child: InkWell(
onTap: () => _onItemTapped(2),
customBorder: CircleBorder(),
child: Icon(Icons.add, color: Colors.white, size: 28),
),
),
);
}
} }

View File

@ -1,9 +1,11 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'home_screen.dart'; import 'activity_list_screen.dart';
import 'friends_screen.dart';
import 'services_screen.dart'; import 'services_screen.dart';
import 'ai_chat_screen.dart'; import 'ai_chat_screen.dart';
import 'messages_screen.dart'; import 'messages_screen.dart';
import 'profile_screen.dart'; import 'profile_screen.dart';
import 'create_activity_screen.dart';
class MainScreen extends StatefulWidget { class MainScreen extends StatefulWidget {
const MainScreen({super.key}); const MainScreen({super.key});
@ -14,8 +16,9 @@ class MainScreen extends StatefulWidget {
class _MainScreenState extends State<MainScreen> { class _MainScreenState extends State<MainScreen> {
int _currentIndex = 0; int _currentIndex = 0;
final _screens = const [ final _screens = [
HomeScreen(), ActivityListScreen(),
FriendsScreen(),
ServicesScreen(), ServicesScreen(),
AiChatScreen(), AiChatScreen(),
MessagesScreen(), MessagesScreen(),
@ -26,11 +29,17 @@ class _MainScreenState extends State<MainScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
body: IndexedStack(index: _currentIndex, children: _screens), body: IndexedStack(index: _currentIndex, children: _screens),
floatingActionButton: _buildGlobalFab(),
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
bottomNavigationBar: BottomNavigationBar( bottomNavigationBar: BottomNavigationBar(
type: BottomNavigationBarType.fixed,
currentIndex: _currentIndex, currentIndex: _currentIndex,
onTap: (i) => setState(() => _currentIndex = i), onTap: (i) => setState(() => _currentIndex = i),
selectedItemColor: const Color(0xFFFF6B35),
unselectedItemColor: const Color(0xFF999999),
items: const [ items: const [
BottomNavigationBarItem(icon: Icon(Icons.home_outlined), activeIcon: Icon(Icons.home), label: '首页'), BottomNavigationBarItem(icon: Icon(Icons.home_outlined), activeIcon: Icon(Icons.home), label: '首页'),
BottomNavigationBarItem(icon: Icon(Icons.people_outline), activeIcon: Icon(Icons.people), label: '好友'),
BottomNavigationBarItem(icon: Icon(Icons.grid_view_outlined), activeIcon: Icon(Icons.grid_view), label: '服务'), BottomNavigationBarItem(icon: Icon(Icons.grid_view_outlined), activeIcon: Icon(Icons.grid_view), label: '服务'),
BottomNavigationBarItem(icon: Icon(Icons.smart_toy_outlined), activeIcon: Icon(Icons.smart_toy), label: 'AI管家'), BottomNavigationBarItem(icon: Icon(Icons.smart_toy_outlined), activeIcon: Icon(Icons.smart_toy), label: 'AI管家'),
BottomNavigationBarItem(icon: Icon(Icons.message_outlined), activeIcon: Icon(Icons.message), label: '消息'), BottomNavigationBarItem(icon: Icon(Icons.message_outlined), activeIcon: Icon(Icons.message), label: '消息'),
@ -39,4 +48,40 @@ class _MainScreenState extends State<MainScreen> {
), ),
); );
} }
Widget _buildGlobalFab() {
return Container(
width: 56,
height: 56,
margin: const EdgeInsets.only(top: 30),
decoration: BoxDecoration(
shape: BoxShape.circle,
gradient: const LinearGradient(
colors: [Color(0xFFFF6B35), Color(0xFFFFB84D)],
begin: Alignment.topLeft,
end: Alignment.bottomRight,
),
boxShadow: [
BoxShadow(
color: const Color(0xFFFF6B35).withOpacity(0.35),
blurRadius: 12,
offset: const Offset(0, 4),
),
],
),
child: Material(
color: Colors.transparent,
child: InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (_) => CreateActivityScreen()),
);
},
customBorder: const CircleBorder(),
child: const Icon(Icons.add, color: Colors.white, size: 28),
),
),
);
}
} }

View File

@ -3,6 +3,7 @@ import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'about_screen.dart';
import 'profile_setup_screen.dart'; import 'profile_setup_screen.dart';
class ProfileScreen extends StatefulWidget { class ProfileScreen extends StatefulWidget {
@ -127,6 +128,17 @@ class _ProfileScreenState extends State<ProfileScreen> {
), ),
), ),
), ),
//
ListTile(
leading: const Icon(Icons.info_outline),
title: const Text('关于'),
trailing: const Icon(Icons.chevron_right),
onTap: () {
Navigator.of(context).push(
MaterialPageRoute(builder: (_) => const AboutScreen()),
);
},
),
Padding( Padding(
padding: const EdgeInsets.fromLTRB(24, 0, 24, 24), padding: const EdgeInsets.fromLTRB(24, 0, 24, 24),
child: SizedBox( child: SizedBox(

View File

@ -1,6 +1,6 @@
name: banxiang_app name: banxiang_app
description: 伴享 description: 伴享
version: 1.1.8+10 version: 1.1.9+11
environment: environment:
sdk: '>=3.0.0 <4.0.0' sdk: '>=3.0.0 <4.0.0'

Binary file not shown.

Binary file not shown.

Binary file not shown.

13
scripts/version_check.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
# 读取 pubspec.yaml 中的 version 字段
VERSION=$(grep "^version:" pubspec.yaml | sed 's/version: *//' | tr -d ' ')
# 检查 version 格式是否符合 x.x.x+x用正则
if [[ ! $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+\+[0-9]+$ ]]; then
echo "错误: version 格式不符合 x.x.x+x"
exit 1
fi
# 输出格式:当前版本: x.x.x+x
echo "当前版本: $VERSION"