lang.dart 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. import 'package:flutter/material.dart';
  2. class Lang extends StatefulWidget {
  3. const Lang({
  4. Key? key,
  5. }) : super(key: key);
  6. @override
  7. State<Lang> createState() => _LangState();
  8. }
  9. class _LangState extends State<Lang> {
  10. var selectedIndex = 0;
  11. // void _changeLang() {
  12. // setState(() {
  13. // if (selectedIndex == 0) {
  14. // } else {
  15. // }
  16. // });
  17. // }
  18. @override
  19. Widget build(BuildContext context) {
  20. return Padding(
  21. padding: const EdgeInsets.all(8.0),
  22. child: Row(
  23. children: [
  24. Expanded(child: Container()),
  25. ElevatedButton(
  26. onPressed: () {
  27. print('EN');
  28. },
  29. style: ButtonStyle(
  30. foregroundColor: MaterialStateProperty.all<Color>(Colors.white),
  31. backgroundColor:
  32. MaterialStateProperty.all<Color>(Colors.white70),
  33. shape: MaterialStateProperty.all<RoundedRectangleBorder>(
  34. RoundedRectangleBorder(
  35. borderRadius: BorderRadius.only(
  36. topLeft: Radius.circular(20),
  37. bottomLeft: Radius.circular(20)),
  38. ))),
  39. child: Text('EN'),
  40. ),
  41. ElevatedButton(
  42. onPressed: () {
  43. print('ID');
  44. },
  45. style: ButtonStyle(
  46. foregroundColor:
  47. MaterialStateProperty.all<Color>(Colors.white),
  48. backgroundColor: MaterialStateProperty.all<Color>(Colors.red),
  49. shape: MaterialStateProperty.all<RoundedRectangleBorder>(
  50. RoundedRectangleBorder(
  51. borderRadius: BorderRadius.only(
  52. topRight: Radius.circular(20),
  53. bottomRight: Radius.circular(20)),
  54. side: BorderSide(color: Colors.red),
  55. ))),
  56. child: Text('ID'))
  57. ],
  58. ),
  59. );
  60. }
  61. }