Commit b75a9279 authored by DatHV's avatar DatHV
Browse files

update config, build.

parent 36ac8d24
import 'package:auto_size_text/auto_size_text.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import '../screen/home/header_home_viewmodel.dart'; import '../screen/home/header_home_viewmodel.dart';
...@@ -62,21 +63,34 @@ class CustomNavigationBar extends StatelessWidget implements PreferredSizeWidget ...@@ -62,21 +63,34 @@ class CustomNavigationBar extends StatelessWidget implements PreferredSizeWidget
children: [ children: [
Padding( Padding(
padding: EdgeInsets.symmetric(horizontal: paddingTitle), padding: EdgeInsets.symmetric(horizontal: paddingTitle),
child: FittedBox( child: AutoSizeText(
fit: BoxFit.scaleDown, // tự giảm font để vừa khung title,
child: Text( maxLines: 1,
title, minFontSize: 12, // 👈 không nhỏ hơn 8
maxLines: 1, stepGranularity: 0.1, // scale mượt hơn
softWrap: false, overflow: TextOverflow.visible, // giữ nguyên như bạn đang dùng
overflow: TextOverflow.visible, // không dùng ellipsis textAlign: TextAlign.center,
textAlign: TextAlign.center, style: const TextStyle(
style: const TextStyle( fontSize: 18, // 👈 cỡ tối đa mong muốn
fontSize: 18, // cỡ tối đa fontWeight: FontWeight.w800,
fontWeight: FontWeight.w800, color: Colors.white,
color: Colors.white,
),
), ),
), ),
// child: FittedBox(
// fit: BoxFit.scaleDown, // tự giảm font để vừa khung
// child: Text(
// title,
// maxLines: 1,
// softWrap: false,
// overflow: TextOverflow.visible, // không dùng ellipsis
// textAlign: TextAlign.center,
// style: const TextStyle(
// fontSize: 18, // cỡ tối đa
// fontWeight: FontWeight.w800,
// color: Colors.white,
// ),
// ),
// ),
), ),
// Text( // Text(
// title, // title,
......
...@@ -71,6 +71,7 @@ dependencies: ...@@ -71,6 +71,7 @@ dependencies:
firebase_core: ^4.1.0 firebase_core: ^4.1.0
firebase_messaging: ^16.0.1 firebase_messaging: ^16.0.1
flutter_local_notifications: ^19.4.2 flutter_local_notifications: ^19.4.2
auto_size_text: ^3.0.0
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment