example app: allow scroll in connect page

This commit is contained in:
Hiroshi Horie
2021-10-28 02:14:52 +09:00
parent 8d80a9296a
commit a0a9acc9d9
3 changed files with 66 additions and 63 deletions
+64 -61
View File
@@ -110,74 +110,77 @@ class _ConnectPageState extends State<ConnectPage> {
Widget build(BuildContext context) => Scaffold(
body: Container(
alignment: Alignment.center,
child: Container(
padding: const EdgeInsets.symmetric(
horizontal: 20,
),
constraints: const BoxConstraints(maxWidth: 400),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Padding(
padding: const EdgeInsets.only(bottom: 70),
child: SvgPicture.asset(
'images/logo-dark.svg',
child: SingleChildScrollView(
child: Container(
padding: const EdgeInsets.symmetric(
horizontal: 20,
vertical: 20,
),
constraints: const BoxConstraints(maxWidth: 400),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Padding(
padding: const EdgeInsets.only(bottom: 70),
child: SvgPicture.asset(
'images/logo-dark.svg',
),
),
),
Padding(
padding: const EdgeInsets.only(bottom: 25),
child: LKTextField(
label: 'Server URL',
ctrl: _uriCtrl,
Padding(
padding: const EdgeInsets.only(bottom: 25),
child: LKTextField(
label: 'Server URL',
ctrl: _uriCtrl,
),
),
),
Padding(
padding: const EdgeInsets.only(bottom: 25),
child: LKTextField(
label: 'Token',
ctrl: _tokenCtrl,
Padding(
padding: const EdgeInsets.only(bottom: 25),
child: LKTextField(
label: 'Token',
ctrl: _tokenCtrl,
),
),
),
Padding(
padding: const EdgeInsets.only(bottom: 50),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const Text('Simulcast'),
Switch(
value: _simulcast,
onChanged: (value) => _setSimulcast(value),
inactiveTrackColor: Colors.white.withOpacity(.2),
activeTrackColor: LKColors.lkBlue,
inactiveThumbColor: Colors.white.withOpacity(.5),
activeColor: Colors.white,
),
],
Padding(
padding: const EdgeInsets.only(bottom: 50),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const Text('Simulcast'),
Switch(
value: _simulcast,
onChanged: (value) => _setSimulcast(value),
inactiveTrackColor: Colors.white.withOpacity(.2),
activeTrackColor: LKColors.lkBlue,
inactiveThumbColor: Colors.white.withOpacity(.5),
activeColor: Colors.white,
),
],
),
),
),
ElevatedButton(
onPressed: _busy ? null : () => _connect(context),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
if (_busy)
const Padding(
padding: EdgeInsets.only(right: 10),
child: SizedBox(
height: 15,
width: 15,
child: CircularProgressIndicator(
color: Colors.white,
strokeWidth: 2,
ElevatedButton(
onPressed: _busy ? null : () => _connect(context),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
if (_busy)
const Padding(
padding: EdgeInsets.only(right: 10),
child: SizedBox(
height: 15,
width: 15,
child: CircularProgressIndicator(
color: Colors.white,
strokeWidth: 2,
),
),
),
),
const Text('CONNECT'),
],
const Text('CONNECT'),
],
),
),
),
],
],
),
),
),
),
+1 -1
View File
@@ -76,7 +76,7 @@ class LocalParticipant extends Participant {
final pub = LocalTrackPublication(trackInfo, track, this);
addTrackPublication(pub);
[events, roomEvents].emit(TrackPublishedEvent(
participant: this,
publication: pub,
+1 -1
View File
@@ -41,7 +41,7 @@ class LocalVideoTrack extends VideoTrack {
// stop the current track & stream
await mediaStreamTrack.stop();
await mediaStream.dispose();
// create new track with options
final newStream = await _createStream(currentOptions);
final newTrack = newStream.getVideoTracks().first;