import 'package:flutter/material.dart'; class Lang extends StatefulWidget { const Lang({ Key? key, }) : super(key: key); @override State createState() => _LangState(); } class _LangState extends State { bool _hasBeenPressed = false; @override Widget build(BuildContext context) { return Padding( padding: const EdgeInsets.all(8.0), child: Row( children: [ ElevatedButton( onPressed: () => { setState(() { _hasBeenPressed = !_hasBeenPressed; }) }, style: ElevatedButton.styleFrom( backgroundColor: _hasBeenPressed ? Colors.white.withOpacity(0.4) : Color(0xffFF6600), shape: RoundedRectangleBorder( borderRadius: BorderRadius.only( topLeft: Radius.circular(30), bottomLeft: Radius.circular(30)))), child: Text( 'EN', style: TextStyle(color: Colors.white), )), ElevatedButton( onPressed: () => { setState(() { _hasBeenPressed = !_hasBeenPressed; }) }, style: ElevatedButton.styleFrom( backgroundColor: _hasBeenPressed ? Color(0xffFF6600) : Colors.white.withOpacity(0.4), shape: RoundedRectangleBorder( borderRadius: BorderRadius.only( topRight: Radius.circular(30), bottomRight: Radius.circular(30)))), child: Text( 'ID', style: TextStyle(color: Colors.white), )), ], ), ); } }