Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F78618797
stats_screen.dart
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Aug 22, 00:25
Size
3 KB
Mime Type
text/x-c++
Expires
Sat, Aug 24, 00:25 (2 d)
Engine
blob
Format
Raw Data
Handle
20073397
Attached To
R10646 Orchestration
stats_screen.dart
View Options
import 'package:bubble_tab_indicator/bubble_tab_indicator.dart';
import 'package:flutter/material.dart';
import 'package:Teacher_Dashboard/config/palette.dart';
import 'package:Teacher_Dashboard/config/styles.dart';
import 'package:Teacher_Dashboard/data/data.dart';
import 'package:Teacher_Dashboard/widgets/widgets.dart';
import 'package:Teacher_Dashboard/SoCKet.dart';
import 'package:Teacher_Dashboard/model/Class.dart';
class StatsScreen extends StatefulWidget {
@override
_StatsScreenState createState() => _StatsScreenState();
}
class _StatsScreenState extends State<StatsScreen> {
Widget showTodoList() {
if (thisClass.groups.length > 0) {
print("fromlistview");
return ListView.builder(
shrinkWrap: true,
itemCount: thisClass.groups.length,
itemBuilder: (BuildContext context, int index) {
String todoId = thisClass.groups[index].id;
String subject = thisClass.groups[index].member1name;
// bool completed = thisClass.groups[index].ispaused;
String userId = thisClass.groups[index].member2name;
return Text(
subject,
style: TextStyle(fontSize: 20.0),
);
});
} else {
print("fromlistview");
return Center(
child: Text(
"Welcome. Your list is empty",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 30.0),
));
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Palette.primaryColor,
appBar: CustomAppBar(),
body: CustomScrollView(
physics: ClampingScrollPhysics(),
slivers: <Widget>[
_buildHeader(),
_buildRegionTabBar(),
_buildStatsTabBar(),
SliverPadding(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
sliver: SliverToBoxAdapter(
child: StatsGrid(),
),
),
],
),
);
}
SliverPadding _buildHeader() {
return SliverPadding(
padding: const EdgeInsets.all(20.0),
sliver: SliverToBoxAdapter(
child: Text(
'Aggregated Class',
style: const TextStyle(
color: Colors.white,
fontSize: 25.0,
fontWeight: FontWeight.bold,
),
),
),
);
}
SliverToBoxAdapter _buildRegionTabBar() {
return SliverToBoxAdapter(
child: DefaultTabController(
length: 2,
child: Container(
margin: const EdgeInsets.symmetric(horizontal: 20.0),
height: 50.0,
decoration: BoxDecoration(
color: Colors.white24,
borderRadius: BorderRadius.circular(25.0),
),
child: TabBar(
indicator: BubbleTabIndicator(
tabBarIndicatorSize: TabBarIndicatorSize.tab,
indicatorHeight: 40.0,
indicatorColor: Colors.white,
),
labelStyle: Styles.tabTextStyle,
labelColor: Colors.black,
unselectedLabelColor: Colors.white,
tabs: <Widget>[
Text('Progress'),
Text('All Activities'),
],
onTap: (index) {},
),
),
),
);
}
SliverPadding _buildStatsTabBar() {
return SliverPadding(
padding: const EdgeInsets.all(20.0),
sliver: SliverToBoxAdapter(
child: DefaultTabController(
length: 4,
child: TabBar(
indicatorColor: Colors.transparent,
labelStyle: Styles.tabTextStyle,
labelColor: Colors.white,
unselectedLabelColor: Colors.white60,
tabs: <Widget>[
Text('Group 1'),
Text('Group 2'),
Text('Group 3'),
Text('Group 4'),
],
onTap: (index) {},
),
),
),
);
}
}
Event Timeline
Log In to Comment