Raise Button Widget in Flutter


Here is the simple program for printing the raised button widget in Flutter.


Source Code

import 'package:flutter/material.dart';
void main() {
  runApp(MaterialApp(
    home: MyApp(),
  ));
}
class MyApp extends StatefulWidget {
  @override
  _State createState() => _State();
}
class _State extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Raised Button'),
      ),
      body: Center(
        /*child: RaisedButton(
          color: Colors.red,
          textColor: Colors.white,
          child: Text("Click Me"),
          splashColor: Colors.blue,
          disabledColor: Colors.teal,
          disabledTextColor: Colors.red,
          onPressed: () {},
        ),*/
        child: RaisedButton(
          onPressed: () {},
          textColor: Colors.white,
          padding: const EdgeInsets.all(0.0),
          child: Container(
            child: Text(
              'Click Me',
              style: TextStyle(fontSize: 20.0),
            ),
            padding: const EdgeInsets.all(15.0),
            decoration: BoxDecoration(
              gradient: LinearGradient(colors: <Color>[
                Color(0xFF0D47A1),
                Color(0xFF1976D2),
                Color(0xFF42A5F5),
              ]),
            ),
          ),
        ),
      ),
    );
  }
}
To download raw file Click Here