feat: custom appbar
This commit is contained in:
@@ -2,7 +2,7 @@ import 'package:auto_route/auto_route.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../common/theme/theme.dart';
|
||||
import 'widgets/appbar.dart';
|
||||
import '../../components/appbar/appbar.dart';
|
||||
import 'widgets/ingredient_tile.dart';
|
||||
import 'widgets/product_tile.dart';
|
||||
import 'widgets/stat_card.dart';
|
||||
@@ -64,10 +64,8 @@ class _InventoryPageState extends State<InventoryPage>
|
||||
with TickerProviderStateMixin {
|
||||
late AnimationController _fadeAnimationController;
|
||||
late AnimationController _slideAnimationController;
|
||||
late AnimationController _rotationAnimationController;
|
||||
late Animation<double> _fadeAnimation;
|
||||
late Animation<Offset> _slideAnimation;
|
||||
late Animation<double> rotationAnimation;
|
||||
late TabController _tabController;
|
||||
|
||||
final List<ProductItem> productItems = [
|
||||
@@ -188,10 +186,6 @@ class _InventoryPageState extends State<InventoryPage>
|
||||
duration: const Duration(milliseconds: 800),
|
||||
vsync: this,
|
||||
);
|
||||
_rotationAnimationController = AnimationController(
|
||||
duration: const Duration(seconds: 20),
|
||||
vsync: this,
|
||||
);
|
||||
|
||||
_fadeAnimation = Tween<double>(begin: 0.0, end: 1.0).animate(
|
||||
CurvedAnimation(
|
||||
@@ -208,21 +202,14 @@ class _InventoryPageState extends State<InventoryPage>
|
||||
),
|
||||
);
|
||||
|
||||
rotationAnimation = Tween<double>(
|
||||
begin: 0.0,
|
||||
end: 2 * 3.14159,
|
||||
).animate(_rotationAnimationController);
|
||||
|
||||
_fadeAnimationController.forward();
|
||||
_slideAnimationController.forward();
|
||||
_rotationAnimationController.repeat();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_fadeAnimationController.dispose();
|
||||
_slideAnimationController.dispose();
|
||||
_rotationAnimationController.dispose();
|
||||
_tabController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
@@ -356,7 +343,7 @@ class _InventoryPageState extends State<InventoryPage>
|
||||
pinned: true,
|
||||
elevation: 0,
|
||||
backgroundColor: AppColor.primary,
|
||||
flexibleSpace: InventoryAppBar(rotationAnimation: rotationAnimation),
|
||||
flexibleSpace: CustomAppBar(title: 'Inventaris'),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user