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/material.dart'; | |
import 'package:flutter/services.dart'; | |
import 'package:flutter/widgets.dart'; | |
import 'package:gladstoriesengine/gladstoriesengine.dart'; | |
import 'package:locadeserta/InheritedAuth.dart'; | |
import 'package:locadeserta/components/app_bar_custom.dart'; | |
import 'package:locadeserta/components/bordered_container.dart'; | |
import 'package:locadeserta/components/narrow_scaffold.dart'; | |
import 'package:locadeserta/creator/components/edit_story.dart'; | |
import 'package:locadeserta/creator/story/persistence.dart'; |
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/material.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( |
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
Expanded( | |
child: SingleChildScrollView( | |
controller: _passageScrollController, | |
child: Column( | |
children: [ | |
...widget.currentStory.storyHistory.getHistory().map((var passageItem) { | |
if (passageItem == null) { | |
return Container(); | |
} | |
Widget container; |
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
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: Text('Call Center'), | |
), | |
body: StreamBuilder( | |
stream: callCenter.changes, | |
builder: (context, snapshot) { | |
return Column( | |
children: _buildBody() + |
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
Widget _buildQueueView(List<Call> queueCalls) { | |
return Column( | |
// mainAxisAlignment: MainAxisAlignment.center, | |
children: queueCalls.map((call) => Text(call.msg)).toList()); | |
} |
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
Widget _buildResponderRow(List<Responder> group) { | |
return Container( | |
height: 100.0, | |
child: ListView.builder( | |
itemCount: group.length, | |
scrollDirection: Axis.horizontal, | |
itemBuilder: (context, index) { | |
return _buildResponderView(group[index]); | |
}, | |
), |
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
Widget _buildResponderView(Responder responder) { | |
return Padding( | |
padding: const EdgeInsets.all(8.0), | |
child: Column( | |
mainAxisAlignment: MainAxisAlignment.start, | |
children: [ | |
Text( | |
responder.name, | |
style: TextStyle( | |
color: responder.isBusy() ? Colors.red : Colors.green, |
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
callEnded() { | |
if (queueCalls.length > 0) { | |
dispatchCall(queueCalls[0]); | |
queueCalls.removeAt(0); | |
} | |
} |
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
dispatchCall(Call call) { | |
Responder processor; | |
for (var i = 0; i < allProcessors.length; i++) { | |
try { | |
processor = allProcessors[i].firstWhere((Responder p) => !p.isBusy()); | |
} catch (e) { | |
print('Switching to next level'); | |
continue; | |
} | |
if (processor != null) { |