import 'package:flutter/material.dart';
import 'package:curved_navigation_bar/curved_navigation_bar.dart';
class ICurvedNavigationBar extends StatefulWidget {
@override
_ICurvedNavigationBarState createState() => _ICurvedNavigationBarState();
}
class _ICurvedNavigationBarState extends State<ICurvedNavigationBar> {
int _page = 0;
GlobalKey<CurvedNavigationBarState> _bottomNavigationKey = GlobalKey();
@override
Widget build(BuildContext context) {
return Scaffold(
bottomNavigationBar: CurvedNavigationBar(
key: _bottomNavigationKey,
index: 0,
height: 60.0,
items: <Widget>[
Icon(Icons.add, size: 30),
Icon(Icons.list, size: 30),
Icon(Icons.compare_arrows, size: 30),
Icon(Icons.call_split, size: 30),
Icon(Icons.perm_identity, size: 30),
],
color: Colors.white,
buttonBackgroundColor: Colors.white,
backgroundColor: Colors.blueAccent,
animationCurve: Curves.easeInOut,
animationDuration: Duration(milliseconds: 600),
onTap: (index) {
setState(() {
_page = index;
});
},
letIndexChange: (index) => true,
),
body: Container(
color: Colors.blueAccent,
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(_page.toString(), textScaleFactor: 10.0),
ElevatedButton(
child: Text('Go To Page of index 1'),
onPressed: () {
final CurvedNavigationBarState? navBarState =
_bottomNavigationKey.currentState;
navBarState?.setPage(1);
},
)
],
),
),
));
}
}
import 'package:curved_navigation_bar/curved_navigation_bar.dart';
class ICurvedNavigationBar extends StatefulWidget {
@override
_ICurvedNavigationBarState createState() => _ICurvedNavigationBarState();
}
class _ICurvedNavigationBarState extends State<ICurvedNavigationBar> {
int _page = 0;
GlobalKey<CurvedNavigationBarState> _bottomNavigationKey = GlobalKey();
@override
Widget build(BuildContext context) {
return Scaffold(
bottomNavigationBar: CurvedNavigationBar(
key: _bottomNavigationKey,
index: 0,
height: 60.0,
items: <Widget>[
Icon(Icons.add, size: 30),
Icon(Icons.list, size: 30),
Icon(Icons.compare_arrows, size: 30),
Icon(Icons.call_split, size: 30),
Icon(Icons.perm_identity, size: 30),
],
color: Colors.white,
buttonBackgroundColor: Colors.white,
backgroundColor: Colors.blueAccent,
animationCurve: Curves.easeInOut,
animationDuration: Duration(milliseconds: 600),
onTap: (index) {
setState(() {
_page = index;
});
},
letIndexChange: (index) => true,
),
body: Container(
color: Colors.blueAccent,
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(_page.toString(), textScaleFactor: 10.0),
ElevatedButton(
child: Text('Go To Page of index 1'),
onPressed: () {
final CurvedNavigationBarState? navBarState =
_bottomNavigationKey.currentState;
navBarState?.setPage(1);
},
)
],
),
),
));
}
}
Channel name was changed to «مشاريع برمجة كاملة بسيطة وأكواد جاهزة projects»
import 'package:flutter/material.dart';
class DraggableScrollableSheetWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Column(
children: <Widget>[
Expanded(
child: DraggableScrollableSheet(
builder: (context, scrollController) {
return SingleChildScrollView(
controller: scrollController,
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
color: Colors.teal,
),
child: Column(
children: <Widget>[
FlutterLogo(
size: 100,
),
FlutterLogo(
size: 100,
),
FlutterLogo(
size: 100,
),
FlutterLogo(
size: 100,
)
],
),
),
);
},
initialChildSize: 0.25,
maxChildSize: 0.8,
),
),
],
);
}
}
class DraggableScrollableSheetWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Column(
children: <Widget>[
Expanded(
child: DraggableScrollableSheet(
builder: (context, scrollController) {
return SingleChildScrollView(
controller: scrollController,
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
color: Colors.teal,
),
child: Column(
children: <Widget>[
FlutterLogo(
size: 100,
),
FlutterLogo(
size: 100,
),
FlutterLogo(
size: 100,
),
FlutterLogo(
size: 100,
)
],
),
),
);
},
initialChildSize: 0.25,
maxChildSize: 0.8,
),
),
],
);
}
}