Skip to content

Commit

Permalink
fix deprecation and warning
Browse files Browse the repository at this point in the history
  • Loading branch information
maheshj01 committed May 15, 2024
1 parent eeb0344 commit 4462d26
Show file tree
Hide file tree
Showing 16 changed files with 367 additions and 376 deletions.
6 changes: 3 additions & 3 deletions lib/base_home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class _AdaptiveLayoutState extends ConsumerState<AdaptiveLayout> {
},
};
final colorScheme = Theme.of(context).colorScheme;
final selectedColor = colorScheme.surfaceTint;
final selectedColor = colorScheme.primary;
List<NavbarItem> items = [
NavbarItem(Icons.dashboard_outlined, 'Dashboard',
selectedIcon: Icon(Icons.dashboard, color: selectedColor, size: 26)),
Expand Down Expand Up @@ -297,11 +297,11 @@ class _AdaptiveLayoutState extends ConsumerState<AdaptiveLayout> {
height: kNavbarHeight * 1.2,
backgroundColor: SizeUtils.isDesktop
? colorScheme.surfaceContainerHighest
: colorScheme.scrim.withOpacity(0.2),
: colorScheme.secondaryContainer,
margin: EdgeInsets.zero,
showSelectedLabels: false,
borderRadius: BorderRadius.zero,
// backgroundColor: (colorScheme.surfaceVariant.withOpacity(0.4)),
// backgroundColor: (colorScheme.surfaceContainerHighest.withOpacity(0.4)),
),
destinations: [
for (int i = 0; i < items.length; i++)
Expand Down
6 changes: 3 additions & 3 deletions lib/controller/collections_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class CollectionsNotifier extends ChangeNotifier implements ServiceBase {

Future<void> addCollection(VHCollection collection) async {
// await _collectionService.addCollection(collectionName);
int index = _collections.indexOfCollection(collection.title);
final int index = _collections.indexOfCollection(collection.title);
if (index != -1) {
showToast('Collection already exists');
} else {
Expand All @@ -68,7 +68,7 @@ class CollectionsNotifier extends ChangeNotifier implements ServiceBase {

Future<void> deleteCollection(String collectionName) async {
// await _collectionService.deleteCollection(collectionName);
int index = collections.indexOfCollection(collectionName);
final int index = collections.indexOfCollection(collectionName);
if (index != -1) {
_collections.removeAt(index);
showToast('Collection deleted');
Expand All @@ -81,7 +81,7 @@ class CollectionsNotifier extends ChangeNotifier implements ServiceBase {

Future<void> togglePin(String title) async {
// await _collectionService.togglePin(title);
int index = collections.indexOfCollection(title);
final int index = collections.indexOfCollection(title);
if (index != -1) {
_collections[index].isPinned = !collections[index].isPinned;
showToast(
Expand Down
45 changes: 16 additions & 29 deletions lib/navbar/dashboard/bookmarks.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'dart:ui';

import 'package:animations/animations.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
Expand Down Expand Up @@ -132,10 +130,12 @@ class WordListBuilder extends ConsumerWidget {
openElevation: 0,
openShape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
side: BorderSide(color: Theme.of(context).colorScheme.surfaceVariant, width: 1)),
side: BorderSide(
color: Theme.of(context).colorScheme.surfaceContainerHighest, width: 1)),
closedShape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
side: BorderSide(color: Theme.of(context).colorScheme.surfaceVariant, width: 1)),
side: BorderSide(
color: Theme.of(context).colorScheme.surfaceContainerHighest, width: 1)),
openBuilder: (BuildContext context, VoidCallback openContainer) {
return WordDetail(word: words[index]);
},
Expand Down Expand Up @@ -211,26 +211,7 @@ class WordListPageMobile extends StatelessWidget {

@override
Widget build(BuildContext context) {
final colorScheme = Theme.of(context).colorScheme;
return Stack(
children: [
CustomPaint(
painter: BackgroundPainter(
primaryColor: colorScheme.primary,
secondaryColor: colorScheme.inversePrimary,
// animation: AlwaysStoppedAnimation(0.0),
),
child: Container(),
),
BackdropFilter(filter: ImageFilter.blur(sigmaX: 60, sigmaY: 60), child: Container()),
Scaffold(
backgroundColor: Colors.transparent,
appBar: AppBar(
backgroundColor: Colors.transparent,
elevation: 15,
title: Text('$title'),
),
body: ListView.builder(
final body = ListView.builder(
itemCount: words.length,
padding: EdgeInsets.only(top: 16, bottom: kNotchedNavbarHeight * 1.5),
itemBuilder: (context, index) {
Expand All @@ -246,7 +227,7 @@ class WordListPageMobile extends StatelessWidget {
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
side: BorderSide(
color: Theme.of(context).colorScheme.surfaceVariant, width: 1)),
color: Theme.of(context).colorScheme.surfaceContainerHighest, width: 1)),
trailing: hasTrailing!
? IconButton(
icon: Icon(
Expand All @@ -259,10 +240,16 @@ class WordListPageMobile extends StatelessWidget {
: null,
));
},
),
),
],
);

return Scaffold(
backgroundColor: Colors.transparent,
appBar: AppBar(
backgroundColor: Colors.transparent,
elevation: 15,
title: Text('$title'),
),
body: body);
}
}

Expand Down Expand Up @@ -306,7 +293,7 @@ class _BookmarksDesktopState extends State<_BookmarksDesktop> {
builder: (_, List<Word>? value, Widget? child) {
if (value == null) {
return Scaffold(
backgroundColor: Theme.of(context).colorScheme.surfaceVariant,
backgroundColor: Theme.of(context).colorScheme.surfaceContainerHighest,
appBar: AppBar(title: Text('$title')),
body: LoadingWidget());
}
Expand Down
5 changes: 2 additions & 3 deletions lib/navbar/dashboard/dashboard.dart
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ class _DashboardCollectionsState extends ConsumerState<DashboardCollections> {
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [colorScheme.background, colorScheme.surfaceVariant]),
colors: [colorScheme.surface, colorScheme.surfaceContainerHighest]),
border: Border.all(color: colorScheme.surfaceTint, width: 1.0),
borderRadius: BorderRadius.circular(16.0)),

Expand Down Expand Up @@ -530,9 +530,8 @@ class DashboardDesktop extends ConsumerWidget {
final colorScheme = Theme.of(context).colorScheme;
final word = dashboardController.wordOfTheDay;
final user = ref.watch(userNotifierProvider);
final size = MediaQuery.of(context).size;
return Scaffold(
backgroundColor: colorScheme.background,
backgroundColor: colorScheme.surface,
body: Padding(
padding: 16.0.horizontalPadding,
child: Row(
Expand Down
2 changes: 1 addition & 1 deletion lib/navbar/profile/report.dart
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ class _ViewReportsByUserMobileState extends State<ViewReportsByUserMobile> {
),
);
}
List<ReportModel> reports = request.data as List<ReportModel>;
final List<ReportModel> reports = request.data as List<ReportModel>;
if (reports.isEmpty) {
return const Center(
child: Text('No reports yet'),
Expand Down
Loading

0 comments on commit 4462d26

Please sign in to comment.