123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- import 'package:flutter/material.dart';
- class Lang extends StatefulWidget {
- const Lang({
- Key? key,
- }) : super(key: key);
- @override
- State<Lang> createState() => _LangState();
- }
- class _LangState extends State<Lang> {
- 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),
- )),
- ],
- ),
- );
- }
- }
|