Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions lib/theme/app_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class AppTheme {
),
primaryColor: kBluePrimaryLT,
disabledColor: kGreyLT,
toggleableActiveColor: kIndigoSecondaryLT,
colorScheme:
ColorScheme.fromSwatch().copyWith(secondary: kIndigoSecondaryLT),
);
Expand All @@ -23,7 +22,6 @@ class AppTheme {
),
primaryColor: kPrimaryDT,
disabledColor: kGreyDT,
toggleableActiveColor: kSecondaryDT,
colorScheme: ColorScheme.fromSwatch().copyWith(secondary: kSecondaryDT),
);
}
4 changes: 2 additions & 2 deletions lib/ui/shared/shared_styles.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ BoxDecoration kdecoration = BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
color: Colors.grey.withValues(alpha: 0.5),
spreadRadius: 5,
blurRadius: 7,
offset: Offset(0, 3), // changes position of shadow
Expand All @@ -56,7 +56,7 @@ BoxDecoration mdecoration = BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
color: Colors.grey.withValues(alpha: 0.5),
spreadRadius: 2,
blurRadius: 3,
offset: Offset(0, 3), // changes position of shadow
Expand Down
9 changes: 7 additions & 2 deletions lib/ui/views/Download/download_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,13 @@ class DownloadView extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ViewModelBuilder<DownloadViewModel>.reactive(
builder: (context, model, child) => WillPopScope(
onWillPop: model.onBackPress,
builder: (context, model, child) => PopScope(
canPop: false,
onPopInvokedWithResult: (bool didPop, dynamic result) async {
if (didPop) return;
final shouldPop = await model.onBackPress();
if (shouldPop && context.mounted) Navigator.of(context).pop();
},
child: Scaffold(
body: Container(
child: Column(
Expand Down
12 changes: 6 additions & 6 deletions lib/ui/views/IRSSI/IRSSI_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Logger log = getLogger("IRSSIView");
class IRSSIView extends StatelessWidget {
@override
Widget build(BuildContext context) {
var subtitle1 = Theme.of(context).textTheme.subtitle1?.copyWith(
var subtitle1 = Theme.of(context).textTheme.titleMedium?.copyWith(
fontSize: 15,
color: (AppStateNotifier.isDarkModeOn) ? Colors.white : Colors.black,
);
Expand Down Expand Up @@ -190,18 +190,18 @@ class IRSSIView extends StatelessWidget {
ElevatedButton.styleFrom(
textStyle: Theme.of(context)
.textTheme
.button
.labelLarge
?.copyWith(
color:
Colors.white),
primary: model
backgroundColor: model
.irssiButton ==
IrssiButtons.none
? Colors.grey
: Theme.of(context)
.primaryColor,
padding: const EdgeInsets
.symmetric(
.symmetric(
horizontal: 20.0,
vertical: 5),
shape:
Expand All @@ -218,7 +218,7 @@ class IRSSIView extends StatelessWidget {
: "Refresh",
style: Theme.of(context)
.textTheme
.button
.labelLarge
?.copyWith(
color:
Colors.white),
Expand Down Expand Up @@ -254,7 +254,7 @@ class IRSSIView extends StatelessWidget {
index];
var subtitle1 = Theme.of(context)
.textTheme
.subtitle1
.titleMedium
?.copyWith(
fontSize: 15,
color: (AppStateNotifier
Expand Down
9 changes: 7 additions & 2 deletions lib/ui/views/disk_explorer/disk_explorer_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@ class DiskExplorerView extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ViewModelBuilder<DiskExplorerViewModel>.reactive(
builder: (context, model, child) => WillPopScope(
onWillPop: model.onBackPress,
builder: (context, model, child) => PopScope(
canPop: false,
onPopInvokedWithResult: (bool didPop, dynamic result) async {
if (didPop) return;
final shouldPop = await model.onBackPress();
if (shouldPop && context.mounted) Navigator.of(context).pop();
},
child: Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).primaryColor,
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/views/login/login_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class LoginView extends StatelessWidget {
side: BorderSide(
color: Theme.of(context).primaryColor),
),
primary: !AppStateNotifier.isDarkModeOn
backgroundColor: !AppStateNotifier.isDarkModeOn
? Colors.white
: Colors.black),
child: Padding(
Expand Down
3 changes: 2 additions & 1 deletion lib/ui/views/media_player/media_stream_viewmodel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ class MediaStreamViewModel extends BaseViewModel {
}

Future<void> initializePlayer() async {
_videoPlayerController = VideoPlayerController.network(_mediaUrl);
_videoPlayerController =
VideoPlayerController.networkUrl(Uri.parse(_mediaUrl));
Comment thread
coderabbitai[bot] marked this conversation as resolved.
await Future.wait([
_videoPlayerController.initialize(),
]);
Expand Down
4 changes: 2 additions & 2 deletions lib/ui/widgets/dumb_widgets/document_type_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class DocumentTypeCard extends StatelessWidget {

@override
Widget build(BuildContext context) {
var subtitle1 = Theme.of(context).textTheme.subtitle1?.copyWith(
var subtitle1 = Theme.of(context).textTheme.titleMedium?.copyWith(
fontSize: 16,
color: (isSelected) ? Colors.white : Colors.black,
);
Expand All @@ -31,7 +31,7 @@ class DocumentTypeCard extends StatelessWidget {
borderRadius: BorderRadius.circular(10),
color: isSelected
? Theme.of(context).primaryColor
: Theme.of(context).colorScheme.background,
: Theme.of(context).colorScheme.surface,
),
width: App(context).appWidth(0.4),
child: Row(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class _PasswordChangeDialogState extends State<PasswordChangeDialog> {
width: double.infinity,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
primary: !AppStateNotifier.isDarkModeOn
backgroundColor: !AppStateNotifier.isDarkModeOn
? Colors.white
: kGreyDT,
shape: RoundedRectangleBorder(
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/widgets/dumb_widgets/torrent_label_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class TorrentLabelDialog extends StatelessWidget {
borderRadius: BorderRadius.circular(5.0),
side: BorderSide(color: Theme.of(context).primaryColor),
),
primary: Theme.of(context).primaryColor,
backgroundColor: Theme.of(context).primaryColor,
),
child: Text(
text,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// ignore_for_file: deprecated_member_use

import 'package:flutter/material.dart';
import 'package:rutorrentflutter/app/app.locator.dart';
import 'package:rutorrentflutter/enums/bottom_sheet_type.dart';
Expand Down Expand Up @@ -85,15 +83,17 @@ class _FloatingBoxBottomSheet extends StatelessWidget {
fontWeight: FontWeight.bold),
),
),
FlatButton(
TextButton(
onPressed: () =>
model.response(completer, textFieldController1.text),
style: TextButton.styleFrom(
backgroundColor: Theme.of(context).primaryColor,
),
child: Text(
request.mainButtonTitle!,
style: TextStyle(
color: Colors.white, fontWeight: FontWeight.bold),
),
color: Theme.of(context).primaryColor,
)
],
)
Expand Down Expand Up @@ -124,7 +124,7 @@ class BottomSheetViewModel extends BaseViewModel {
errorText = "Maximum limit of 250 characters exceeded";
} else {
func(
SheetResponse(confirmed: true, responseData: responseText),
SheetResponse(confirmed: true, data: responseText),
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,15 @@ class ConfirmBottomSheetView extends StatelessWidget {
style: TextStyle(color: Theme.of(context).primaryColor),
),
),
// ignore: deprecated_member_use
FlatButton(
TextButton(
onPressed: () => completer(SheetResponse(confirmed: true)),
style: TextButton.styleFrom(
backgroundColor: Theme.of(context).primaryColor,
),
child: Text(
request.mainButtonTitle!,
style: TextStyle(color: Colors.white),
),
color: Theme.of(context).primaryColor,
)
],
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,18 @@ class SortBottomSheetView extends StatelessWidget {
final SheetRequest request;
final Function(SheetResponse) completer;
final Screens screen;
SortBottomSheetView(
{required this.request, required this.completer, required this.screen});

SortBottomSheetView({
required this.request,
required this.completer,
required this.screen,
});

@override
Widget build(BuildContext context) {
return ViewModelBuilder<SortBottomSheetViewModel>.reactive(
onModelReady: (model) => model.init(screen),
viewModelBuilder: () => SortBottomSheetViewModel(),
builder: (context, model, child) => Padding(
padding: const EdgeInsets.only(
left: 16.0,
Expand All @@ -33,14 +38,13 @@ class SortBottomSheetView extends StatelessWidget {
children: [
Text(
'SORT BY',
style: TextStyle(
fontSize: 18,
),
style: TextStyle(fontSize: 18),
),
Spacer(),
TextButton(
style: ButtonStyle(
tapTargetSize: MaterialTapTargetSize.shrinkWrap),
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
),
onPressed: () {
model.setSortPreference(completer, Sort.values.last);
Navigator.of(context).pop();
Expand All @@ -57,50 +61,53 @@ class SortBottomSheetView extends StatelessWidget {
),
],
),
Divider(
thickness: 2,
),
Container(
height: 300,
child: ListView.builder(
itemCount: Sort.values.length - 1,
itemBuilder: (context, index) {
Map<Sort, String> sortMap = model.getSortMap();
return sortMap[Sort.values[index]] == null
? Container()
: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
model.setSortPreference(
completer, Sort.values[index]);
Navigator.of(context).pop();
},
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
sortMap[Sort.values[index]]!,
style: TextStyle(fontWeight: FontWeight.w600),
),
Radio(
groupValue: model.sortPreference,
value: Sort.values[index],
onChanged: (selected) {
model.setSortPreference(
completer, Sort.values[index]);
Navigator.of(context).pop();
},
),
],
Divider(thickness: 2),
RadioGroup<Sort>(
groupValue: model.sortPreference,
onChanged: (selected) {
if (selected == null) return;
model.setSortPreference(completer, selected);
Navigator.of(context).pop();
},
child: SizedBox(
height: 300,
child: ListView.builder(
itemCount: Sort.values.length - 1,
itemBuilder: (context, index) {
final sortMap = model.getSortMap();
final sortValue = Sort.values[index];
final label = sortMap[sortValue];

if (label == null) return SizedBox.shrink();

return InkWell(
onTap: () {
model.setSortPreference(completer, sortValue);
Navigator.of(context).pop();
},
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: const EdgeInsets.symmetric(vertical: 12.0),
child: Text(
label,
style: TextStyle(fontWeight: FontWeight.w600),
),
),
Radio<Sort>(
value: sortValue,
),
);
},
],
),
);
},
),
),
Comment thread
coderabbitai[bot] marked this conversation as resolved.
)
),
],
),
),
viewModelBuilder: () => SortBottomSheetViewModel(),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class URLBottomSheetView extends StatelessWidget {
side: BorderSide(color: Theme.of(context).primaryColor),
),
side: BorderSide(color: Theme.of(context).primaryColor),
primary: Theme.of(context).primaryColor),
backgroundColor: Theme.of(context).primaryColor),
child: Padding(
padding:
const EdgeInsets.symmetric(horizontal: 28, vertical: 16),
Expand Down Expand Up @@ -107,7 +107,7 @@ class URLBottomSheetView extends StatelessWidget {
BorderSide(color: Theme.of(context).primaryColor),
),
side: BorderSide(color: Theme.of(context).primaryColor),
primary: Theme.of(context).primaryColor),
backgroundColor: Theme.of(context).primaryColor),
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 28, vertical: 16),
Expand Down
Loading