Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 21 additions & 11 deletions .idea/libraries/Dart_SDK.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/libraries/Flutter_Plugins.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

65 changes: 38 additions & 27 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

154 changes: 76 additions & 78 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,109 +29,107 @@ class MyApp extends StatelessWidget {
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: Directionality(textDirection: TextDirection.rtl, child: MyHomePage(title: 'Floating Action Bubble Demo')),
home: Directionality(
textDirection: TextDirection.rtl,
child: MyHomePage(title: 'Floating Action Bubble Demo')),
);
}
}

class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
MyHomePage({Key? key, this.title = ''}) : super(key: key);
final String title;

@override
_MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> with SingleTickerProviderStateMixin{

Animation<double> _animation;
AnimationController _animationController;
class _MyHomePageState extends State<MyHomePage>
with SingleTickerProviderStateMixin {
late Animation<double> _animation;
late AnimationController _animationController;

@override
void initState(){

void initState() {
_animationController = AnimationController(
vsync: this,
duration: Duration(milliseconds: 260),
duration: const Duration(milliseconds: 260),
);

final curvedAnimation = CurvedAnimation(curve: Curves.easeInOut, parent: _animationController);
final curvedAnimation =
CurvedAnimation(curve: Curves.easeInOut, parent: _animationController);
_animation = Tween<double>(begin: 0, end: 1).animate(curvedAnimation);


super.initState();


super.initState();
}

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),

floatingActionButtonLocation: FloatingActionButtonLocation.endDocked,

//Init Floating Action Bubble
floatingActionButton: FloatingActionBubble(
// Menu items
items: <Bubble>[

// Floating action menu item
Bubble(
title:"Settings",
iconColor :Colors.white,
bubbleColor : Colors.blue,
icon:Icons.settings,
titleStyle:TextStyle(fontSize: 16 , color: Colors.white),
onPress: () {
_animationController.reverse();
},
),
// Floating action menu item
Bubble(
title:"Profile",
iconColor :Colors.white,
bubbleColor : Colors.blue,
icon:Icons.people,
titleStyle:TextStyle(fontSize: 16 , color: Colors.white),
onPress: () {
_animationController.reverse();
},
),
//Floating action menu item
Bubble(
title:"Home",
iconColor :Colors.white,
bubbleColor : Colors.blue,
icon:Icons.home,
titleStyle:TextStyle(fontSize: 16 , color: Colors.white),
onPress: () {
Navigator.push(context, new MaterialPageRoute(builder: (BuildContext context) => Homepage()));
_animationController.reverse();
},
),
],

// animation controller
animation: _animation,

// On pressed change animation state
onPress: () => _animationController.isCompleted
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
floatingActionButtonLocation: FloatingActionButtonLocation.endDocked,

//Init Floating Action Bubble
floatingActionButton: FloatingActionBubble(
// Menu items
items: <Bubble>[
// Floating action menu item
Bubble(
title: 'Settings',
iconColor: Colors.white,
bubbleColor: Colors.blue,
icon: Icons.settings,
titleStyle: const TextStyle(fontSize: 16, color: Colors.white),
onPress: () {
_animationController.reverse();
},
),
// Floating action menu item
Bubble(
title: 'Profile',
iconColor: Colors.white,
bubbleColor: Colors.blue,
icon: Icons.people,
titleStyle: const TextStyle(fontSize: 16, color: Colors.white),
onPress: () {
_animationController.reverse();
},
),
//Floating action menu item
Bubble(
title: 'Home',
iconColor: Colors.white,
bubbleColor: Colors.blue,
icon: Icons.home,
titleStyle: const TextStyle(fontSize: 16, color: Colors.white),
onPress: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) => Homepage()));
_animationController.reverse();
},
),
],

// animation controller
animation: _animation,

// On pressed change animation state
onPress: () => _animationController.isCompleted
? _animationController.reverse()
: _animationController.forward(),

// Floating Action button Icon color
iconColor: Colors.blue,

// Flaoting Action button Icon
iconData: Icons.ac_unit,
backGroundColor: Colors.white,
)
);
}

// Floating Action button Icon color
iconColor: Colors.blue,

// Floating Action button Icon
iconData: Icons.ac_unit,
backGroundColor: Colors.white,
));
}
}
```

Expand Down
Loading