mirror of
https://github.com/ErfanRht/MovieLab.git
synced 2025-08-05 19:02:13 +08:00
improve: change main bottomNavigationBar widget
This commit is contained in:
@ -1,6 +1,4 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_phoenix/flutter_phoenix.dart';
|
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:hive_flutter/adapters.dart';
|
import 'package:hive_flutter/adapters.dart';
|
||||||
import 'package:movielab/constants/themes.dart';
|
import 'package:movielab/constants/themes.dart';
|
||||||
@ -21,7 +19,7 @@ void main() async {
|
|||||||
await initializeHive();
|
await initializeHive();
|
||||||
await initializeGetX();
|
await initializeGetX();
|
||||||
|
|
||||||
runApp(ProviderScope(child: Phoenix(child: const App())));
|
runApp(const App());
|
||||||
}
|
}
|
||||||
|
|
||||||
class App extends StatelessWidget {
|
class App extends StatelessWidget {
|
||||||
|
@ -5,7 +5,7 @@ import 'package:movielab/constants/types.dart';
|
|||||||
|
|
||||||
setSystemUIOverlayStyle(
|
setSystemUIOverlayStyle(
|
||||||
{required SystemUIOverlayStyle systemUIOverlayStyle,
|
{required SystemUIOverlayStyle systemUIOverlayStyle,
|
||||||
Color color = kBackgroundColor}) {
|
Color color = kSecondaryColor}) {
|
||||||
if (systemUIOverlayStyle == SystemUIOverlayStyle.DARK) {
|
if (systemUIOverlayStyle == SystemUIOverlayStyle.DARK) {
|
||||||
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
|
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
|
||||||
statusBarColor: Colors.transparent,
|
statusBarColor: Colors.transparent,
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:movielab/constants/colors.dart';
|
import 'package:movielab/constants/colors.dart';
|
||||||
import 'package:movielab/pages/main/main_controller.dart';
|
import 'package:movielab/pages/main/main_controller.dart';
|
||||||
import 'package:google_nav_bar/google_nav_bar.dart';
|
import 'package:flashy_tab_bar2/flashy_tab_bar2.dart';
|
||||||
|
|
||||||
// Main pages:
|
// Main pages:
|
||||||
import 'home/home_page.dart';
|
import 'home/home_page.dart';
|
||||||
@ -19,60 +18,66 @@ class MainPage extends StatelessWidget {
|
|||||||
return GetBuilder<MainController>(builder: (_) {
|
return GetBuilder<MainController>(builder: (_) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: pages.elementAt(_.selectedIndex),
|
body: pages.elementAt(_.selectedIndex),
|
||||||
bottomNavigationBar: Container(
|
bottomNavigationBar: FlashyTabBar(
|
||||||
decoration: BoxDecoration(
|
selectedIndex: _.selectedIndex,
|
||||||
color: kBackgroundColor,
|
animationCurve: Curves.linear,
|
||||||
boxShadow: [
|
showElevation: true,
|
||||||
BoxShadow(
|
backgroundColor: kSecondaryColor,
|
||||||
blurRadius: 20,
|
animationDuration: const Duration(milliseconds: 250),
|
||||||
color: Colors.black.withOpacity(.1),
|
iconSize: 27.5,
|
||||||
)
|
height: 70,
|
||||||
],
|
onItemSelected: (index) => _.changeIndex(index),
|
||||||
),
|
items: [
|
||||||
child: SafeArea(
|
FlashyTabBarItem(
|
||||||
child: Padding(
|
icon: const Icon(
|
||||||
padding:
|
Icons.home_max_rounded,
|
||||||
const EdgeInsets.symmetric(horizontal: 22.5, vertical: 10),
|
),
|
||||||
child: GNav(
|
activeColor: Colors.white,
|
||||||
rippleColor: kBlueColor,
|
title: const Text(
|
||||||
hoverColor: kBlueColor,
|
'Home',
|
||||||
activeColor: CupertinoColors.activeBlue,
|
style: TextStyle(
|
||||||
tabBackgroundColor: kBlueColor,
|
fontSize: 15,
|
||||||
color: CupertinoColors.systemGrey,
|
),
|
||||||
gap: 5,
|
|
||||||
iconSize: 27,
|
|
||||||
textStyle: const TextStyle(
|
|
||||||
fontSize: 16,
|
|
||||||
fontWeight: FontWeight.w700,
|
|
||||||
color: CupertinoColors.activeBlue),
|
|
||||||
padding:
|
|
||||||
const EdgeInsets.symmetric(horizontal: 15, vertical: 10),
|
|
||||||
duration: const Duration(milliseconds: 400),
|
|
||||||
tabs: const [
|
|
||||||
GButton(
|
|
||||||
icon: Icons.home_max_rounded,
|
|
||||||
text: 'Home',
|
|
||||||
),
|
|
||||||
GButton(
|
|
||||||
icon: Icons.search_rounded,
|
|
||||||
text: 'Search',
|
|
||||||
),
|
|
||||||
GButton(
|
|
||||||
icon: Icons.bookmark_outline_rounded,
|
|
||||||
text: 'Lists',
|
|
||||||
),
|
|
||||||
GButton(
|
|
||||||
icon: Icons.podcasts_rounded,
|
|
||||||
text: 'Profile',
|
|
||||||
),
|
|
||||||
],
|
|
||||||
selectedIndex: _.selectedIndex,
|
|
||||||
onTabChange: (index) {
|
|
||||||
_.changeIndex(index);
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
FlashyTabBarItem(
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.search_rounded,
|
||||||
|
),
|
||||||
|
activeColor: Colors.white,
|
||||||
|
title: const Text(
|
||||||
|
'Search',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 15,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
FlashyTabBarItem(
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.bookmark_outline_rounded,
|
||||||
|
),
|
||||||
|
activeColor: Colors.white,
|
||||||
|
title: const Text(
|
||||||
|
'Lists',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 15,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
FlashyTabBarItem(
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.podcasts_rounded,
|
||||||
|
),
|
||||||
|
activeColor: Colors.white,
|
||||||
|
inactiveColor: const Color(0xff9496c1),
|
||||||
|
title: const Text(
|
||||||
|
'Profile',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 15,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
35
pubspec.lock
35
pubspec.lock
@ -267,6 +267,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.55.0"
|
version: "0.55.0"
|
||||||
|
flashy_tab_bar2:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: flashy_tab_bar2
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "0.0.4"
|
||||||
flutter:
|
flutter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description: flutter
|
description: flutter
|
||||||
@ -293,13 +300,6 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.1"
|
version: "2.0.1"
|
||||||
flutter_phoenix:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: flutter_phoenix
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "1.1.0"
|
|
||||||
flutter_plugin_android_lifecycle:
|
flutter_plugin_android_lifecycle:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -314,13 +314,6 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.0.0"
|
version: "4.0.0"
|
||||||
flutter_riverpod:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: flutter_riverpod
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "1.0.4"
|
|
||||||
flutter_slidable:
|
flutter_slidable:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@ -751,13 +744,6 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.0"
|
version: "1.2.0"
|
||||||
riverpod:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: riverpod
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "1.0.3"
|
|
||||||
rxdart:
|
rxdart:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -966,13 +952,6 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.10.0"
|
version: "1.10.0"
|
||||||
state_notifier:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: state_notifier
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "0.7.2+1"
|
|
||||||
stream_channel:
|
stream_channel:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -36,7 +36,6 @@ dependencies:
|
|||||||
http: ^0.13.4
|
http: ^0.13.4
|
||||||
cached_network_image: ^3.2.0
|
cached_network_image: ^3.2.0
|
||||||
speech_to_text: ^5.6.0
|
speech_to_text: ^5.6.0
|
||||||
flutter_riverpod: ^1.0.4
|
|
||||||
url_launcher: ^6.1.4
|
url_launcher: ^6.1.4
|
||||||
fl_chart: ^0.55.0
|
fl_chart: ^0.55.0
|
||||||
share_plus: ^4.0.10
|
share_plus: ^4.0.10
|
||||||
@ -46,7 +45,7 @@ dependencies:
|
|||||||
external_path: ^1.0.1
|
external_path: ^1.0.1
|
||||||
permission_handler: ^10.0.0
|
permission_handler: ^10.0.0
|
||||||
file_picker: ^5.0.1
|
file_picker: ^5.0.1
|
||||||
flutter_phoenix: ^1.1.0
|
flashy_tab_bar2: ^0.0.4
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user