example app: allow scroll in connect page
This commit is contained in:
@@ -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'),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -76,7 +76,7 @@ class LocalParticipant extends Participant {
|
||||
|
||||
final pub = LocalTrackPublication(trackInfo, track, this);
|
||||
addTrackPublication(pub);
|
||||
|
||||
|
||||
[events, roomEvents].emit(TrackPublishedEvent(
|
||||
participant: this,
|
||||
publication: pub,
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user