@@ -9,7 +9,7 @@ import 'package:settings/view/pages/privacy/screen_saver_page.dart';
99import 'package:settings/view/pages/settings_page.dart' ;
1010import 'package:yaru/yaru.dart' ;
1111
12- class PrivacyPage extends StatelessWidget {
12+ class PrivacyPage extends StatefulWidget {
1313 const PrivacyPage ({super .key});
1414
1515 static Widget create (BuildContext context) => const PrivacyPage ();
@@ -27,6 +27,26 @@ class PrivacyPage extends StatelessWidget {
2727 .contains (value.toLowerCase ())
2828 : false ;
2929
30+ @override
31+ State <PrivacyPage > createState () => _PrivacyPageState ();
32+ }
33+
34+ class _PrivacyPageState extends State <PrivacyPage >
35+ with SingleTickerProviderStateMixin {
36+ late TabController _controller;
37+
38+ @override
39+ void initState () {
40+ super .initState ();
41+ _controller = TabController (length: 6 , vsync: this );
42+ }
43+
44+ @override
45+ void dispose () {
46+ _controller.dispose ();
47+ super .dispose ();
48+ }
49+
3050 @override
3151 Widget build (BuildContext context) {
3252 final content = < Widget , (IconData , String )> {
@@ -60,30 +80,51 @@ class PrivacyPage extends StatelessWidget {
6080 ),
6181 };
6282
63- return DefaultTabController (
64- length: content.length,
65- child: Scaffold (
66- appBar: YaruWindowTitleBar (
67- titleSpacing: 0 ,
68- backgroundColor: Theme .of (context).scaffoldBackgroundColor,
69- border: BorderSide .none,
70- title: TabBar (
71- isScrollable: true ,
72- tabs: content.entries
73- .map ((e) => TitleBarTab (text: e.value.$2, iconData: e.value.$1))
74- .toList (),
75- ),
76- ),
77- body: TabBarView (
78- children: content.entries
79- .map (
80- (e) => Padding (
81- padding: const EdgeInsets .only (top: kYaruPagePadding),
82- child: e.key,
83+ return Scaffold (
84+ appBar: YaruWindowTitleBar (
85+ titleSpacing: 0 ,
86+ backgroundColor: Theme .of (context).scaffoldBackgroundColor,
87+ border: BorderSide .none,
88+ title: Text (context.l10n.privacyPageTitle),
89+ ),
90+ body: Column (
91+ children: [
92+ Material (
93+ child: SizedBox (
94+ width: 550 ,
95+ child: SingleChildScrollView (
96+ scrollDirection: Axis .horizontal,
97+ child: SizedBox (
98+ width: 1000 ,
99+ child: YaruTabBar (
100+ tabController: _controller,
101+ tabs: content.entries
102+ .map (
103+ (e) => TitleBarTab (
104+ text: e.value.$2,
105+ iconData: e.value.$1,
106+ ),
107+ )
108+ .toList (),
109+ ),
83110 ),
84- )
85- .toList (),
86- ),
111+ ),
112+ ),
113+ ),
114+ Expanded (
115+ child: TabBarView (
116+ controller: _controller,
117+ children: content.entries
118+ .map (
119+ (e) => Padding (
120+ padding: const EdgeInsets .only (top: kYaruPagePadding),
121+ child: e.key,
122+ ),
123+ )
124+ .toList (),
125+ ),
126+ ),
127+ ],
87128 ),
88129 );
89130 }
0 commit comments