add pagination for pages
This commit is contained in:
53
lib/pages/widgets/local_app_bar.dart
Normal file
53
lib/pages/widgets/local_app_bar.dart
Normal file
@@ -0,0 +1,53 @@
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'local_text.dart';
|
||||
|
||||
class LocalAppBar extends StatelessWidget implements PreferredSizeWidget {
|
||||
final String? labelKey;
|
||||
final Color? backgroundColor;
|
||||
final Color? labelColor;
|
||||
final Color? arrowColor;
|
||||
final List<Widget>? actions;
|
||||
final Widget? titleWidget;
|
||||
final Function()? onBack;
|
||||
|
||||
const LocalAppBar(
|
||||
{Key? key,
|
||||
this.labelKey,
|
||||
this.backgroundColor = primaryColor,
|
||||
this.labelColor,
|
||||
this.arrowColor = Colors.white,
|
||||
this.actions,
|
||||
this.titleWidget,
|
||||
this.onBack})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
Size get preferredSize => const Size.fromHeight(56);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppBar(
|
||||
elevation: 0,
|
||||
centerTitle: true,
|
||||
leading: IconButton(
|
||||
icon: Icon(CupertinoIcons.back, color: arrowColor, size: 25),
|
||||
onPressed: onBack),
|
||||
shadowColor: Colors.transparent,
|
||||
backgroundColor: backgroundColor,
|
||||
surfaceTintColor: backgroundColor,
|
||||
title: titleWidget ??
|
||||
(labelKey != null
|
||||
? LocalText(
|
||||
context,
|
||||
labelKey!,
|
||||
color: Colors.white,
|
||||
fontSize: 20,
|
||||
)
|
||||
: const SizedBox()),
|
||||
actions: actions,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:fcs/helpers/theme.dart' as theme;
|
||||
|
||||
class NumberCell extends StatelessWidget {
|
||||
final int number;
|
||||
final numberFormatter;
|
||||
final TextStyle? textStyle;
|
||||
|
||||
NumberCell(this.number, {Key? key, this.textStyle})
|
||||
: numberFormatter = new NumberFormat("#,###"),
|
||||
super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return new Text(numberFormatter.format(this.number),
|
||||
style: textStyle == null ? theme.textStyle : textStyle);
|
||||
}
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'callbacks.dart';
|
||||
|
||||
class TitleWithAddButton extends StatelessWidget {
|
||||
final IconData? iconData;
|
||||
final String? titleKey;
|
||||
final OnTap? onTap;
|
||||
|
||||
const TitleWithAddButton({Key? key, this.iconData, this.titleKey, this.onTap})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Row(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 15.0),
|
||||
child: Icon(
|
||||
this.iconData,
|
||||
color: primaryColor,
|
||||
),
|
||||
),
|
||||
LocalText(
|
||||
context,
|
||||
titleKey!,
|
||||
color: Colors.black54,
|
||||
fontSize: 20,
|
||||
)
|
||||
],
|
||||
),
|
||||
Spacer(),
|
||||
onTap == null
|
||||
? Container()
|
||||
: Padding(
|
||||
padding: const EdgeInsets.only(right: 0),
|
||||
child: IconButton(
|
||||
onPressed: () => onTap!(),
|
||||
icon: Icon(
|
||||
Icons.add_circle,
|
||||
color: primaryColor,
|
||||
)),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user