flutter_nextcloud 0.6.0
flutter_nextcloud: ^0.6.0 copied to clipboard
A Flutter package for browsing, downloading, and managing files from Nextcloud servers via WebDAV protocol.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:flutter_nextcloud/flutter_nextcloud.dart';
import 'custom_ui_example.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Nextcloud Example',
debugShowCheckedModeBanner: false,
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue),
useMaterial3: true,
),
home: const HomePage(),
);
}
}
class HomePage extends StatelessWidget {
const HomePage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Flutter Nextcloud Examples'),
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
),
body: Center(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
const Text(
'Select an example to run:',
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
textAlign: TextAlign.center,
),
const SizedBox(height: 32),
ElevatedButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const ConfigurationScreen(
title: 'Default UI Example',
),
),
);
},
style: ElevatedButton.styleFrom(
padding: const EdgeInsets.all(20),
),
child: const Column(
children: [
Icon(Icons.view_quilt, size: 32),
SizedBox(height: 8),
Text('Default UI', style: TextStyle(fontSize: 18)),
Text('Uses the pre-built widgets',
style: TextStyle(fontSize: 12)),
],
),
),
const SizedBox(height: 16),
ElevatedButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const CustomUIExample(),
),
);
},
style: ElevatedButton.styleFrom(
padding: const EdgeInsets.all(20),
),
child: const Column(
children: [
Icon(Icons.code, size: 32),
SizedBox(height: 8),
Text('Custom UI', style: TextStyle(fontSize: 18)),
Text('Uses the API directly',
style: TextStyle(fontSize: 12)),
],
),
),
],
),
),
),
);
}
}