-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathblocklist_page.dart
112 lines (107 loc) · 4.15 KB
/
blocklist_page.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
import 'package:byr_mobile_app/customizations/theme_controller.dart';
import 'package:byr_mobile_app/local_objects/local_models.dart';
import 'package:byr_mobile_app/pages/cloud_blocklist_page.dart';
import 'package:byr_mobile_app/pages/local_blocklist_page.dart';
import 'package:byr_mobile_app/pages/pages.dart';
import 'package:byr_mobile_app/reusable_components/about_page_user_widget.dart';
import 'package:byr_mobile_app/reusable_components/adaptive_components.dart';
import 'package:byr_mobile_app/reusable_components/byr_app_bar.dart';
import 'package:byr_mobile_app/reusable_components/custom_tab_controller.dart';
import 'package:byr_mobile_app/reusable_components/custom_tabs.dart';
import 'package:byr_mobile_app/reusable_components/custom_underline_indicator.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class BlocklistPage extends StatefulWidget {
@override
BlocklistPageState createState() => BlocklistPageState();
}
class BlocklistPageState extends State<BlocklistPage>
with SingleTickerProviderStateMixin, AutomaticKeepAliveClientMixin {
CustomTabController controller;
@override
void initState() {
super.initState();
controller = CustomTabController(initialIndex: 0, length: 2, vsync: this);
}
@override
bool get wantKeepAlive => true;
@override
Widget build(BuildContext context) {
super.build(context);
return Scaffold(
appBar: BYRAppBar(
elevation: 0,
flexibleSpace: SafeArea(
child: Padding(
padding: EdgeInsets.only(left: 15.0, right: 15),
child: ShaderMask(
shaderCallback: (Rect bounds) {
return LinearGradient(
begin: Alignment.centerRight,
end: Alignment(100, 0.0),
colors: <Color>[
Colors.white,
Colors.yellow,
],
).createShader(bounds);
},
child: ShaderMask(
shaderCallback: (rect) {
return LinearGradient(
begin: Alignment(-0.9, 0.0),
end: Alignment(-1.0, 0.0),
colors: [Colors.black, Colors.transparent],
).createShader(Rect.fromLTRB(0, 0, rect.width, rect.height));
},
blendMode: BlendMode.dstIn,
child: ShaderMask(
shaderCallback: (rect) {
return LinearGradient(
begin: Alignment(0.9, 0.0),
end: Alignment(1.0, 0.0),
colors: [Colors.black, Colors.transparent],
).createShader(Rect.fromLTRB(0, 0, rect.width, rect.height));
},
blendMode: BlendMode.dstIn,
child: CustomTabBar(
isScrollable: false,
indicator: FixedUnderlineTabIndicator(
borderSide: BorderSide(
width: 3,
color: E().tabPageTopBarSliderColor,
),
),
indicatorWeight: 3,
labelStyle: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
labelColor: E().topBarTitleNormalColor,
unselectedLabelStyle: TextStyle(fontSize: 12),
unselectedLabelColor: E().topBarTitleUnSelectedColor,
tabs: [
CustomTab(
unselectedFontSize: 12,
text: "内容黑名单",
),
CustomTab(
unselectedFontSize: 12,
text: "消息黑名单",
),
],
indicatorColor: E().tabPageTopBarSliderColor,
controller: controller,
),
),
),
),
),
),
),
body: CustomTabBarView(
children: [
LocalBlocklistPage(),
CloudBlocklistPage(),
],
controller: controller,
),
);
}
}