-
-
Save albertdugba/b322f28b63b0e49e8c5714965b511135 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Scaffold( | |
appBar: AppBar( | |
title: AutoSizeText('Doctors List'), | |
bottom: PreferredSize(child: Row(children: <Widget>[ | |
customButton((){},Icons.filter,'Filter'), | |
customButton((){},Icons.filter,'Filter'), | |
customButton((){},Icons.filter,'Filter'), | |
],), preferredSize: Size.fromHeight(70)), | |
) | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/cupertino.dart'; | |
import 'package:flutter/material.dart'; | |
class ConnectAccountPage extends StatefulWidget { | |
@override | |
_ConnectAccountPageState createState() => _ConnectAccountPageState(); | |
} | |
class _ConnectAccountPageState extends State<ConnectAccountPage> { | |
int sharedValue = 0; | |
final Map<int, Widget> logoWidgets = const <int, Widget>{ | |
0: Text('Accepted'), | |
1: Text('Pending'), | |
}; | |
List<Widget> _children = [ | |
AcceptedListPage(), | |
PendingListPage(), | |
]; | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
body: Column( | |
children: <Widget>[ | |
Container( | |
width: MediaQuery.of(context).size.width, | |
height: 50, | |
padding: const EdgeInsets.all(8), | |
child: CupertinoSegmentedControl<int>( | |
selectedColor: Colors.red, | |
borderColor: Colors.red, | |
children: logoWidgets, | |
onValueChanged: (int val) { | |
setState(() { | |
sharedValue = val; | |
}); | |
}, | |
groupValue: sharedValue, | |
), | |
), | |
Expanded( | |
child: _children[sharedValue], | |
), | |
], | |
)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment