تعلم البرمحة بالفلاتر flutter
1.61K subscribers
174 photos
25 files
10 links
Download Telegram
import 'package:flutter/material.dart';
import 'dart:math' as math;

class AnimatedBuilderWidget extends StatefulWidget {
@override
_AnimatedBuilderWidgetState createState() => _AnimatedBuilderWidgetState();
}

class _AnimatedBuilderWidgetState extends State<AnimatedBuilderWidget>
with SingleTickerProviderStateMixin {
AnimationController _controller;
bool status = true;
@override
void initState() {
super.initState();
_controller = AnimationController(
duration: const Duration(seconds: 10),
vsync: this,
);
}

@override
void dispose() {
_controller.dispose();
super.dispose();
}

@override
Widget build(BuildContext context) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
AnimatedBuilder(
animation: _controller,
child: Container(width: 200.0, height: 200.0, color: Colors.green),
builder: (BuildContext context, Widget child) {
return Transform.rotate(
angle: _controller.value * 2.0 * math.pi,
child: child,
);
},
),
SizedBox(
height: 50,
),
RaisedButton(
onPressed: () {
status ? _controller.forward() : _controller.reverse();
status = !status;
},
child: Text("Click"),
)
],
);
}
}
===============≈==================
import 'package:flutter/material.dart';

class BottomAppBarWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(),
floatingActionButton: FloatingActionButton(
child: Icon(Icons.add),
onPressed: () {},
),
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
bottomNavigationBar: BottomAppBar(
shape: CircularNotchedRectangle(),
notchMargin: 5,
color: Colors.blue,
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
IconButton(
icon: Icon(Icons.home, color: Colors.white),
onPressed: () {},
),
IconButton(
icon: Icon(Icons.more_vert, color: Colors.white),
onPressed: () {},
),
],
),
),
);
}
}
Feel free to use the code in your projects but do not forget to give me the credits adding my app (Flutter Animation Gallery) where you are gonna use it.

------------------------------------------






import 'package:animations/animations.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class MyCustomWidget extends StatefulWidget {
@override
_MyCustomWidgetState createState() => _MyCustomWidgetState();
}

class _MyCustomWidgetState extends State<MyCustomWidget> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: OpenContainer(
closedBuilder: (_, openContainer) {
return Container(
height: 200,
width: 200,
child: IconButton(
splashColor: Colors.transparent,
highlightColor: Colors.transparent,
onPressed: openContainer,
icon: Icon(
Icons.arrow_forward,
size: 30,
color: Colors.black.withOpacity(0.8),
),
),
);
},
openColor: Colors.white,
closedElevation: 50.0,
closedShape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(100),
),
closedColor: Colors.white,
openBuilder: (_, closeContainer) {
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.blue,
title: Text('Go back'),
leading: IconButton(
onPressed: closeContainer,
icon: Icon(Icons.arrow_back, color: Colors.white),
),
),
);
},
),
),
);
}
}
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);
},
)
],
),
),
));
}
}
Channel name was changed to «مشاريع برمجة كاملة بسيطة وأكواد جاهزة projects»
Channel name was changed to «برمجة تطبيقات أندوريد و أيفون (flutter)»