Transperant Background and Button Multiple Background Color in Flutter

Transperant Background and Button Multiple Background Color in Flutter :

Screenshot :

Transperant Background and Button Multiple Background Color in Flutter

main.dart

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:transparent_image/transparent_image.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Tutorial',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(
        title: 'Flutter Tutorial',
      ),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  bool _tapped1 = false;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        body: Stack(children: <Widget>[
      Column(mainAxisSize: MainAxisSize.max, children: <Widget>[
        Expanded(
            child: Container(
                child: Opacity(
                    opacity: 0.95,
                    child: FadeInImage(
                      placeholder: MemoryImage(kTransparentImage),
                      image: const AssetImage('assets/carrom.jpg'),
                      fit: BoxFit.cover,
                    ))))
      ]),
      Column(children: <Widget>[
        Expanded(
            child: Container(
                child: Center(
                    child: Container(
                        height: 50,
                        decoration: BoxDecoration(
                            gradient: LinearGradient(
                          begin: Alignment.topLeft,
                          end: Alignment.bottomRight,
                          colors: <Color>[
                            Colors.black,
                            Colors.red,
                          ],
                          stops: const <double>[0.5, 0.5],
                        )),
                        child: Center(
                            child: Text(
                          'Flutter Tutorial',
                          textAlign: TextAlign.center,
                          style: TextStyle(
                              color: Colors.white, fontWeight: FontWeight.bold),
                        )))))),
        Expanded(
            child: SafeArea(
                child: Padding(
                    padding: const EdgeInsets.all(40.0),
                    child: Row(children: <Widget>[
                      Expanded(
                          child: FlatButton(
                              shape: RoundedRectangleBorder(
                                borderRadius: BorderRadius.circular(10.0),
                              ),
                              child: Padding(
                                padding: const EdgeInsets.all(10.0),
                                child: Text(
                                  'Start Game',
                                  style: TextStyle(
                                    color:
                                        _tapped1 ? Colors.blue : Colors.white,
                                    fontSize: 18.0,
                                  ),
                                ),
                              ),
                              color: _tapped1
                                  ? Colors.white
                                  : Colors.black.withOpacity(0.25),
                              onPressed: () {}))
                    ]))))
      ])
    ]));
  }
}

pubspec.yaml

name: flutter_ticket_pass
description: A new Flutter application.
version: 1.0.0+1

environment:
  sdk: ">=2.1.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter

  cupertino_icons: ^0.1.2
  transparent_image:

dev_dependencies:
  flutter_test:
    sdk: flutter

flutter:
  uses-material-design: true

  assets:
    - assets/carrom.jpg

The flutter tutorial  is a website that bring you the latest and amazing resources of code. All the languages codes are included in this website. The languages like flutter, android, java,kotlin etc.with the help of this languages any user can develop the beautiful application

For more information about Flutter. visit www.fluttertutorial.in