edit backgroun and inmclude
This commit is contained in:
+101
-120
@@ -6,6 +6,9 @@ import '../services/vanguard_api.dart';
|
||||
import 'select_school_page.dart';
|
||||
import 'home_page.dart';
|
||||
import 'meditation_page.dart';
|
||||
import '../widgets/app_drawer.dart';
|
||||
import '../widgets/app_bottom_nav.dart';
|
||||
import '../widgets/yogibook_background.dart';
|
||||
|
||||
class LessonsPage extends StatefulWidget {
|
||||
final String token;
|
||||
@@ -136,18 +139,14 @@ class _LessonsPageState extends State<LessonsPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: const Color(0xFFF6F6FB),
|
||||
drawer: _AppDrawer(
|
||||
drawer: AppDrawer(
|
||||
token: widget.token,
|
||||
onLogout: () {
|
||||
Navigator.of(context).pop();
|
||||
ScaffoldMessenger.of(
|
||||
context,
|
||||
).showSnackBar(const SnackBar(content: Text('Logout (TODO)')));
|
||||
},
|
||||
school: widget.school,
|
||||
userFirstName: widget.userFirstName,
|
||||
),
|
||||
|
||||
appBar: AppBar(
|
||||
backgroundColor: const Color(0xFFF6F6FB),
|
||||
backgroundColor: Colors.transparent,
|
||||
elevation: 0,
|
||||
centerTitle: true,
|
||||
title: Column(
|
||||
@@ -185,127 +184,109 @@ class _LessonsPageState extends State<LessonsPage> {
|
||||
),
|
||||
],
|
||||
),
|
||||
bottomNavigationBar: BottomNavigationBar(
|
||||
type: BottomNavigationBarType.fixed, // con 4 icone serve
|
||||
backgroundColor: Colors.white,
|
||||
selectedItemColor: const Color(0xFF10B981),
|
||||
unselectedItemColor: Colors.black54,
|
||||
bottomNavigationBar: AppBottomNav(
|
||||
currentIndex: bottomIndex,
|
||||
onTap: _handleBottomNav,
|
||||
items: const [
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.home_rounded),
|
||||
label: 'Home',
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.event_note_rounded),
|
||||
label: 'Lezioni',
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.person_rounded),
|
||||
label: 'Account',
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.self_improvement_rounded),
|
||||
label: 'Meditazione',
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
body: SafeArea(
|
||||
top: false,
|
||||
child: Column(
|
||||
children: [
|
||||
// Address small (optional)
|
||||
if (schoolAddress != null && schoolAddress!.trim().isNotEmpty)
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 6, 16, 6),
|
||||
child: Text(
|
||||
schoolAddress!,
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
fontSize: 12,
|
||||
color: Colors.black45,
|
||||
fontWeight: FontWeight.w500,
|
||||
body: YogibookBackground(
|
||||
child: SafeArea(
|
||||
top: false,
|
||||
child: Column(
|
||||
children: [
|
||||
// Address small (optional)
|
||||
if (schoolAddress != null && schoolAddress!.trim().isNotEmpty)
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 6, 16, 6),
|
||||
child: Text(
|
||||
schoolAddress!,
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
fontSize: 12,
|
||||
color: Colors.black45,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
// Month selector only
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 6, 16, 10),
|
||||
child: _MonthPillCompact(
|
||||
label: _monthLabel(currentMonth),
|
||||
onPrev: prevMonth == null
|
||||
? null
|
||||
: () {
|
||||
setState(() => currentMonth = prevMonth!);
|
||||
_load();
|
||||
},
|
||||
onNext: nextMonth == null
|
||||
? null
|
||||
: () {
|
||||
setState(() => currentMonth = nextMonth!);
|
||||
_load();
|
||||
},
|
||||
),
|
||||
),
|
||||
|
||||
// Month selector only
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 6, 16, 10),
|
||||
child: _MonthPillCompact(
|
||||
label: _monthLabel(currentMonth),
|
||||
onPrev: prevMonth == null
|
||||
? null
|
||||
: () {
|
||||
setState(() => currentMonth = prevMonth!);
|
||||
_load();
|
||||
},
|
||||
onNext: nextMonth == null
|
||||
? null
|
||||
: () {
|
||||
setState(() => currentMonth = nextMonth!);
|
||||
_load();
|
||||
},
|
||||
),
|
||||
),
|
||||
|
||||
Expanded(
|
||||
child: loading
|
||||
? const Center(child: CircularProgressIndicator())
|
||||
: error.isNotEmpty
|
||||
? _ErrorBox(message: error, onRetry: _load)
|
||||
: lessons.isEmpty
|
||||
? _EmptyState(
|
||||
onBrowse: () {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text('TODO: vedi corsi')),
|
||||
);
|
||||
},
|
||||
)
|
||||
: ListView.builder(
|
||||
padding: const EdgeInsets.fromLTRB(16, 0, 16, 16),
|
||||
itemCount: lessons.length + 1,
|
||||
itemBuilder: (_, i) {
|
||||
if (i == lessons.length) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(top: 8, bottom: 6),
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
'assets/images/yogibook_logo.png',
|
||||
height: 56,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: loading
|
||||
? const Center(child: CircularProgressIndicator())
|
||||
: error.isNotEmpty
|
||||
? _ErrorBox(message: error, onRetry: _load)
|
||||
: lessons.isEmpty
|
||||
? _EmptyState(
|
||||
onBrowse: () {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text('TODO: vedi corsi')),
|
||||
);
|
||||
}
|
||||
},
|
||||
)
|
||||
: ListView.builder(
|
||||
padding: const EdgeInsets.fromLTRB(16, 0, 16, 16),
|
||||
itemCount: lessons.length + 1,
|
||||
itemBuilder: (_, i) {
|
||||
if (i == lessons.length) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(top: 8, bottom: 6),
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
'assets/images/yogibook_logo.png',
|
||||
height: 56,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
final l = lessons[i];
|
||||
return _LessonGreenCardCompact(
|
||||
lesson: l,
|
||||
weekday: _weekdayLabel(l.date),
|
||||
dayNum: _dayNum(l.date),
|
||||
onReschedule: l.canModify
|
||||
? () =>
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text('Riprogramma: API dopo'),
|
||||
),
|
||||
)
|
||||
: null,
|
||||
onCancel: l.canModify
|
||||
? () =>
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text('Cancella: API dopo'),
|
||||
),
|
||||
)
|
||||
: null,
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
final l = lessons[i];
|
||||
return _LessonGreenCardCompact(
|
||||
lesson: l,
|
||||
weekday: _weekdayLabel(l.date),
|
||||
dayNum: _dayNum(l.date),
|
||||
onReschedule: l.canModify
|
||||
? () => ScaffoldMessenger.of(context)
|
||||
.showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text(
|
||||
'Riprogramma: API dopo',
|
||||
),
|
||||
),
|
||||
)
|
||||
: null,
|
||||
onCancel: l.canModify
|
||||
? () => ScaffoldMessenger.of(context)
|
||||
.showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text('Cancella: API dopo'),
|
||||
),
|
||||
)
|
||||
: null,
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user