fixed things that were fucked up by pub upgrade

This commit is contained in:
Kima 2023-12-09 17:23:21 +01:00
parent 9f5e57eec6
commit 56500406e5
4 changed files with 38 additions and 25 deletions

View File

@ -1,7 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" package="hu.refilc.naplo"> xmlns:tools="http://schemas.android.com/tools" package="hu.refilc.naplo">
<application android:name="${applicationName}" android:label="reFilc" tools:replace="android:label" android:icon="@mipmap/ic_launcher" <application android:name="${applicationName}" android:label="reFilc" tools:replace="android:label" android:icon="@mipmap/ic_launcher"
android:requestLegacyExternalStorage="true"> android:requestLegacyExternalStorage="true" android:enableOnBackInvokedCallback="true">
<activity android:exported="true" android:name="hu.refilc.naplo.MainActivity" <activity android:exported="true" android:name="hu.refilc.naplo.MainActivity"
android:launchMode="singleTop" android:theme="@style/LaunchTheme" android:launchMode="singleTop" android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"

View File

@ -17,7 +17,8 @@ import 'package:flutter_local_notifications/flutter_local_notifications.dart';
void main() async { void main() async {
// Initalize // Initalize
WidgetsBinding binding = WidgetsFlutterBinding.ensureInitialized(); WidgetsBinding binding = WidgetsFlutterBinding.ensureInitialized();
binding.renderViews.first.automaticSystemUiAdjustment = false; // ignore: deprecated_member_use
binding.renderView.automaticSystemUiAdjustment = false;
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
// Startup // Startup
Startup startup = Startup(); Startup startup = Startup();

View File

@ -13,7 +13,8 @@ class FilterBar extends StatefulWidget implements PreferredSizeWidget {
this.disableFading = false, this.disableFading = false,
this.scrollable = true, this.scrollable = true,
this.censored = false, this.censored = false,
}) : assert(items.length == controller.length); this.tabAlignment = TabAlignment.start,
}) : assert(items.length == controller.length);
final List<Widget> items; final List<Widget> items;
final TabController controller; final TabController controller;
@ -22,6 +23,7 @@ class FilterBar extends StatefulWidget implements PreferredSizeWidget {
final bool disableFading; final bool disableFading;
final bool scrollable; final bool scrollable;
final bool censored; final bool censored;
final TabAlignment tabAlignment;
@override @override
final Size preferredSize = const Size.fromHeight(42.0); final Size preferredSize = const Size.fromHeight(42.0);
@ -36,7 +38,9 @@ class _FilterBarState extends State<FilterBar> {
void initState() { void initState() {
super.initState(); super.initState();
censoredItemsWidth = List.generate(widget.items.length, (index) => 25 + Random().nextDouble() * 50).toList(); censoredItemsWidth = List.generate(
widget.items.length, (index) => 25 + Random().nextDouble() * 50)
.toList();
} }
@override @override
@ -66,18 +70,21 @@ class _FilterBarState extends State<FilterBar> {
tabs: widget.censored tabs: widget.censored
? censoredItemsWidth ? censoredItemsWidth
.map( .map(
(e) => Container( (e) => Tab(
width: e, child: Container(
height: 15, width: e,
decoration: BoxDecoration( height: 15,
color: AppColors.of(context).text.withOpacity(.45), decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.0), color: AppColors.of(context).text.withOpacity(.45),
borderRadius: BorderRadius.circular(8.0),
),
), ),
), ),
) )
.toList() .toList()
: widget.items, : widget.items,
onTap: widget.onTap, onTap: widget.onTap,
tabAlignment: widget.tabAlignment,
); );
return Container( return Container(
@ -92,19 +99,26 @@ class _FilterBarState extends State<FilterBar> {
// avoid fading over selected tab // avoid fading over selected tab
return ShaderMask( return ShaderMask(
shaderCallback: (Rect bounds) { shaderCallback: (Rect bounds) {
final Color bg = Theme.of(context).scaffoldBackgroundColor; final Color bg =
Theme.of(context).scaffoldBackgroundColor;
final double index = widget.controller.animation!.value; final double index = widget.controller.animation!.value;
return LinearGradient(begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [ return LinearGradient(
index < 0.2 ? Colors.transparent : bg, begin: Alignment.topLeft,
Colors.transparent, end: Alignment.bottomRight,
Colors.transparent, colors: [
index > widget.controller.length - 1.2 ? Colors.transparent : bg index < 0.2 ? Colors.transparent : bg,
], stops: const [ Colors.transparent,
0, Colors.transparent,
0.1, index > widget.controller.length - 1.2
0.9, ? Colors.transparent
1 : bg
]).createShader(bounds); ],
stops: const [
0,
0.1,
0.9,
1
]).createShader(bounds);
}, },
blendMode: BlendMode.dstOut, blendMode: BlendMode.dstOut,
child: child); child: child);

View File

@ -229,11 +229,9 @@ class _GradeSubjectViewState extends State<GradeSubjectView> {
.where((e) => e.type == GradeType.midYear) .where((e) => e.type == GradeType.midYear)
.isNotEmpty, .isNotEmpty,
child: ExpandableFab( child: ExpandableFab(
overlayStyle: ExpandableFabOverlayStyle(
color: Theme.of(context).colorScheme.secondary,
),
type: ExpandableFabType.up, type: ExpandableFabType.up,
distance: 50, distance: 50,
childrenOffset: const Offset(-3.8, 0.0),
children: [ children: [
FloatingActionButton.small( FloatingActionButton.small(
heroTag: "btn_ghost_grades", heroTag: "btn_ghost_grades",