feat: custom appbar
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
import 'package:auto_route/auto_route.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:line_icons/line_icons.dart';
|
||||
import 'dart:math' as math;
|
||||
|
||||
import '../../../common/theme/theme.dart';
|
||||
import '../../components/appbar/appbar.dart';
|
||||
import '../../components/button/button.dart';
|
||||
import 'widgets/appbar.dart';
|
||||
import 'widgets/customer_card.dart';
|
||||
import 'widgets/customer_tile.dart';
|
||||
|
||||
@@ -102,27 +101,14 @@ class _CustomerPageState extends State<CustomerPage>
|
||||
),
|
||||
];
|
||||
|
||||
// Animation
|
||||
late AnimationController _rotationController;
|
||||
late Animation<double> _rotationAnimation;
|
||||
|
||||
@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() {
|
||||
_searchController.dispose();
|
||||
_rotationController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@@ -151,9 +137,7 @@ class _CustomerPageState extends State<CustomerPage>
|
||||
floating: false,
|
||||
pinned: true,
|
||||
backgroundColor: AppColor.primary,
|
||||
flexibleSpace: CustomerAppbar(
|
||||
rotationAnimation: _rotationAnimation,
|
||||
),
|
||||
flexibleSpace: CustomAppBar(title: 'Pelanggan'),
|
||||
actions: [ActionIconButton(onTap: () {}, icon: LineIcons.search)],
|
||||
),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user