project code
project code
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:flutter_web_plugins/url_strategy.dart';
import 'flutter_flow/flutter_flow_theme.dart';
import 'flutter_flow/flutter_flow_util.dart';
import 'flutter_flow/internationalization.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:floating_bottom_navigation_bar/floating_bottom_navigation_bar.dart';
import 'flutter_flow/nav/nav.dart';
import 'index.dart';
WidgetsFlutterBinding.ensureInitialized();
usePathUrlStrategy();
await FlutterFlowTheme.initialize();
runApp(MyApp());
@override
context.findAncestorStateOfType<_MyAppState>()!;
Locale? _locale;
@override
void initState() {
super.initState();
_appStateNotifier = AppStateNotifier.instance;
_router = createRouter(_appStateNotifier);
_themeMode = mode;
FlutterFlowTheme.saveThemeMode(mode);
});
@override
return MaterialApp.router(
title: 'cong-app',
localizationsDelegates: [
FFLocalizationsDelegate(),
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
],
locale: _locale,
theme: ThemeData(
brightness: Brightness.light,
scrollbarTheme: ScrollbarThemeData(),
),
darkTheme: ThemeData(
brightness: Brightness.dark,
scrollbarTheme: ScrollbarThemeData(),
),
themeMode: _themeMode,
routerConfig: _router,
);
@override
/// This is the private State class that goes with NavBarPage.
@override
void initState() {
super.initState();
_currentPage = widget.page;
@override
final tabs = {
'dashboard': DashboardWidget(),
'profile': ProfileWidget(),
'drive_mode_off': DriveModeOffWidget(),
};
return Scaffold(
body: MediaQuery(
data: queryData
.removeViewInsets(removeBottom: true)
.removeViewPadding(removeBottom: true),
extendBody: true,
bottomNavigationBar: FloatingNavbar(
currentIndex: currentIndex,
_currentPage = null;
_currentPageName = tabs.keys.toList()[i];
}),
backgroundColor: Colors.white,
selectedItemColor: Color(0xFFF78B45),
unselectedItemColor: Color(0xFF5A6174),
selectedBackgroundColor: Color(0x00000000),
borderRadius: 8.0,
itemBorderRadius: 8.0,
width: double.infinity,
elevation: 0.0,
items: [
FloatingNavbarItem(
customWidget: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.home_outlined,
color:
size: 24.0,
),
Text(
'Home',
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: currentIndex == 0
? Color(0xFFF78B45)
: Color(0xFF5A6174),
fontSize: 11.0,
),
),
],
),
),
FloatingNavbarItem(
customWidget: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.person_outline,
color:
size: 24.0,
),
Text(
'Profile',
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: currentIndex == 1
? Color(0xFFF78B45)
: Color(0xFF5A6174),
fontSize: 11.0,
),
),
],
),
),
FloatingNavbarItem(
customWidget: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.directions_car_filled_outlined,
color:
size: 24.0,
),
Text(
'Drive',
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: currentIndex == 2
? Color(0xFFF78B45)
: Color(0xFF5A6174),
fontSize: 11.0,
),
),
],
),
],
),
);
Pubspec.yaml
name: cong_app
# The following line prevents the package from being accidentally published to
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# Both the version and the builder number may be overridden in flutter
#
https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKe
yReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1
environment:
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
auto_size_text: 3.0.0
cached_network_image: ^3.3.0
collection: ^1.17.2
dropdown_button2: ^2.3.9
flip_card: ^0.7.0
floating_bottom_navigation_bar: 1.5.2
flutter_animate: ^4.2.0+1
flutter_cache_manager: ^3.3.1
flutter_google_places:
git:
url: https://github.com/fluttercommunity/flutter_google_places
ref: v0.3.2
flutter_plugin_android_lifecycle: ^2.0.16
font_awesome_flutter: ^10.5.0
from_css_color: 2.0.0
geolocator: ^12.0.0
geolocator_android: ^4.3.1
geolocator_apple: ^2.3.2
geolocator_platform_interface: ^4.1.1
geolocator_web: ^4.1.3
go_router: ^15.0.0
google_api_headers: ^1.2.0
google_fonts: ^4.0.4
google_maps: ^8.1.1
google_maps_flutter: ^2.5.0
google_maps_flutter_platform_interface: ^2.4.1
google_maps_flutter_web: ^0.5.4+2
intl: ^0.19.0
json_path: ^0.7.5
json_annotation: ^4.8.1
package_info_plus: ^4.1.0
package_info_plus_platform_interface: 2.0.1
page_transition: ^2.1.0
path_provider: ^2.1.1
path_provider_android: ^2.2.0
path_provider_foundation: ^2.3.1
path_provider_platform_interface: ^2.1.1
provider: ^6.0.5
shared_preferences: ^2.2.1
shared_preferences_android: ^2.2.1
shared_preferences_ios: 2.1.1
shared_preferences_platform_interface: ^2.3.1
shared_preferences_web: ^2.2.1
sqflite: ^2.3.0
timeago: ^3.5.0
url_launcher: ^6.1.14
url_launcher_android: ^6.1.0
url_launcher_ios: ^6.1.5
url_launcher_platform_interface: ^2.1.5
webview_flutter: ^4.4.1
webview_flutter_android: ^3.12.0
webview_flutter_platform_interface: ^2.6.0
webview_flutter_wkwebview: ^3.9.1
webviewx_plus: 0.3.3
cupertino_icons: ^1.0.0
dev_dependencies:
flutter_test:
sdk: flutter
build_runner: ^2.4.6
json_serializable: ^6.7.1
# For information on the generic Dart part of this file, see the
flutter:
# included with your application, so that you can use the icons in
uses-material-design: true
assets:
- assets/fonts/
- assets/images/
- assets/videos/
- assets/audios/
- assets/lottie_animations/
- assets/rive_animations/
- assets/pdfs/
fonts:
- asset: assets/fonts/SFUIDisplay-Thin.otf
weight: 100
- asset: assets/fonts/SFUIDisplay-Light.ttf
weight: 300
- asset: assets/fonts/SFUIDisplay-Regular.otf
- asset: assets/fonts/SFUIDisplay-Medium.otf
weight: 500
- asset: assets/fonts/SFUIDisplay-Semibold.otf
weight: 600
- asset: assets/fonts/SFUIDisplay-Bold.ttf
weight: 700
- asset: assets/fonts/SFUIDisplay-Black.otf
weight: 900
# https://flutter.dev/assets-and-images/#resolution-aware.
# https://flutter.dev/assets-and-images/#from-packages
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
# see https://flutter.dev/custom-fonts/#from-packages