Search
 
SCRIPT & CODE EXAMPLE
 

DART

glowing buttons in flutter

Container(
          color: Colors.white,
          width: 300,
          height: 300,
          child: CustomPaint(
            painter: NeonPainter(),

          ),


        ),



class NeonPainter extends CustomPainter {
  Paint neonPaint = Paint();


  NeonPainter() {
    neonPaint.color = const Color(0xFF3F5BFA);
    neonPaint.strokeWidth = 2.5;
    neonPaint.shader = /// how to create a shader or something for that?
    neonPaint.someOtherProperty///

  }

  @override
  void paint(Canvas canvas, Size size) {
    drawLine(canvas, size.width / 2 - 50, size.height / 2, size.width / 2 + 50,
        size.height / 2);
    drawLine(canvas, size.width / 2 + 50, size.height / 2, size.width / 2 + 100,
        size.height / 2 + 50);
    drawLine(canvas, size.width / 2 + 100, size.height / 2 + 50,
        size.width / 2 - 100, size.height / 2 + 50);
    drawLine(
        canvas, size.width / 2 - 100, size.height / 2 + 50, size.width / 2 - 50,
        size.height / 2);
  }

  void drawLine(canvas, double x1, double y1, double x2, double y2) {
    canvas.drawLine(Offset(x1, y1), Offset(x2, y2), neonPaint);
  }

  @override
  bool shouldRepaint(CustomPainter oldDelegate) {
    return true;
  }
}
Comment

PREVIOUS NEXT
Code Example
Dart :: how to parse json with missing key in lfutter 
Dart :: flutter contaienr 
Dart :: custom icon flutter 
Dart :: import intl in flutter 
Dart :: flutter listview top padding 
Dart :: parse string to datetime 
Swift :: firebase crashlytics dsym missing 
Swift :: urlencode string swift 
Swift :: Detect if device is ipad or iphone swift 
Swift :: get length of array swift 
Swift :: get tabbar height swift 
Swift :: firebase nil value equals 
Swift :: How to change the backgroundColor of UIDatePicker or UIPicker ? 
Swift :: get request swift 
Swift :: limit log file size swift 
Swift :: how to get the last element of an array in swift 
Swift :: swift how to sort array 
Swift :: how to disable uitableview scrolling in swift 
Swift :: rotate image animated swift 
Swift :: and in swift6 
Swift :: porsche 
Swift :: swift convert base64 string to data 
Swift :: uitextview placeholder uikit ios 
Swift :: swift close view 
Swift :: swift change navigation bar title 
Swift :: swiftui foreach enum not all cases 
Swift :: swift extension Array where element 
Swift :: How to remove the last item from an array in swift 
Swift :: Swift How to declare an optional in Swift? 
Swift :: swift from 1 to 01 
ADD CONTENT
Topic
Content
Source link
Name
3+5 =