Comments (4)
@erjiridholubis please try this to solve your issue
Scaffold(
resizeToAvoidBottomInset: false,
// other properties and widgets for your scaffold
appBar: AppBar(
title: Text('Your App'),
),
body: YourBodyWidget(),
// ... other properties
);
This will prevent the body from resizing to avoid the bottom inset when the keyboard is displayed. Make sure to replace YourBodyWidget() with the actual widget you want to use as the body of your scaffold. If you have any specific questions or if there's anything else you'd like assistance with, feel free to provide more details!
from animated_notch_bottom_bar.
still not working
from animated_notch_bottom_bar.
yeah it's not working for me too, it would be helpful if i get a solution for this.
from animated_notch_bottom_bar.
Simulator.Screen.Recording.-.iPhone.14.Pro.-.2023-12-11.at.10.56.30.mp4
@erjiridholubis, below is an example I created using your code, and it's working fine. Please check and compare your code with that. If you're still facing any issues, please provide me your code with bottom bar implementation and specify the Dart version.
import 'dart:developer';
import 'package:animated_notch_bottom_bar/animated_notch_bottom_bar/animated_notch_bottom_bar.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const BottomBar(),
);
}
}
class BottomBar extends StatefulWidget {
const BottomBar({super.key});
@override
State<BottomBar> createState() => _BottomBarState();
}
class _BottomBarState extends State<BottomBar> {
final _pageController = PageController(initialPage: 0);
final _controller = NotchBottomBarController(index: 0);
int maxCount = 5;
final List<Widget> bottomBarPages = [
const FirstScreen(),
Container(
color: Colors.redAccent,
),
Container(
color: Colors.greenAccent,
),
Container(
color: Colors.blueAccent,
),
];
@override
void dispose() {
_pageController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
resizeToAvoidBottomInset: false,
body: PageView(
controller: _pageController,
physics: const NeverScrollableScrollPhysics(),
children: List.generate(bottomBarPages.length, (index) => bottomBarPages[index]),
),
extendBody: true,
bottomNavigationBar: (bottomBarPages.length <= maxCount)
? AnimatedNotchBottomBar(
/// Provide NotchBottomBarController
notchBottomBarController: _controller,
color: Colors.white,
showLabel: false,
notchColor: Colors.black87,
/// restart app if you change removeMargins
removeMargins: false,
bottomBarWidth: 500,
durationInMilliSeconds: 300,
bottomBarItems: const [
BottomBarItem(
inActiveItem: Icon(
Icons.home_filled,
color: Colors.blueGrey,
),
activeItem: Icon(
Icons.home_filled,
color: Colors.blueAccent,
),
itemLabel: 'Page 1',
),
BottomBarItem(
inActiveItem: Icon(
Icons.star,
color: Colors.blueGrey,
),
activeItem: Icon(
Icons.star,
color: Colors.blueAccent,
),
itemLabel: 'Page 2',
),
BottomBarItem(
inActiveItem: Icon(
Icons.settings,
color: Colors.blueGrey,
),
activeItem: Icon(
Icons.settings,
color: Colors.pink,
),
itemLabel: 'Page 3',
),
],
onTap: (index) {
/// perform action on tab change and to update pages you can update pages without pages
log('current selected index $index');
_pageController.jumpToPage(index);
},
)
: null,
);
}
}
class FirstScreen extends StatefulWidget {
const FirstScreen({super.key});
@override
State<FirstScreen> createState() => _FirstScreenState();
}
class _FirstScreenState extends State<FirstScreen> {
@override
Widget build(BuildContext context) {
double screenWidth = MediaQuery.of(context).size.width;
return Scaffold(
body: Column(
children: [
Container(
width: screenWidth,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(25.0),
color: const Color(0xfffba1b7),
),
child: Column(
children: [
const SizedBox(height: 60.0),
Row(
children: [
const SizedBox(width: 40.0),
const Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 30.0),
Text(
'INPUT,',
style: TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.w600,
),
),
SizedBox(height: 8.0),
Text(
'REKAM MEDIS',
style: TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.w300,
),
),
SizedBox(height: 8.0),
],
),
),
Container(
color: Colors.redAccent,
width: 120,
height: 120,
),
const SizedBox(width: 40.0),
],
),
const SizedBox(height: 20.0),
],
),
),
const SizedBox(height: 40.0),
Padding(
padding: const EdgeInsets.only(left: 20.0, right: 20.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
TextField(
decoration: InputDecoration(
labelText: 'Nomor Rekam Medis',
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(5.0),
),
fillColor: Colors.white,
filled: true,
),
style: const TextStyle(),
),
const SizedBox(height: 20.0),
],
),
),
],
),
);
}
}
from animated_notch_bottom_bar.
Related Issues (20)
- Developer branch missing HOT 2
- Default first BottomBarItem HOT 1
- Elevation HOT 1
- Expected a value of type 'JavaScriptObject', but got one of type 'Null' Error for web? HOT 1
- [Feature Request] Gradient "notchColor" HOT 1
- Change icon size HOT 2
- remove right-bottom and left bottom radius HOT 3
- Can showShadow be separated from roundedEdges? HOT 1
- Is there a way to set height of bottom bar HOT 2
- Can i remove the navbar from another page that's not listed in the bottomBarPages list HOT 2
- AnimationController.stop() called after AnimationController.dispose() HOT 6
- Safe Area! HOT 1
- Make BottomBarItem.itemLabel of type Text
- bar background image HOT 1
- can't find margin field and borderRadius field. HOT 1
- Functionality to use the widget without the dependency of the pageview HOT 1
- right to left align dosent work when use locale: const Locale('fa', 'IR'), HOT 1
- Functionality to limit the width of AnimatedNotchBottomBar for wider screens like macOS, web, tabs, etc HOT 1
- Functionality to use it upside down for tabbar HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from animated_notch_bottom_bar.