반응형

 

import 'package:flutter/material.dart';

class GradientScreen extends StatelessWidget {
  const GradientScreen({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('GradientScreen')),
      body: Container(
        decoration: const BoxDecoration(
          gradient: LinearGradient(
            begin: Alignment.topRight,
            end: Alignment.bottomLeft,
            stops: [
              0.1,
              0.4,
              0.6,
              0.9,
            ],
            colors: [
              Colors.yellow,
              Colors.red,
              Colors.indigo,
              Colors.teal,
            ],
          ),
        ),
      ),
    );
  }
}

 

 

 

참고

https://www.digitalocean.com/community/tutorials/flutter-flutter-gradient

https://papabee.tistory.com/83

반응형

+ Recent posts