-
Notifications
You must be signed in to change notification settings - Fork 47
/
Copy pathprinters_page.dart
117 lines (114 loc) · 4.08 KB
/
printers_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
113
114
115
116
117
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:settings/view/pages/printers/printers_model.dart';
import 'package:settings/view/widgets/extra_options_gsettings_row.dart';
import 'package:settings/view/widgets/settings_row.dart';
import 'package:settings/view/widgets/settings_section.dart';
import 'package:yaru_icons/widgets/yaru_icons.dart';
class PrintersPage extends StatelessWidget {
const PrintersPage({Key? key}) : super(key: key);
static Widget create(BuildContext context) {
// final service = Provider.of<SettingsService>(context, listen: false);
return ChangeNotifierProvider<PrintersModel>(
create: (_) => PrintersModel(),
child: const PrintersPage(),
);
}
@override
Widget build(BuildContext context) {
return Column(
children: [
Padding(
padding: const EdgeInsets.only(bottom: 35, top: 15),
child: SizedBox(
width: 518,
child: Row(
children: [
SizedBox(
height: 40,
child: ElevatedButton(
onPressed: () => {},
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: const [
Icon(YaruIcons.plus),
Padding(
padding: EdgeInsets.only(left: 12.0, right: 2),
child: Text('Add a printer'),
)
],
)),
),
const SizedBox(
width: 12,
),
SizedBox(
height: 40,
child: OutlinedButton(
onPressed: () => {},
child: const Text('Additional printer settings ...')),
)
],
),
),
),
for (var i = 0; i < 10; i++)
SettingsSection(headline: 'Printer ${i + 1}', children: [
SettingsRow(
trailingWidget: Row(
children: [
SizedBox(
width: 70,
child: Image.asset(
i.isEven
? 'assets/images/icons/printer.png'
: 'assets/images/icons/printer-network.png',
fit: BoxFit.fill),
),
const SizedBox(
width: 20,
),
SizedBox(
height: 60,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Text('Model XYZ'), // printer.type
const SizedBox(
height: 3,
),
Text(i.isEven
? 'local'
: '192.168.1.1337'), // printer.location
// printer.status
],
),
)
],
),
actionWidget: Row(
children: [
const SizedBox(
height: 40,
child: OutlinedButton(
onPressed: null, // printer.activejobs ?
child: Text(
'No active jobs',
// style: TextStyle(
// color: Theme.of(context).disabledColor),
)),
),
const SizedBox(
width: 10,
),
OptionsButton(
onPressed: () => {},
),
],
))
])
],
);
}
}