import 'package:flutter/material.dart'; import 'package:xdga_directories/xdga_directories.dart' as xdga_directories; void main() { runApp(const MyApp()); } class MyApp extends StatefulWidget { const MyApp({super.key}); @override _MyAppState createState() => _MyAppState(); } class _MyAppState extends State { late String cacheLocation; late String documentsLocation; late String downloadLocation; late String musicLocation; late String picturesLocation; late String genericDataLocation; late String moviesLocation; @override void initState() { super.initState(); cacheLocation = xdga_directories.getCacheLocation(); documentsLocation = xdga_directories.getDocumentsLocation(); downloadLocation = xdga_directories.getDownloadLocation(); musicLocation = xdga_directories.getMusicLocation(); picturesLocation = xdga_directories.getPicturesLocation(); genericDataLocation = xdga_directories.getGenericDataLocation(); moviesLocation = xdga_directories.getMoviesLocation(); } @override Widget build(BuildContext context) { const textStyleNormal = TextStyle(fontSize: 20); final textStyleSmall = const TextStyle(fontSize: 18).copyWith(color: Colors.black54); const spacerNormal = SizedBox(height: 16); const spacerSmall = SizedBox(height: 8); return MaterialApp( home: Scaffold( appBar: AppBar( title: const Text('Directories Example'), ), body: SingleChildScrollView( child: Container( padding: const EdgeInsets.all(10), child: Column( children: [ Container( decoration: const BoxDecoration( color: Colors.green, borderRadius: BorderRadius.all(Radius.circular(10.0))), child: Padding( padding: const EdgeInsets.all(20), child: Text( 'A Dart package for reading directory path on Aurora OS.', style: textStyleNormal.copyWith(color: Colors.white), textAlign: TextAlign.center, ), ), ), const SizedBox(height: 30), const Text( 'getCacheLocation()', style: textStyleNormal, textAlign: TextAlign.center, ), spacerSmall, Text( cacheLocation, style: textStyleSmall, textAlign: TextAlign.center, ), spacerNormal, const Text( 'getDocumentsLocation()', style: textStyleNormal, textAlign: TextAlign.center, ), spacerSmall, Text( documentsLocation, style: textStyleSmall, textAlign: TextAlign.center, ), spacerNormal, const Text( 'getDownloadLocation()', style: textStyleNormal, textAlign: TextAlign.center, ), spacerSmall, Text( downloadLocation, style: textStyleSmall, textAlign: TextAlign.center, ), spacerNormal, const Text( 'getMusicLocation()', style: textStyleNormal, textAlign: TextAlign.center, ), spacerSmall, Text( musicLocation, style: textStyleSmall, textAlign: TextAlign.center, ), spacerNormal, const Text( 'getPicturesLocation()', style: textStyleNormal, textAlign: TextAlign.center, ), spacerSmall, Text( picturesLocation, style: textStyleSmall, textAlign: TextAlign.center, ), spacerNormal, const Text( 'getGenericDataLocation()', style: textStyleNormal, textAlign: TextAlign.center, ), spacerSmall, Text( genericDataLocation, style: textStyleSmall, textAlign: TextAlign.center, ), spacerNormal, const Text( 'getMoviesLocation()', style: textStyleNormal, textAlign: TextAlign.center, ), spacerSmall, Text( moviesLocation, style: textStyleSmall, textAlign: TextAlign.center, ), ], ), ), ), ), ); } }