Skip to content

Instantly share code, notes, and snippets.

View gajendrapandeya's full-sized avatar

Gajendra Pandeya gajendrapandeya

View GitHub Profile
@override
Widget build(BuildContext context) {
return Center(
child: Stack(
children: [
CustomPaint(
size: const Size(200.0, 200.0),
painter: MyPainter(
progress: _controller.value,
defaultColor: Colors.grey,
import 'dart:math';
import 'package:flutter/material.dart';
class RingPainter extends StatefulWidget {
const RingPainter({Key? key}) : super(key: key);
@override
State<RingPainter> createState() => _RingPainterState();
}
@override
void paint(Canvas canvas, Size size) {
final strokeWidth = size.width / 15.0;
final circleCenter = Offset(size.width / 2, size.height / 2);
final circleRadius = (size.width - strokeWidth) / 2;
final paint = Paint()
..color = Colors.grey
..strokeWidth = strokeWidth
..style = PaintingStyle.stroke;
@override
void paint(Canvas canvas, Size size) {
final strokeWidth = size.width / 15.0;
final circleCenter = Offset(size.width / 2, size.height / 2);
final circleRadius = (size.width - strokeWidth) / 2;
final paint = Paint()
..color = Colors.grey
..strokeWidth = strokeWidth
..style = PaintingStyle.stroke;
class RingPainter extends StatelessWidget {
const RingPainter({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Center(
child: CustomPaint(
size: Size(200.0, 200.0),
painter: MyPainter(),
),
import 'package:flutter/material.dart';
enum Options { search, upload, copy, exit }
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({Key? key}) : super(key: key);
enum Options { search, upload, copy, exit }
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({Key? key}) : super(key: key);
@override
_buildAppBar() {
return AppBar(
title: const Text(
'Popup Menus',
style: TextStyle(color: Colors.white, fontSize: 16.0),
),
actions: [
PopupMenuButton(
itemBuilder: (ctx) => [
_buildPopupMenuItem('Search', Icons.search),
_buildAppBar() {
return AppBar(
title: const Text(
'Popup Menus',
style: TextStyle(color: Colors.white, fontSize: 16.0),
),
actions: [
PopupMenuButton(
itemBuilder: (ctx) => [
_buildPopupMenuItem('Search'),
import 'package:flutter/material.dart';
enum Options { search, upload, copy, exit }
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({Key? key}) : super(key: key);