| 123456789101112131415161718192021222324252627 |
- import 'package:flutter/cupertino.dart';
- import 'package:flutter/material.dart';
- import 'package:twong/config/style.dart';
- class DAppBar extends StatelessWidget implements PreferredSizeWidget {
- final String title;
- final bool autoLeading;
- final List<Widget> actions;
- DAppBar(this.title, { this.autoLeading = true, this.actions });
- @override
- Widget build(BuildContext context) {
- return PreferredSize(
- preferredSize: preferredSize,
- child: AppBar(
- centerTitle: true,
- automaticallyImplyLeading: autoLeading,
- title: Text(title, style: DText.appBar),
- backgroundColor: DColors.Main,
- actions: actions,
- ),
- );
- }
- Size get preferredSize => DStyle.appBarHeight;
- }
|