import 'package:flutter/material.dart';
void main(){
runApp(MyApp());
}
class MyApp extends StatelessWidget{bool change=false;
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(appBar: AppBar(
title: Text("Gesture Widget"),
backgroundColor: Colors.purple.withOpacity(.50),
),body: Container(constraints: const BoxConstraints.expand(), decoration: BoxDecoration( border: Border.all( color: Colors.transparent, ), ), child: Column( //crossAxisAlignment: CrossAxisAlignment.center, //mainAxisAlignment: MainAxisAlignment.start, children: [ Container( decoration: BoxDecoration( border: Border.all( color: Colors.transparent, ), ), child: GestureDetector( child: Container( color: change ? Colors.pink : Colors.green, width: 100, height: 100, ), onTap:(){ setState((){ change=!change; }); }, ), ), ], ), ),),
); 💪 // MaterialApp
}
}
Monday, June 13, 2022
About Avinash Developer
Soratemplates is a blogger resources site is a provider of high quality blogger template with premium looking layout and robust design. The main mission of templatesyard is to provide the best quality blogger templates.
Subscribe to:
Post Comments (Atom)
Featured post
Compress Image With Show File Size & Resolution in Flutter
Compress Image With Show File Size & Resolution 1.Multiple File Image Compress with file Size import 'dart:io' ; import 'p...
No comments:
Post a Comment