feat : button , outlined button
fab button , fab outlined button , input , pagination widget's
This commit is contained in:
115
lib/presentation/widget/tabs/tab.dart
Normal file
115
lib/presentation/widget/tabs/tab.dart
Normal file
@@ -0,0 +1,115 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_app/presentation/common/app_color.dart';
|
||||
import 'package:rasadyar_app/presentation/common/app_fonts.dart';
|
||||
|
||||
import 'new_tab.dart';
|
||||
|
||||
class CupertinoSegmentedControlDemo extends StatefulWidget {
|
||||
const CupertinoSegmentedControlDemo({super.key});
|
||||
|
||||
@override
|
||||
State<CupertinoSegmentedControlDemo> createState() =>
|
||||
_CupertinoSegmentedControlDemoState();
|
||||
}
|
||||
|
||||
class _CupertinoSegmentedControlDemoState
|
||||
extends State<CupertinoSegmentedControlDemo> {
|
||||
int _selectedSegment = 0;
|
||||
|
||||
// The data for the segments
|
||||
final Map<int, Widget> _segments = const {
|
||||
0: Text('Segment 1'),
|
||||
1: Text('Segment 2'),
|
||||
2: Text('Segment 3'),
|
||||
};
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SafeArea(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
CupertinoSlidingSegmentedControl<int>(
|
||||
children: _segments,
|
||||
groupValue: _selectedSegment,
|
||||
|
||||
onValueChanged: (int? value) {
|
||||
setState(() {
|
||||
_selectedSegment = value!;
|
||||
});
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Text(
|
||||
'Selected Segment: ${_selectedSegment + 1}',
|
||||
style: const TextStyle(fontSize: 24),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class CupertinoSegmentedControlDemo2 extends StatefulWidget {
|
||||
const CupertinoSegmentedControlDemo2({super.key});
|
||||
|
||||
@override
|
||||
State<CupertinoSegmentedControlDemo2> createState() =>
|
||||
_CupertinoSegmentedControlDemoState2();
|
||||
}
|
||||
|
||||
class _CupertinoSegmentedControlDemoState2
|
||||
extends State<CupertinoSegmentedControlDemo2> {
|
||||
int _selectedSegment = 0;
|
||||
|
||||
// The data for the segments
|
||||
final Map<int, Widget> _segments = {
|
||||
0:Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(50)
|
||||
),
|
||||
child: Text('لاشه', style: AppFonts.yekan13Regular),
|
||||
),
|
||||
1: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(50)
|
||||
),
|
||||
child: Text('زنده', style: AppFonts.yekan13Regular),
|
||||
),
|
||||
};
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SafeArea(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
NewCupertinoSegmentedControl<int>(
|
||||
padding: EdgeInsetsDirectional.symmetric(
|
||||
horizontal: 20,
|
||||
vertical: 10,
|
||||
),
|
||||
children: _segments,
|
||||
groupValue: _selectedSegment,
|
||||
selectedColor: AppColor.blueNormal,
|
||||
unselectedColor: Colors.white,
|
||||
borderColor: Colors.grey.shade300,
|
||||
onValueChanged: (int value) {
|
||||
setState(() {
|
||||
_selectedSegment = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Text(
|
||||
'Selected Segment: ${_selectedSegment + 1}',
|
||||
style: const TextStyle(fontSize: 24),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user