Skip to content

Commit af7e7b8

Browse files
committed
Re-added the refresh and add button on homepage for Desktop
1 parent 75c25d2 commit af7e7b8

File tree

1 file changed

+85
-49
lines changed

1 file changed

+85
-49
lines changed

lib/homepage.dart

Lines changed: 85 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -457,70 +457,106 @@ class _HomePageState extends State<HomePage> {
457457
query.size.width > query.size.height);
458458
final page = Center(
459459
child: Container(
460-
padding: isLandscape? EdgeInsets.zero : const EdgeInsets.all(16.0),
461460
constraints: BoxConstraints(
462461
minHeight: MediaQuery.of(context).size.height - 34,
463462
minWidth: double.infinity),
464-
child:
465-
isLandscape?
463+
child: isLandscape
464+
?
466465

467466
/// ==================
468467
/// The windows layout
469468
/// ==================
470-
DesktopTabBar(
471-
tabs: <DesktopTabData>[
472-
DesktopTabData(icon: const Icon(Icons.featured_play_list), title: const Text("Projects")),
473-
DesktopTabData(icon: const Icon(Icons.input), title: const Text("Plugins")),
474-
DesktopTabData(icon: const Icon(Icons.settings), title: const Text("Settings")),
475-
],
476-
content:<Widget>[
477-
Column(children:projectsWidgetList),
478-
const PluginsBrowser(),
479-
SettingsPage(mm),
480-
])
469+
DesktopTabBar(tabs: <DesktopTabData>[
470+
DesktopTabData(
471+
icon: const Icon(Icons.featured_play_list),
472+
title: const Text("Projects")),
473+
DesktopTabData(
474+
icon: const Icon(Icons.input), title: const Text("Plugins")),
475+
DesktopTabData(
476+
icon: const Icon(Icons.settings),
477+
title: const Text("Settings")),
478+
], content: <Widget>[
479+
Padding(
480+
padding: const EdgeInsets.all(16.0),
481+
child: Column(
482+
crossAxisAlignment: CrossAxisAlignment.stretch,
483+
children: [
484+
Row(children: [
485+
const Text(
486+
"Recent Projects",
487+
style: TextStyle(
488+
fontWeight: FontWeight.bold,
489+
fontSize: 24.0,
490+
),
491+
),
492+
const Spacer(flex: 1),
493+
OutlinedButton(
494+
onPressed: () {
495+
refreshRecentProjects();
496+
},
497+
child: const Text("Refresh"),
498+
),
499+
OutlinedButton(
500+
onPressed: () {},
501+
child: const Text("Add"),
502+
),
503+
]),
504+
Column(
505+
children: projectsWidgetList,
506+
)
507+
])),
508+
const PluginsBrowser(),
509+
SettingsPage(mm),
510+
])
481511
:
482512

483513
/// ==================
484514
/// The android layout
485515
/// ==================
486-
Column(crossAxisAlignment: CrossAxisAlignment.stretch, children: [
487-
Row(children: [
488-
const Text(
489-
"Recent Projects",
490-
style: TextStyle(
491-
fontWeight: FontWeight.bold,
492-
fontSize: 24.0,
516+
Padding(
517+
padding: const EdgeInsets.all(16.0),
518+
child: Column(
519+
crossAxisAlignment: CrossAxisAlignment.stretch,
520+
children: [
521+
Row(children: [
522+
const Text(
523+
"Recent Projects",
524+
style: TextStyle(
525+
fontWeight: FontWeight.bold,
526+
fontSize: 24.0,
527+
),
493528
),
494-
),
495-
const Spacer(flex: 1),
496-
OutlinedButton(
497-
onPressed: () {
498-
refreshRecentProjects();
499-
},
500-
child: const Text("Refresh"),
501-
),
502-
OutlinedButton(
503-
onPressed: () {},
504-
child: const Text("Add"),
505-
),
506-
]),
507-
Column(
508-
children: projectsWidgetList,
509-
)
510-
]),
529+
const Spacer(flex: 1),
530+
OutlinedButton(
531+
onPressed: () {
532+
refreshRecentProjects();
533+
},
534+
child: const Text("Refresh"),
535+
),
536+
OutlinedButton(
537+
onPressed: () {},
538+
child: const Text("Add"),
539+
),
540+
]),
541+
Column(
542+
children: projectsWidgetList,
543+
)
544+
])),
511545
));
512546
return Scaffold(
513-
appBar: CoreCoderApp.isLandscape(context)? null: AppBar(
514-
title: const Text("CoreCoder Develop"),
515-
centerTitle: true,
516-
actions: [
517-
IconButton(
518-
onPressed: () => {showSettings()},
519-
icon: const Icon(Icons.settings),
520-
tooltip: "Settings"),
521-
const SizedBox(width: 16.0),
522-
],
523-
),
547+
appBar: CoreCoderApp.isLandscape(context)
548+
? null
549+
: AppBar(
550+
title: const Text("CoreCoder Develop"),
551+
centerTitle: true,
552+
actions: [
553+
IconButton(
554+
onPressed: () => {showSettings()},
555+
icon: const Icon(Icons.settings),
556+
tooltip: "Settings"),
557+
const SizedBox(width: 16.0),
558+
],
559+
),
524560
body: SingleChildScrollView(child: page),
525561
floatingActionButton: FloatingActionButton(
526562
onPressed: () => showCreateProjectDialog(),

0 commit comments

Comments
 (0)