import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:tdesign_flutter/tdesign_flutter.dart'; class NoticePage extends StatefulWidget { const NoticePage({super.key}); @override State createState() => _NoticePageState(); } class _NoticePageState extends State with AutomaticKeepAliveClientMixin{ @override Widget build(BuildContext context) { super.build(context); return Scaffold( backgroundColor: Color(0xffF5F5F5), appBar: AppBar( title: Text('消息通知', style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold)), centerTitle: true, backgroundColor: Colors.white, ), body: Expanded( child: SingleChildScrollView( padding: EdgeInsetsGeometry.symmetric(vertical: 16.w), child: Column( children: [ TDCellGroup( theme: TDCellGroupTheme.cardTheme, cells: [ TDCell( arrow: true, title: '接受推送通知', description: '已开启', ), TDCell( arrow: false, title: '接受推送通知', description: '一段很长很长的内容文字', rightIconWidget: TDSwitch( isOn: false, trackOnColor: const Color.fromRGBO(117, 98, 249, 1), onChanged: (bool e){ return false; }, ) ), ], ), const SizedBox(height: 12), TDCellGroup( theme: TDCellGroupTheme.cardTheme, cells: [ TDCell( arrow: false, title: '后台播放', description: '一段很长很长的内容文字', rightIconWidget: TDSwitch( isOn: true, trackOnColor: const Color.fromRGBO(117, 98, 249, 1), onChanged: (bool e){ return false; }, ) ), ], ), ], ), ), ), ); } @override bool get wantKeepAlive => true; }