@@ -9,7 +9,7 @@ import 'package:settings/view/pages/privacy/screen_saver_page.dart';
9
9
import 'package:settings/view/pages/settings_page.dart' ;
10
10
import 'package:yaru/yaru.dart' ;
11
11
12
- class PrivacyPage extends StatelessWidget {
12
+ class PrivacyPage extends StatefulWidget {
13
13
const PrivacyPage ({super .key});
14
14
15
15
static Widget create (BuildContext context) => const PrivacyPage ();
@@ -27,6 +27,26 @@ class PrivacyPage extends StatelessWidget {
27
27
.contains (value.toLowerCase ())
28
28
: false ;
29
29
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
+
30
50
@override
31
51
Widget build (BuildContext context) {
32
52
final content = < Widget , (IconData , String )> {
@@ -60,30 +80,51 @@ class PrivacyPage extends StatelessWidget {
60
80
),
61
81
};
62
82
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
+ ),
83
110
),
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
+ ],
87
128
),
88
129
);
89
130
}
0 commit comments