diff --git a/assets/images/ic_add_book.png b/assets/images/ic_add_book.png index 1a86dc6..9f8b59c 100644 Binary files a/assets/images/ic_add_book.png and b/assets/images/ic_add_book.png differ diff --git a/assets/images/ic_classify.png b/assets/images/ic_classify.png index 1b90c01..62da8c3 100644 Binary files a/assets/images/ic_classify.png and b/assets/images/ic_classify.png differ diff --git a/assets/images/ic_history.png b/assets/images/ic_history.png new file mode 100644 index 0000000..4333162 Binary files /dev/null and b/assets/images/ic_history.png differ diff --git a/assets/images/ic_home.png b/assets/images/ic_home.png index 8d83873..8f27cff 100644 Binary files a/assets/images/ic_home.png and b/assets/images/ic_home.png differ diff --git a/assets/images/ic_story_board.png b/assets/images/ic_story_board.png index d288a2b..5242d51 100644 Binary files a/assets/images/ic_story_board.png and b/assets/images/ic_story_board.png differ diff --git a/lib/pages/classify/controller.dart b/lib/pages/classify/controller.dart index 1fbf259..dd2b3fe 100644 --- a/lib/pages/classify/controller.dart +++ b/lib/pages/classify/controller.dart @@ -18,6 +18,12 @@ class ClassifyController extends GetxController { @override void onInit() { super.onInit(); + + } + + @override + void onReady() { + super.onReady(); mainCategory.value = appController.mainCategory; subCategory.value = appController.subCategory; } @@ -25,13 +31,15 @@ class ClassifyController extends GetxController { void onTapItemCategory(TagModel model) async { await analytics.setUserProperty(name: TAG_STORY, value: '${model.id}'); await analytics.logEvent(name: EVENT_LIST_BY_TAG, parameters: {'id': model.id}); - Get.toNamed(Routes.LIST_STORY, arguments: {'title': model.name ?? '', 'url': '/stories/?tag_id=${model.id}'}); + Get.toNamed(Routes.LIST_STORY, + arguments: {'title': model.name ?? '', 'url': '/stories/?tag_id=${model.id}'}); } void onTapItemTag(TagModel model) async { await analytics.setUserProperty(name: SUGGEST_TAG_STORY, value: '${model.id}'); await analytics.logEvent(name: EVENT_LIST_BY_SUGGEST_TAG, parameters: {'id': model.id}); - Get.toNamed(Routes.LIST_STORY, arguments: {'title': model.name ?? '', 'url': '/stories/suggest/?tag_id=${model.id}'}); + Get.toNamed(Routes.LIST_STORY, + arguments: {'title': model.name ?? '', 'url': '/stories/suggest/?tag_id=${model.id}'}); } void feedBackStoryListen() { diff --git a/lib/pages/classify/widget/list_category_story_read.dart b/lib/pages/classify/widget/list_category_story_read.dart index 18481e4..4b09028 100644 --- a/lib/pages/classify/widget/list_category_story_read.dart +++ b/lib/pages/classify/widget/list_category_story_read.dart @@ -10,25 +10,12 @@ class ListCategoryStoryRead extends StatelessWidget { @override Widget build(BuildContext context) { - return Obx( - () { - return SingleChildScrollView( - child: Column( - children: [ - _buildMainCategory(), - // _buildSubCategory(), - ], - ), - ); - }, - ); + return _buildMainCategory(); } Widget _buildMainCategory() { - final _models = _controller.mainCategory+_controller.subCategory; + final _models = (_controller.mainCategory+_controller.subCategory).toList(); return GridView.count( - shrinkWrap: true, - physics: const NeverScrollableScrollPhysics(), crossAxisCount: 2, childAspectRatio: 3.5, padding: const EdgeInsets.only(bottom: 12), diff --git a/lib/pages/detail_story/controller.dart b/lib/pages/detail_story/controller.dart index 731d372..608dd26 100644 --- a/lib/pages/detail_story/controller.dart +++ b/lib/pages/detail_story/controller.dart @@ -61,7 +61,7 @@ class DetailStoryController extends GetxController { int _totalPageChapter = 0; - final backgroundColor = AssetColors.primary.obs; + final backgroundColor = Color(0xffbdd4e7).obs; late RewardedAd _rewardedAd; @@ -94,8 +94,6 @@ class DetailStoryController extends GetxController { } EasyLoading.dismiss(); _checkStoryBoardLocal(); - final _random = Random().nextInt(8); - backgroundColor.value = AssetColors.primary; } catch (e) { EasyLoading.dismiss(); EasyLoading.showError('Đã xảy ra lỗi!'); @@ -158,6 +156,7 @@ class DetailStoryController extends GetxController { EasyLoading.show(); final _boardLocalModel = storyModel.value.toStoryBroadLocalModel; final _response = await dbService.addStoryBoard(model: _boardLocalModel); + EasyLoading.dismiss(); if (_response) { showSnackBarSuccess(message: 'Thêm vào tủ truyện thành công!'); showButtonAddBoard.value = false; diff --git a/lib/pages/detail_story/page.dart b/lib/pages/detail_story/page.dart index 06ec768..ebdcce1 100644 --- a/lib/pages/detail_story/page.dart +++ b/lib/pages/detail_story/page.dart @@ -51,7 +51,7 @@ class DetailStoryPage extends GetView { width: 20, ) : Text( - '+ Thêm vào tủ truyện', + '+ Lưu truyện', style: TextStyle(color: Colors.white), ), ) diff --git a/lib/pages/home/page.dart b/lib/pages/home/page.dart index 4172522..af890f9 100644 --- a/lib/pages/home/page.dart +++ b/lib/pages/home/page.dart @@ -23,6 +23,7 @@ class HomePage extends GetView { body: SafeArea( child: Column( children: [ + 20.verticalSpace, TextFormField( textInputAction: TextInputAction.search, readOnly: true, @@ -37,7 +38,7 @@ class HomePage extends GetView { color: AssetColors.colorGrey262626, ), ), - ).paddingSymmetric(horizontal: 20), + ).paddingSymmetric(horizontal: 20).wrapHeight(40), 20.verticalSpace, Expanded(child: _buildContainerStoryRead().paddingSymmetric(horizontal: 10)), ], diff --git a/lib/pages/home/widget/container_story.dart b/lib/pages/home/widget/container_story.dart index b7d9e83..0272412 100644 --- a/lib/pages/home/widget/container_story.dart +++ b/lib/pages/home/widget/container_story.dart @@ -31,7 +31,7 @@ class ContainerStoryHome extends StatelessWidget { padding: EdgeInsets.zero, mainAxisSpacing: 10, crossAxisSpacing: 6, - children: (models.length>8?models.sublist(0,8):models).map((item) { + children: (models.length>12?models.sublist(0,12):models).map((item) { return ItemStoryHome( model: item, onTap: () => _controller.onTapStory(item.id), diff --git a/lib/pages/main/controller.dart b/lib/pages/main/controller.dart index b859013..63a310f 100644 --- a/lib/pages/main/controller.dart +++ b/lib/pages/main/controller.dart @@ -17,7 +17,7 @@ class MainController extends GetxController { BottomNavBarModel(icon: 'ic_home', label: 'Trang chủ', page: HomePage()), BottomNavBarModel(icon: 'ic_classify', label: 'Phân Loại', page: ClassifyPage()), BottomNavBarModel(icon: 'ic_story_board', label: 'Tủ truyện', page: StoryBoardPage()), - BottomNavBarModel(icon: 'ic_story_board', label: 'Lịch Sử', page: HistoryReadingPage()), + BottomNavBarModel(icon: 'ic_history', label: 'Lịch Sử', page: HistoryReadingPage()), ]; } diff --git a/lib/pages/main/page.dart b/lib/pages/main/page.dart index 961eb55..9cb61f0 100644 --- a/lib/pages/main/page.dart +++ b/lib/pages/main/page.dart @@ -10,15 +10,27 @@ class MainPage extends GetResponsiveView { return Obx( () => Scaffold( bottomNavigationBar: BottomNavigationBar( - items: controller.bottomNavBarItems - .map( - (item) => BottomNavigationBarItem( - icon: Image.asset(item.icon.assetPathPNG, color: Colors.white, width: 24), - activeIcon: Image.asset(item.icon.assetPathPNG, color: Colors.white, width: 24), - label: item.label, - ), - ) - .toList(), + items: controller.bottomNavBarItems.asMap().keys.map((index) { + final item = controller.bottomNavBarItems[index]; + return BottomNavigationBarItem( + icon: Image.asset(item.icon.assetPathPNG, color: Colors.white, width: 20), + activeIcon: Image.asset(item.icon.assetPathPNG, color: Colors.white, width: 24), + title: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text(item.label), + 2.verticalSpace, + AnimatedContainer( + duration: 250.milliseconds, + width: 50, + height: 3, + color: controller.currentTabIndex.value == index + ? Colors.white + : Colors.transparent, + ), + ], + )); + }).toList(), type: BottomNavigationBarType.fixed, showSelectedLabels: true, backgroundColor: _theme.primaryColor, diff --git a/lib/pages/read_story/page.dart b/lib/pages/read_story/page.dart index 5807fca..2a2aff7 100644 --- a/lib/pages/read_story/page.dart +++ b/lib/pages/read_story/page.dart @@ -149,7 +149,7 @@ class ReadStoryPage extends GetView { child: Row( children: [ Text( - 'Thêm vào tủ truyện', + 'Lưu truyện', style: _theme.textTheme.subtitle1!.text434343, ), 5.horizontalSpace, diff --git a/lib/pages/search/widget/text_field_search.dart b/lib/pages/search/widget/text_field_search.dart index 3705bb5..f477c4d 100644 --- a/lib/pages/search/widget/text_field_search.dart +++ b/lib/pages/search/widget/text_field_search.dart @@ -18,6 +18,7 @@ class TextFieldSearch extends StatelessWidget { TextFormField( controller: _controller.textController, textInputAction: TextInputAction.search, + autofocus: true, decoration: InputDecoration( fillColor: AssetColors.colorGreyE7E7E7, hintText: 'Nhập tên truyện',