feat : button , outlined button
fab button , fab outlined button , input , pagination widget's
This commit is contained in:
255
lib/presentation/widget/pagination/pagination_from_until.dart
Normal file
255
lib/presentation/widget/pagination/pagination_from_until.dart
Normal file
@@ -0,0 +1,255 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_app/presentation/common/app_color.dart';
|
||||
import 'package:rasadyar_app/presentation/common/app_fonts.dart';
|
||||
|
||||
class PaginationFromUntil extends StatefulWidget {
|
||||
const PaginationFromUntil({super.key});
|
||||
|
||||
@override
|
||||
State<PaginationFromUntil> createState() => _PaginationFromUntilState();
|
||||
}
|
||||
|
||||
class _PaginationFromUntilState extends State<PaginationFromUntil> {
|
||||
int current = 1;
|
||||
int total = 10;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
width: 164,
|
||||
height: 47,
|
||||
clipBehavior: Clip.antiAlias,
|
||||
decoration: ShapeDecoration(
|
||||
color: const Color(0xFFEAEFFF),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(50)),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
FloatingActionButton.small(
|
||||
onPressed: () {
|
||||
if(current>1){
|
||||
setState(() {
|
||||
current--;
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
shape: CircleBorder(),
|
||||
elevation: 0,
|
||||
backgroundColor: Colors.white,
|
||||
child: Icon(CupertinoIcons.arrow_left, color: AppColor.blueNormal),
|
||||
),
|
||||
Expanded(
|
||||
child: Text(
|
||||
'$current از $total',
|
||||
textAlign: TextAlign.center,
|
||||
textDirection: TextDirection.rtl,
|
||||
style: AppFonts.yekan16Regular.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
),
|
||||
FloatingActionButton.small(
|
||||
|
||||
onPressed:() {
|
||||
if (current < total) {
|
||||
setState(() {
|
||||
current++;
|
||||
});
|
||||
}
|
||||
},
|
||||
shape: CircleBorder(),
|
||||
elevation: 0,
|
||||
backgroundColor: AppColor.blueNormal,
|
||||
child: Icon(CupertinoIcons.arrow_right, color: Colors.white),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Stack buildStack() {
|
||||
return Stack(
|
||||
children: [
|
||||
Positioned(
|
||||
left: 4,
|
||||
top: 4,
|
||||
child: Container(
|
||||
width: 40,
|
||||
height: 40,
|
||||
child: Stack(
|
||||
children: [
|
||||
Positioned(
|
||||
left: 40,
|
||||
top: 40,
|
||||
child: Container(
|
||||
transform:
|
||||
Matrix4.identity()
|
||||
..translate(0.0, 0.0)
|
||||
..rotateZ(-3.14),
|
||||
width: 40,
|
||||
height: 40,
|
||||
child: Stack(
|
||||
children: [
|
||||
Positioned(
|
||||
left: 0,
|
||||
top: 0,
|
||||
child: Container(
|
||||
width: 40,
|
||||
height: 40,
|
||||
child: Stack(
|
||||
children: [
|
||||
Positioned(
|
||||
left: 0,
|
||||
top: 0,
|
||||
child: Container(
|
||||
width: 40,
|
||||
height: 40,
|
||||
child: Stack(
|
||||
children: [
|
||||
Positioned(
|
||||
left: 0,
|
||||
top: 0,
|
||||
child: Container(
|
||||
width: 40,
|
||||
height: 40,
|
||||
clipBehavior: Clip.antiAlias,
|
||||
decoration: ShapeDecoration(
|
||||
color:
|
||||
Colors.white /* Secondary */,
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(
|
||||
width: 1,
|
||||
color:
|
||||
Colors
|
||||
.white /* Secondary */,
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.circular(50),
|
||||
),
|
||||
),
|
||||
child: Stack(),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
left: 8,
|
||||
top: 8,
|
||||
child: Container(width: 24, height: 24, child: Stack()),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
left: 120,
|
||||
top: 3,
|
||||
child: Container(
|
||||
width: 40,
|
||||
height: 40,
|
||||
child: Stack(
|
||||
children: [
|
||||
Positioned(
|
||||
left: 40,
|
||||
top: 40,
|
||||
child: Container(
|
||||
transform:
|
||||
Matrix4.identity()
|
||||
..translate(0.0, 0.0)
|
||||
..rotateZ(-3.14),
|
||||
width: 40,
|
||||
height: 40,
|
||||
child: Stack(
|
||||
children: [
|
||||
Positioned(
|
||||
left: 0,
|
||||
top: 0,
|
||||
child: Container(
|
||||
width: 40,
|
||||
height: 40,
|
||||
child: Stack(
|
||||
children: [
|
||||
Positioned(
|
||||
left: 0,
|
||||
top: 0,
|
||||
child: Container(
|
||||
width: 40,
|
||||
height: 40,
|
||||
child: Stack(
|
||||
children: [
|
||||
Positioned(
|
||||
left: 0,
|
||||
top: 0,
|
||||
child: Container(
|
||||
width: 40,
|
||||
height: 40,
|
||||
clipBehavior: Clip.antiAlias,
|
||||
decoration: ShapeDecoration(
|
||||
color: const Color(
|
||||
0xFF2D5FFF,
|
||||
) /* Primary */,
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(
|
||||
width: 1,
|
||||
color: const Color(
|
||||
0xFF2D5FFF,
|
||||
) /* Primary */,
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.circular(50),
|
||||
),
|
||||
),
|
||||
child: Stack(),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
left: 8,
|
||||
top: 8,
|
||||
child: Container(width: 24, height: 24, child: Stack()),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
left: 63,
|
||||
top: 9,
|
||||
child: Text(
|
||||
'1 از 17',
|
||||
style: TextStyle(
|
||||
color: const Color(0xFF2D5FFF) /* Primary */,
|
||||
fontSize: 16,
|
||||
fontFamily: 'IRANYekanFN',
|
||||
fontWeight: FontWeight.w400,
|
||||
height: 1.75,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
78
lib/presentation/widget/pagination/show_more.dart
Normal file
78
lib/presentation/widget/pagination/show_more.dart
Normal file
@@ -0,0 +1,78 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_app/presentation/common/app_color.dart';
|
||||
import 'package:rasadyar_app/presentation/common/app_fonts.dart';
|
||||
|
||||
class RShowMore extends StatefulWidget {
|
||||
const RShowMore({super.key});
|
||||
|
||||
@override
|
||||
State<RShowMore> createState() => _RShowMoreState();
|
||||
}
|
||||
|
||||
class _RShowMoreState extends State<RShowMore>
|
||||
with SingleTickerProviderStateMixin {
|
||||
bool _toggled = false;
|
||||
late final AnimationController _controller;
|
||||
late final Animation<double> _iconRotation;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
_controller = AnimationController(
|
||||
vsync: this,
|
||||
duration: const Duration(milliseconds: 500),
|
||||
);
|
||||
_iconRotation = Tween<double>(
|
||||
begin: 0,
|
||||
end: 0.50,
|
||||
) // 90 degrees (quarter turn)
|
||||
.animate(CurvedAnimation(parent: _controller, curve: Curves.easeInOut));
|
||||
}
|
||||
|
||||
void _toggle() {
|
||||
setState(() => _toggled = !_toggled);
|
||||
_toggled ? _controller.forward() : _controller.reverse();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_controller.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: _toggle,
|
||||
behavior: HitTestBehavior.opaque,
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
spacing: 8,
|
||||
children: [
|
||||
RotationTransition(
|
||||
turns: _iconRotation,
|
||||
child: const Icon(CupertinoIcons.chevron_down, size: 12,color:AppColor.blueNormal ,),
|
||||
),
|
||||
|
||||
AnimatedSwitcher(
|
||||
duration: const Duration(milliseconds: 500),
|
||||
transitionBuilder:
|
||||
(child, animation) =>
|
||||
FadeTransition(opacity: animation, child: child),
|
||||
child: Text(
|
||||
_toggled ? 'کمتر' : 'مشاهده بیشتر',
|
||||
key: ValueKey(_toggled),
|
||||
style: AppFonts.yekan10Regular.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 50,)
|
||||
],
|
||||
|
||||
|
||||
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user