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. ElevatedButton(
  25. onPressed: () {
  26. print('EN');
  27. },
  28. style: ButtonStyle(
  29. foregroundColor: MaterialStateProperty.all<Color>(Colors.white),
  30. backgroundColor:
  31. MaterialStateProperty.all<Color>(Colors.white70),
  32. shape: MaterialStateProperty.all<RoundedRectangleBorder>(
  33. RoundedRectangleBorder(
  34. borderRadius: BorderRadius.only(
  35. topLeft: Radius.circular(16),
  36. bottomLeft: Radius.circular(16)),
  37. ))),
  38. child: Text('EN'),
  39. ),
  40. ElevatedButton(
  41. onPressed: () {
  42. print('ID');
  43. },
  44. style: ButtonStyle(
  45. foregroundColor:
  46. MaterialStateProperty.all<Color>(Colors.white),
  47. backgroundColor:
  48. MaterialStateProperty.all<Color>(Color(0xffFF6600)),
  49. shape: MaterialStateProperty.all<RoundedRectangleBorder>(
  50. RoundedRectangleBorder(
  51. borderRadius: BorderRadius.only(
  52. topRight: Radius.circular(16),
  53. bottomRight: Radius.circular(16)),
  54. side: BorderSide(color: Color(0xffFF6600)),
  55. ))),
  56. child: Text('ID'))
  57. ],
  58. ),
  59. );
  60. }
  61. }