feat: custom appbar
This commit is contained in:
@@ -1,12 +1,10 @@
|
||||
import 'dart:math' as math;
|
||||
|
||||
import 'package:auto_route/auto_route.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:line_icons/line_icons.dart';
|
||||
|
||||
import '../../../common/theme/theme.dart';
|
||||
import '../../components/appbar/appbar.dart';
|
||||
import '../../components/button/button.dart';
|
||||
import 'widgets/appbar.dart';
|
||||
import 'widgets/category_delegate.dart';
|
||||
import 'widgets/product_tile.dart';
|
||||
|
||||
@@ -26,10 +24,6 @@ class _ProductPageState extends State<ProductPage>
|
||||
List<String> categories = ['Semua', 'Makanan', 'Minuman', 'Snack', 'Dessert'];
|
||||
ViewType currentViewType = ViewType.grid;
|
||||
|
||||
// Animation
|
||||
late AnimationController _rotationController;
|
||||
late Animation<double> _rotationAnimation;
|
||||
|
||||
// Sample product data
|
||||
List<Product> products = [
|
||||
Product(
|
||||
@@ -135,19 +129,10 @@ class _ProductPageState extends State<ProductPage>
|
||||
@override
|
||||
initState() {
|
||||
super.initState();
|
||||
_rotationController = AnimationController(
|
||||
duration: const Duration(seconds: 3),
|
||||
vsync: this,
|
||||
)..repeat();
|
||||
_rotationAnimation = Tween<double>(
|
||||
begin: 0,
|
||||
end: 2 * math.pi,
|
||||
).animate(_rotationController);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_rotationController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@@ -172,7 +157,7 @@ class _ProductPageState extends State<ProductPage>
|
||||
floating: false,
|
||||
pinned: true,
|
||||
elevation: 0,
|
||||
flexibleSpace: ProductAppbar(rotationAnimation: _rotationAnimation),
|
||||
flexibleSpace: CustomAppBar(title: 'Produk'),
|
||||
actions: [
|
||||
ActionIconButton(onTap: () {}, icon: LineIcons.search),
|
||||
ActionIconButton(onTap: _showAddProductDialog, icon: LineIcons.plus),
|
||||
|
||||
Reference in New Issue
Block a user