import 'package:flutter/material.dart'; import 'User.dart' as User; import 'main.dart'; class TodoPage extends StatefulWidget { const TodoPage({Key? key}) : super(key: key); @override State createState() => _TodoPageState(); } class _TodoPageState extends State { @override Widget build(BuildContext context) { return SafeArea(child: Scaffold( floatingActionButton: FloatingActionButton.extended( onPressed: () { // Navigator.of(context).push(MaterialPageRoute(builder: (context) => NewTodo())).then((value) => {User.refreshUserData().then((va) => {})}); }, label: Text("New Todo"), icon: Icon(Icons.add)), appBar: AppBar( title: Column( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.end, children: [ Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row(children: [Icon(Icons.check, color: Theme.of(context).primaryColor), SizedBox(width: 10), Text('Todo')]), Row( children: [ (User.offline) ? Icon(Icons.signal_cellular_connected_no_internet_4_bar_outlined) : InkWell( onTap: () { setState(() { //LoadStats(); }); }, child: Icon(Icons.refresh, size: 30), ) ], ) ], ), //Container(color: Colors.red,child: Text("Offline",style:TextStyle(fontSize: 5))), ], )), drawer: navDrawer(context, 7), body: Column( children: PrintTodos(), ), )); } List PrintTodos(){ List todos = []; todos.forEach((element) { }); todos.add(prioritySeperator('- High Priority (0)')); todos.add(prioritySeperator('- Low Priority (0)')); return todos; } Widget todoItem(String name){ return Row(children:[Text(name)]); } Widget prioritySeperator(String text){ return Padding( padding: const EdgeInsets.fromLTRB(15,15,15,0), child: Row( children: [Text(text,style:TextStyle(fontSize: 18, color: Colors.grey))], ), ); } }