|
1 | 1 | import 'package:flutter/material.dart';
|
| 2 | +import 'package:flutter_svg/svg.dart'; |
2 | 3 | import 'package:fluttertoast/fluttertoast.dart';
|
3 | 4 | import 'package:provider/provider.dart';
|
4 | 5 | import 'package:rutorrentflutter/api/api_conf.dart';
|
@@ -37,103 +38,116 @@ class _RSSFilterDetailsState extends State<RSSFilterDetails> {
|
37 | 38 | ? LoadingShimmer().loadingEffect(context)
|
38 | 39 | : Column(
|
39 | 40 | children: <Widget>[
|
40 |
| - Expanded( |
41 |
| - child: ListView.builder( |
42 |
| - itemCount: rssFilters.length, |
43 |
| - itemBuilder: (context, index) { |
44 |
| - return Container( |
45 |
| - child: Padding( |
46 |
| - padding: const EdgeInsets.all(8.0), |
47 |
| - child: Column( |
48 |
| - crossAxisAlignment: CrossAxisAlignment.start, |
49 |
| - children: <Widget>[ |
50 |
| - Row( |
51 |
| - mainAxisAlignment: |
52 |
| - MainAxisAlignment.spaceBetween, |
53 |
| - children: <Widget>[ |
54 |
| - Text( |
55 |
| - '${index + 1}. ${rssFilters[index].name}', |
56 |
| - style: TextStyle( |
57 |
| - fontWeight: FontWeight.w600, |
58 |
| - fontSize: 16), |
59 |
| - ), |
60 |
| - Checkbox( |
61 |
| - activeColor: |
62 |
| - Theme.of(context).primaryColor, |
63 |
| - onChanged: (val) { |
64 |
| - Fluttertoast.showToast( |
65 |
| - msg: |
66 |
| - 'Please use ruTorrent web interface to change filter settings'); |
67 |
| - }, |
68 |
| - value: rssFilters[index].enabled == 1, |
69 |
| - ) |
70 |
| - ], |
71 |
| - ), |
72 |
| - Padding( |
| 41 | + (rssFilters.length != 0) |
| 42 | + ? Expanded( |
| 43 | + child: ListView.builder( |
| 44 | + itemCount: rssFilters.length, |
| 45 | + itemBuilder: (context, index) { |
| 46 | + return Container( |
| 47 | + child: Padding( |
73 | 48 | padding: const EdgeInsets.all(8.0),
|
74 |
| - child: Row( |
| 49 | + child: Column( |
| 50 | + crossAxisAlignment: |
| 51 | + CrossAxisAlignment.start, |
75 | 52 | children: <Widget>[
|
76 |
| - Text( |
77 |
| - 'Pattern: ', |
78 |
| - style: TextStyle( |
79 |
| - fontWeight: FontWeight.w600), |
| 53 | + Row( |
| 54 | + mainAxisAlignment: |
| 55 | + MainAxisAlignment.spaceBetween, |
| 56 | + children: <Widget>[ |
| 57 | + Text( |
| 58 | + '${index + 1}. ${rssFilters[index].name}', |
| 59 | + style: TextStyle( |
| 60 | + fontWeight: FontWeight.w600, |
| 61 | + fontSize: 16), |
| 62 | + ), |
| 63 | + Checkbox( |
| 64 | + activeColor: |
| 65 | + Theme.of(context).primaryColor, |
| 66 | + onChanged: (val) { |
| 67 | + Fluttertoast.showToast( |
| 68 | + msg: |
| 69 | + 'Please use ruTorrent web interface to change filter settings'); |
| 70 | + }, |
| 71 | + value: |
| 72 | + rssFilters[index].enabled == 1, |
| 73 | + ) |
| 74 | + ], |
80 | 75 | ),
|
81 |
| - Flexible( |
82 |
| - child: |
83 |
| - Text(rssFilters[index].pattern)), |
84 |
| - ], |
85 |
| - ), |
86 |
| - ), |
87 |
| - Padding( |
88 |
| - padding: const EdgeInsets.all(8.0), |
89 |
| - child: Row( |
90 |
| - children: <Widget>[ |
91 |
| - Text( |
92 |
| - 'Label: ', |
93 |
| - style: TextStyle( |
94 |
| - fontWeight: FontWeight.w600), |
| 76 | + Padding( |
| 77 | + padding: const EdgeInsets.all(8.0), |
| 78 | + child: Row( |
| 79 | + children: <Widget>[ |
| 80 | + Text( |
| 81 | + 'Pattern: ', |
| 82 | + style: TextStyle( |
| 83 | + fontWeight: FontWeight.w600), |
| 84 | + ), |
| 85 | + Flexible( |
| 86 | + child: Text( |
| 87 | + rssFilters[index].pattern)), |
| 88 | + ], |
| 89 | + ), |
95 | 90 | ),
|
96 |
| - Flexible( |
97 |
| - child: Text(rssFilters[index].label)), |
98 |
| - ], |
99 |
| - ), |
100 |
| - ), |
101 |
| - Padding( |
102 |
| - padding: const EdgeInsets.all(8.0), |
103 |
| - child: Row( |
104 |
| - children: <Widget>[ |
105 |
| - Text( |
106 |
| - 'Exclude: ', |
107 |
| - style: TextStyle( |
108 |
| - fontWeight: FontWeight.w600), |
| 91 | + Padding( |
| 92 | + padding: const EdgeInsets.all(8.0), |
| 93 | + child: Row( |
| 94 | + children: <Widget>[ |
| 95 | + Text( |
| 96 | + 'Label: ', |
| 97 | + style: TextStyle( |
| 98 | + fontWeight: FontWeight.w600), |
| 99 | + ), |
| 100 | + Flexible( |
| 101 | + child: Text( |
| 102 | + rssFilters[index].label)), |
| 103 | + ], |
| 104 | + ), |
109 | 105 | ),
|
110 |
| - Flexible( |
111 |
| - child: |
112 |
| - Text(rssFilters[index].exclude)), |
113 |
| - ], |
114 |
| - ), |
115 |
| - ), |
116 |
| - Padding( |
117 |
| - padding: const EdgeInsets.all(8.0), |
118 |
| - child: Row( |
119 |
| - children: <Widget>[ |
120 |
| - Text( |
121 |
| - 'Save Directory: ', |
122 |
| - style: TextStyle( |
123 |
| - fontWeight: FontWeight.w600), |
| 106 | + Padding( |
| 107 | + padding: const EdgeInsets.all(8.0), |
| 108 | + child: Row( |
| 109 | + children: <Widget>[ |
| 110 | + Text( |
| 111 | + 'Exclude: ', |
| 112 | + style: TextStyle( |
| 113 | + fontWeight: FontWeight.w600), |
| 114 | + ), |
| 115 | + Flexible( |
| 116 | + child: Text( |
| 117 | + rssFilters[index].exclude)), |
| 118 | + ], |
| 119 | + ), |
| 120 | + ), |
| 121 | + Padding( |
| 122 | + padding: const EdgeInsets.all(8.0), |
| 123 | + child: Row( |
| 124 | + children: <Widget>[ |
| 125 | + Text( |
| 126 | + 'Save Directory: ', |
| 127 | + style: TextStyle( |
| 128 | + fontWeight: FontWeight.w600), |
| 129 | + ), |
| 130 | + Flexible( |
| 131 | + child: Text( |
| 132 | + rssFilters[index].dir)), |
| 133 | + ], |
| 134 | + ), |
124 | 135 | ),
|
125 |
| - Flexible( |
126 |
| - child: Text(rssFilters[index].dir)), |
| 136 | + Divider(), |
127 | 137 | ],
|
128 | 138 | ),
|
129 | 139 | ),
|
130 |
| - Divider(), |
131 |
| - ], |
132 |
| - ), |
133 |
| - ), |
134 |
| - ); |
135 |
| - }), |
136 |
| - ), |
| 140 | + ); |
| 141 | + }), |
| 142 | + ) |
| 143 | + : Expanded( |
| 144 | + child: Center( |
| 145 | + child: SvgPicture.asset( |
| 146 | + 'assets/logo/empty.svg', |
| 147 | + width: 120, |
| 148 | + height: 120, |
| 149 | + ), |
| 150 | + )), |
137 | 151 | ],
|
138 | 152 | ),
|
139 | 153 | );
|
|
0 commit comments