新增"更多"功能
This commit is contained in:
parent
8fe8e7113c
commit
a6123b506f
@ -5,6 +5,7 @@ import 'package:communityapp/visitor.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'reapair.dart';
|
import 'reapair.dart';
|
||||||
import 'activity.dart';
|
import 'activity.dart';
|
||||||
|
import 'announcement.dart';
|
||||||
|
|
||||||
class HomeContentPage extends StatelessWidget {
|
class HomeContentPage extends StatelessWidget {
|
||||||
const HomeContentPage({super.key});
|
const HomeContentPage({super.key});
|
||||||
@ -59,7 +60,7 @@ class HomeContentPage extends StatelessWidget {
|
|||||||
body: SingleChildScrollView(
|
body: SingleChildScrollView(
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
_announcementSection(),
|
_announcementSection(context),
|
||||||
_quickMenuSection(context),
|
_quickMenuSection(context),
|
||||||
_adCarousel(),
|
_adCarousel(),
|
||||||
_marqueeNotice(),
|
_marqueeNotice(),
|
||||||
@ -71,21 +72,56 @@ class HomeContentPage extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 📢 重要公告區塊
|
// 📢 重要公告區塊
|
||||||
static Widget _announcementSection() {
|
static Widget _announcementSection(BuildContext context) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
const Text(
|
Row(
|
||||||
'📢 重要公告',
|
children: [
|
||||||
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
|
const Text(
|
||||||
|
'📢 重要公告',
|
||||||
|
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
const Spacer(),
|
||||||
|
TextButton(
|
||||||
|
onPressed: () {
|
||||||
|
showModalBottomSheet(
|
||||||
|
context: context,
|
||||||
|
isScrollControlled: true,
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
builder: (_) => const AnnouncementWrapper(),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
style: OutlinedButton.styleFrom(
|
||||||
|
foregroundColor: Colors.blue,
|
||||||
|
side: const BorderSide(color: Colors.blue), // 藍色外框
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(20), // 更小的圓角
|
||||||
|
),
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 12,
|
||||||
|
vertical: 6,
|
||||||
|
), // 更小的內距
|
||||||
|
minimumSize: const Size(0, 0), // 取消預設最小尺寸限制
|
||||||
|
tapTargetSize: MaterialTapTargetSize.shrinkWrap, // 點擊範圍不外擴
|
||||||
|
),
|
||||||
|
child: const Text(
|
||||||
|
'更多',
|
||||||
|
style: TextStyle(fontSize: 14), // 更小字體
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
Card(
|
Padding(
|
||||||
child: ListTile(
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||||
title: const Text('4/20 水塔清洗通知'),
|
child: Card(
|
||||||
subtitle: const Text('本週六早上9:00至下午3:00進行清洗,請提前儲水。'),
|
child: ListTile(
|
||||||
|
title: const Text('4/20 水塔清洗通知'),
|
||||||
|
subtitle: const Text('本週六早上9:00至下午3:00進行清洗,請提前儲水。'),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@ -157,7 +157,6 @@ class PersonalPage extends StatelessWidget {
|
|||||||
right: 0,
|
right: 0,
|
||||||
child: OutlinedButton(
|
child: OutlinedButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
// TODO: 意見箱按鈕
|
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
MaterialPageRoute(builder: (context) => const FeedbackPage()),
|
MaterialPageRoute(builder: (context) => const FeedbackPage()),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user