Learning Flutter πŸ“±πŸ’»
5 subscribers
117 photos
35 videos
3 files
67 links
Download Telegram
C++ ishlagan ekan 😁
😁1
This media is not supported in your browser
VIEW IN TELEGRAM
Gap sochida ekanligini keyin tushunibman πŸ‘¨β€πŸ¦²πŸ‘¨
πŸ”₯1
Code yozishda yaxshiroq AI lar jadvali
πŸ‘1
Forwarded from Azim Pulat
Kodni o'zim yozsam: <10 daqiqa>
...
Kodni AI yozsa: <1 soniya>
Keyin u kodni ishlatvolishga: <1 soat>
😁1
buttonni atrofida color aylanib yuradi ga custom widget
import 'dart:math' as math;

import 'package:sell_market/path_file/all_path_file.dart';

sealed class AppColors{
static const white=Colors.white;
static const transparent=Colors.transparent;
static const black=Colors.black;
static final red=Color(0xFFFF1F38);
static final red3=Color(0xFFF01FFF);
static final red2=Color(0xFFE61090);

}

class AnimatedBorderButton extends StatefulWidget {
final String text;
final VoidCallback onPressed;

const AnimatedBorderButton({
super.key,
required this.text,
required this.onPressed,
});

@override
State<AnimatedBorderButton> createState() => _AnimatedBorderButtonState();
}

class _AnimatedBorderButtonState extends State<AnimatedBorderButton>
with SingleTickerProviderStateMixin {
late AnimationController _controller;

@override
void initState() {
super.initState();
_controller = AnimationController(
vsync: this,
duration: const Duration(seconds: 3),
)..repeat();
}

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

@override
Widget build(BuildContext context) {
return AnimatedBuilder(
animation: _controller,
builder: (context, child) {
return CustomPaint(
painter: _GradientBorderPainter(angle: _controller.value * 2 * math.pi),
child: child,
);
},
child: GestureDetector(
onTap: widget.onPressed,
child: Container(
padding:EdgeInsetsGeometry.all(14),
child: Center(
child: Text(
widget.text,
style: const TextStyle(
color: Colors.white,
fontSize: 18,
),
),
),
),
),
);
}
}

class _GradientBorderPainter extends CustomPainter {
final double angle;

_GradientBorderPainter({required this.angle});

@override
void paint(Canvas canvas, Size size) {
final rect = Offset.zero & size;

final gradient = SweepGradient(
startAngle: angle,
endAngle: angle + 2 * math.pi,
/// color ni berish kere
colors: [AppColors.red,AppColors.white,AppColors.red3],
// colors: const [Colors.blue, Colors.green, Colors.red, Colors.orange, Colors.blue],
);

final paint = Paint()
..shader = gradient.createShader(rect)
..style = PaintingStyle.stroke
..strokeWidth = 3;

final rrect = RRect.fromRectAndRadius(rect.deflate(1), const Radius.circular(12));
canvas.drawRRect(rrect, paint);
}

@override
bool shouldRepaint(covariant _GradientBorderPainter oldDelegate) {
return oldDelegate.angle != angle;
}
}
/// example
AnimatedBorderButton(
text: "Continue",
onPressed: () {
print("Button pressed!");
},
),
πŸ‘1πŸ”₯1
Learning Flutter πŸ“±πŸ’»
buttonni atrofida color aylanib yuradi ga custom widget import 'dart:math' as math; import 'package:sell_market/path_file/all_path_file.dart'; sealed class AppColors{ static const white=Colors.white; static const transparent=Colors.transparent; static…
version 2 
import 'dart:math' as math;
import 'package:flutter/material.dart';

class AnimatedBorderButton extends StatefulWidget {
final String text;
final VoidCallback onPressed;

const AnimatedBorderButton({
super.key,
required this.text,
required this.onPressed,
});

@override
State<AnimatedBorderButton> createState() => _AnimatedBorderButtonState();
}

class _AnimatedBorderButtonState extends State<AnimatedBorderButton>
with SingleTickerProviderStateMixin {
late AnimationController _controller;
late Animation<double> _rotation;

@override
void initState() {
super.initState();
_controller = AnimationController(
vsync: this,

duration: const Duration(seconds: 5),
)..repeat();

_rotation = CurvedAnimation(
parent: _controller,
curve: Curves.easeInToLinear,
);
}

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

@override
Widget build(BuildContext context) {
return AnimatedBuilder(
animation: _rotation,
builder: (context, child) {
return Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
gradient: SweepGradient(
startAngle: 0,
endAngle: math.pi * 2,
transform: GradientRotation(_rotation.value * 2 * math.pi),
colors: const [
Colors.blue,
Colors.purple,
Colors.red,
Colors.orange,
Colors.white,
Colors.blue,
],
),
),
child: Padding(
padding: const EdgeInsets.all(7),
child: Container(
decoration: BoxDecoration(
color: Colors.black,
borderRadius: BorderRadius.circular(10),
),
child: TextButton(
onPressed: widget.onPressed,
child: Text(
widget.text,
style: const TextStyle(color: Colors.white, fontSize: 18),
),
),
),
),
);
},
);
}
}
πŸ‘1
Learning Flutter πŸ“±πŸ’»
Tavsiya etaman: Yandex Maps and Navigator https://play.google.com/store/apps/details?id=ru.yandex.yandexmaps
Yandex ancha yaxshilangan dasturchilar anchagina ter to'kishgan MDH davlatlarida yaxshi ishlasa kere dep oyliman 2 yildan beri ishlataman navigatsiyasi Juda yaxshi biror joyga borsam ancha kere boladi
πŸ‘1πŸ”₯1πŸ‘1
AI menga smile lar yubormas edi lekin mandan nmadir kutgandek smile jo'natadi aka dam bering degandek πŸ₯ΉπŸ₯ΊπŸ™‚
πŸ‘1πŸ”₯1πŸ‘1
This media is not supported in your browser
VIEW IN TELEGRAM
Production ga chiqgan ilovaga ozgina codini o'zgartirsang πŸ”₯
πŸ”₯1😁1
This media is not supported in your browser
VIEW IN TELEGRAM
Bu Telefonni yaxshi tomoni qaramasdan ham yozish mumkin edi πŸ‘¨β€πŸ¦³
πŸ‘1πŸ”₯1
This media is not supported in your browser
VIEW IN TELEGRAM
Binary xisoblash qanday ishlaydi
πŸ‘1πŸ”₯1πŸ‘1
Ha "Oila" 😁
πŸ”₯1😁1🀣1
Adashganlar Soni 7 millionga yetadi
Qanaqa tushunish mumkin buni
Misol uhlaganda kitobini yostiq tagiga qo'ysang kitobini ertalabgacha yodlab olasan degan dek gap bu
Ha hali 6G test rejimida πŸ˜‚πŸ˜‚
πŸ‘1πŸ‘1😁1
It's true
😁1
If else ga misol keltirin deyishsa
😁1