Compare commits

..

No commits in common. "main" and "jingjing" have entirely different histories.

10 changed files with 165 additions and 148 deletions

View File

@ -30,18 +30,11 @@ 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 {
signingConfig = signingConfigs.release // TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig = signingConfigs.debug
} }
} }
} }

View File

@ -1,45 +0,0 @@
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,6 +1,10 @@
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
@ -8,6 +12,8 @@ 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;
// //
@ -76,35 +82,81 @@ 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 Container( return Scaffold(
color: const Color(0xFFFFF8F0), backgroundColor: const Color(0xFFFFF8F0),
child: Column( appBar: AppBar(
children: [ title: Text('伴享', style: TextStyle(fontWeight: FontWeight.bold)),
AppBar( centerTitle: true,
title: Text('伴享', style: TextStyle(fontWeight: FontWeight.bold)), actions: [
centerTitle: true, IconButton(
actions: [ icon: Icon(Icons.search),
IconButton( onPressed: () {},
icon: Icon(Icons.search), ),
onPressed: () {}, IconButton(
), icon: Icon(Icons.notifications_none),
IconButton( onPressed: () {},
icon: Icon(Icons.notifications_none),
onPressed: () {},
),
],
), ),
Expanded(child: _buildFeed()),
], ],
), ),
body: _buildBody(),
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(),
@ -323,4 +375,91 @@ 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,11 +1,9 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'activity_list_screen.dart'; import 'home_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});
@ -16,9 +14,8 @@ class MainScreen extends StatefulWidget {
class _MainScreenState extends State<MainScreen> { class _MainScreenState extends State<MainScreen> {
int _currentIndex = 0; int _currentIndex = 0;
final _screens = [ final _screens = const [
ActivityListScreen(), HomeScreen(),
FriendsScreen(),
ServicesScreen(), ServicesScreen(),
AiChatScreen(), AiChatScreen(),
MessagesScreen(), MessagesScreen(),
@ -29,17 +26,11 @@ 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: '消息'),
@ -48,40 +39,4 @@ 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,7 +3,6 @@ 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 {
@ -128,17 +127,6 @@ 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.9+11 version: 1.1.8+10
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.

View File

@ -1,13 +0,0 @@
#!/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"