Skip to content

Commit aabce99

Browse files
authored
fix: Fixed issue after migrating to flutter v2 (#67)
* fix: Fixed issue after migrating to flutter v2 * fix: Changed the flutter version in workflow * fix: Reverted shared_pref * fix: Changed Raised button to Elevated button * fix: Changed flat button to text button
1 parent a8a71a6 commit aabce99

File tree

12 files changed

+138
-118
lines changed

12 files changed

+138
-118
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
java-version: '12.x'
1818
- uses: subosito/flutter-action@v1
1919
with:
20-
flutter-version: '1.22.4'
20+
flutter-version: '2.0.0'
2121
- run: flutter pub get
2222
- run: flutter test
2323
- run: flutter analyze

ios/Podfile.lock

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ PODS:
4141
- MobileVLCKit (~> 3.3.12)
4242
- fluttertoast (0.0.2):
4343
- Flutter
44+
- Toast
4445
- MobileVLCKit (3.3.15)
4546
- open_file (0.0.1):
4647
- Flutter
@@ -54,6 +55,7 @@ PODS:
5455
- shared_preferences (0.0.1):
5556
- Flutter
5657
- SwiftyGif (5.3.0)
58+
- Toast (4.0.0)
5759
- wakelock (0.0.1):
5860
- Flutter
5961

@@ -76,6 +78,7 @@ SPEC REPOS:
7678
- MobileVLCKit
7779
- SDWebImage
7880
- SwiftyGif
81+
- Toast
7982

8083
EXTERNAL SOURCES:
8184
file_picker:
@@ -103,17 +106,18 @@ SPEC CHECKSUMS:
103106
DKImagePickerController: b5eb7f7a388e4643264105d648d01f727110fc3d
104107
DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179
105108
file_picker: 3e6c3790de664ccf9b882732d9db5eaf6b8d4eb1
106-
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
109+
Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
107110
flutter_local_notifications: 9e4738ce2471c5af910d961a6b7eadcf57c50186
108111
flutter_vlc_player: 64a2c27b2c99bc4fb954c5ff9d1cc278c87702ee
109-
fluttertoast: b644586ef3b16f67fae9a1f8754cef6b2d6b634b
112+
fluttertoast: 6122fa75143e992b1d3470f61000f591a798cc58
110113
MobileVLCKit: 9a04c9fa19e35c376ddf59425dd82e397d5899ad
111114
open_file: 02eb5cb6b21264bd3a696876f5afbfb7ca4f4b7d
112115
package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62
113116
path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c
114117
SDWebImage: 9169792e9eec3e45bba2a0c02f74bf8bd922d1ee
115118
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
116119
SwiftyGif: e466e86c660d343357ab944a819a101c4127cb40
120+
Toast: 91b396c56ee72a5790816f40d3a94dd357abc196
117121
wakelock: bfc7955c418d0db797614075aabbc58a39ab5107
118122

119123
PODFILE CHECKSUM: a75497545d4391e2d394c3668e20cfb1c2bbd4aa

ios/Runner.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,9 @@
207207
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
208208
"${BUILT_PRODUCTS_DIR}/DKImagePickerController/DKImagePickerController.framework",
209209
"${BUILT_PRODUCTS_DIR}/DKPhotoGallery/DKPhotoGallery.framework",
210-
"${PODS_ROOT}/../Flutter/Flutter.framework",
211210
"${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework",
212211
"${BUILT_PRODUCTS_DIR}/SwiftyGif/SwiftyGif.framework",
212+
"${BUILT_PRODUCTS_DIR}/Toast/Toast.framework",
213213
"${BUILT_PRODUCTS_DIR}/file_picker/file_picker.framework",
214214
"${BUILT_PRODUCTS_DIR}/flutter_local_notifications/flutter_local_notifications.framework",
215215
"${BUILT_PRODUCTS_DIR}/fluttertoast/fluttertoast.framework",
@@ -223,9 +223,9 @@
223223
outputPaths = (
224224
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DKImagePickerController.framework",
225225
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DKPhotoGallery.framework",
226-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework",
227226
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework",
228227
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyGif.framework",
228+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Toast.framework",
229229
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/file_picker.framework",
230230
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_local_notifications.framework",
231231
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/fluttertoast.framework",

ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/components/add_url_bottom_sheet.dart

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,14 @@ class _AddBottomSheetState extends State<AddBottomSheet> {
9898
Container(
9999
padding: const EdgeInsets.symmetric(vertical: 16, horizontal: 36),
100100
width: double.infinity,
101-
child: RaisedButton(
102-
shape: RoundedRectangleBorder(
103-
borderRadius: BorderRadius.circular(5.0),
104-
side: BorderSide(color: Theme.of(context).primaryColor),
105-
),
106-
color: Theme.of(context).primaryColor,
101+
child: ElevatedButton(
102+
style: ElevatedButton.styleFrom(
103+
shape: RoundedRectangleBorder(
104+
borderRadius: BorderRadius.circular(5.0),
105+
side: BorderSide(color: Theme.of(context).primaryColor),
106+
),
107+
side: BorderSide(color: Theme.of(context).primaryColor),
108+
primary: Theme.of(context).primaryColor),
107109
child: Padding(
108110
padding:
109111
const EdgeInsets.symmetric(horizontal: 28, vertical: 16),
@@ -124,12 +126,16 @@ class _AddBottomSheetState extends State<AddBottomSheet> {
124126
padding: const EdgeInsets.symmetric(
125127
vertical: 16, horizontal: 36),
126128
width: double.infinity,
127-
child: RaisedButton(
128-
shape: RoundedRectangleBorder(
129-
borderRadius: BorderRadius.circular(5.0),
130-
side: BorderSide(color: Theme.of(context).primaryColor),
131-
),
132-
color: Theme.of(context).primaryColor,
129+
child: ElevatedButton(
130+
style: ElevatedButton.styleFrom(
131+
shape: RoundedRectangleBorder(
132+
borderRadius: BorderRadius.circular(5.0),
133+
side: BorderSide(
134+
color: Theme.of(context).primaryColor),
135+
),
136+
side:
137+
BorderSide(color: Theme.of(context).primaryColor),
138+
primary: Theme.of(context).primaryColor),
133139
child: Padding(
134140
padding: const EdgeInsets.symmetric(
135141
horizontal: 28, vertical: 16),

lib/components/custom_dialog.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ class CustomDialog extends StatelessWidget {
2222
style: TextStyle(fontSize: 15),
2323
),
2424
actions: <Widget>[
25-
FlatButton(
25+
TextButton(
2626
child: Text(
2727
optionLeftText,
2828
style: TextStyle(color: Theme.of(context).accentColor),
2929
),
3030
onPressed: optionLeftOnPressed,
3131
),
32-
FlatButton(
32+
TextButton(
3333
child: Text(
3434
optionRightText,
3535
style: TextStyle(color: Theme.of(context).accentColor),

lib/components/rss_label_tile.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class _RSSLabelTileState extends State<RSSLabelTile> {
7676
showBarModalBottomSheet(
7777
expand: false,
7878
context: context,
79-
builder: (context, scrollController) {
79+
builder: (context) {
8080
return RSSDescSheet(
8181
item, widget.rssLabel.hash);
8282
});

lib/screens/configurations_screen.dart

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -220,14 +220,17 @@ class _ConfigurationsScreenState extends State<ConfigurationsScreen> {
220220
const EdgeInsets.symmetric(vertical: 16, horizontal: 32),
221221
child: Container(
222222
width: double.infinity,
223-
child: RaisedButton(
224-
shape: RoundedRectangleBorder(
225-
borderRadius: BorderRadius.circular(5.0),
226-
side: BorderSide(color: Theme.of(context).primaryColor),
223+
child: ElevatedButton(
224+
style: ElevatedButton.styleFrom(
225+
shape: RoundedRectangleBorder(
226+
borderRadius: BorderRadius.circular(5.0),
227+
side:
228+
BorderSide(color: Theme.of(context).primaryColor),
229+
),
230+
primary: Provider.of<Mode>(context).isLightMode
231+
? Colors.white
232+
: Colors.black,
227233
),
228-
color: Provider.of<Mode>(context).isLightMode
229-
? Colors.white
230-
: Colors.black,
231234
child: Padding(
232235
padding: const EdgeInsets.symmetric(
233236
horizontal: 28, vertical: 16),

lib/screens/settings_screen.dart

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -176,13 +176,15 @@ class _SettingsPageState extends State<SettingsPage> {
176176
: Container(
177177
height: 40,
178178
width: double.infinity,
179-
child: RaisedButton(
180-
color: Provider.of<Mode>(context).isLightMode
181-
? Colors.white
182-
: kGreyDT,
183-
shape: RoundedRectangleBorder(
184-
side: BorderSide(
185-
color: Theme.of(context).primaryColor),
179+
child: ElevatedButton(
180+
style: ElevatedButton.styleFrom(
181+
primary: Provider.of<Mode>(context).isLightMode
182+
? Colors.white
183+
: kGreyDT,
184+
shape: RoundedRectangleBorder(
185+
side: BorderSide(
186+
color: Theme.of(context).primaryColor),
187+
),
186188
),
187189
child: Text(
188190
'VALIDATE',

lib/screens/torrent_details_screen.dart

Lines changed: 61 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -136,62 +136,65 @@ class _TorrentDetailSheetState extends State<TorrentDetailSheet> {
136136
showLabelDialog(BuildContext context) {
137137
showDialog(
138138
context: context,
139-
child: AlertDialog(
140-
content: Form(
141-
key: _formKey,
142-
child: TextFormField(
143-
controller: _labelController,
144-
validator: (_) {
145-
if (_labelController.text != null &&
146-
_labelController.text.trim() != "") {
147-
return null;
148-
}
149-
return "Enter a valid label";
150-
},
151-
decoration: InputDecoration(
152-
border: OutlineInputBorder(
153-
borderRadius: BorderRadius.all(
154-
Radius.circular(5),
139+
builder: (BuildContext context) {
140+
return AlertDialog(
141+
content: Form(
142+
key: _formKey,
143+
child: TextFormField(
144+
controller: _labelController,
145+
validator: (_) {
146+
if (_labelController.text != null &&
147+
_labelController.text.trim() != "") {
148+
return null;
149+
}
150+
return "Enter a valid label";
151+
},
152+
decoration: InputDecoration(
153+
border: OutlineInputBorder(
154+
borderRadius: BorderRadius.all(
155+
Radius.circular(5),
156+
),
155157
),
158+
contentPadding:
159+
EdgeInsets.symmetric(horizontal: 8, vertical: 8),
160+
hintText: "Label",
156161
),
157-
contentPadding: EdgeInsets.symmetric(horizontal: 8, vertical: 8),
158-
hintText: "Label",
159162
),
160163
),
161-
),
162-
actions: [
163-
_actionButton(
164-
text: "Set Label",
164+
actions: [
165+
_actionButton(
166+
text: "Set Label",
167+
onPressed: () async {
168+
if (_formKey.currentState.validate()) {
169+
await ApiRequests.setTorrentLabel(torrent.api, torrent.hash,
170+
label: _labelController.text);
171+
Provider.of<GeneralFeatures>(context, listen: false)
172+
.changeLabel(_labelController
173+
.text); // Doing this to ensure the filter is set to the label added
174+
Navigator.pop(context);
175+
Navigator.pop(context);
176+
Fluttertoast.showToast(msg: "Label set");
177+
}
178+
}),
179+
_actionButton(
180+
text: "Remove Label",
165181
onPressed: () async {
166-
if (_formKey.currentState.validate()) {
167-
await ApiRequests.setTorrentLabel(torrent.api, torrent.hash,
168-
label: _labelController.text);
169-
Provider.of<GeneralFeatures>(context, listen: false)
170-
.changeLabel(_labelController
171-
.text); // Doing this to ensure the filter is set to the label added
172-
Navigator.pop(context);
173-
Navigator.pop(context);
174-
Fluttertoast.showToast(msg: "Label set");
175-
}
176-
}),
177-
_actionButton(
178-
text: "Remove Label",
179-
onPressed: () async {
180-
await ApiRequests.removeTorrentLabel(
181-
torrent.api,
182-
torrent.hash,
183-
);
184-
_labelController.text = "";
185-
Provider.of<GeneralFeatures>(context, listen: false).changeFilter(
186-
Filter
187-
.All); // Doing this to ensure that a empty torrent list page is not shown to the user
188-
Navigator.pop(context);
189-
Navigator.pop(context);
190-
Fluttertoast.showToast(msg: "Label removed");
191-
},
192-
)
193-
],
194-
),
182+
await ApiRequests.removeTorrentLabel(
183+
torrent.api,
184+
torrent.hash,
185+
);
186+
_labelController.text = "";
187+
Provider.of<GeneralFeatures>(context, listen: false)
188+
.changeFilter(Filter
189+
.All); // Doing this to ensure that a empty torrent list page is not shown to the user
190+
Navigator.pop(context);
191+
Navigator.pop(context);
192+
Fluttertoast.showToast(msg: "Label removed");
193+
},
194+
)
195+
],
196+
);
197+
},
195198
);
196199
}
197200

@@ -699,12 +702,14 @@ class _TorrentDetailSheetState extends State<TorrentDetailSheet> {
699702

700703
/// Action Button for set and remove label dialog
701704
Widget _actionButton({String text, Function onPressed}) {
702-
return RaisedButton(
703-
shape: RoundedRectangleBorder(
704-
borderRadius: BorderRadius.circular(5.0),
705-
side: BorderSide(color: Theme.of(context).primaryColor),
705+
return ElevatedButton(
706+
style: ElevatedButton.styleFrom(
707+
shape: RoundedRectangleBorder(
708+
borderRadius: BorderRadius.circular(5.0),
709+
side: BorderSide(color: Theme.of(context).primaryColor),
710+
),
711+
primary: Theme.of(context).primaryColor,
706712
),
707-
color: Theme.of(context).primaryColor,
708713
child: Text(
709714
text,
710715
),

0 commit comments

Comments
 (0)