flutter doctor
flutter doctor
flutter doctor
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo gem install cocoapods
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo gem install cocoapods
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo gem install cocoapods
sudo apt-get install clang cmake ninja-build pkg-config libgtk-3-dev
sudo apt-get install clang cmake ninja-build pkg-config libgtk-3-dev
sudo apt-get install clang cmake ninja-build pkg-config libgtk-3-dev
flutter config --enable-windows-desktop
flutter config --enable-macos-desktop
flutter config --enable-linux-desktop
flutter config --enable-windows-desktop
flutter config --enable-macos-desktop
flutter config --enable-linux-desktop
flutter config --enable-windows-desktop
flutter config --enable-macos-desktop
flutter config --enable-linux-desktop
flutter create my_desktop_app
cd my_desktop_app
flutter create my_desktop_app
cd my_desktop_app
flutter create my_desktop_app
cd my_desktop_app
flutter run -d windows # or -d macos / -d linux
flutter run -d windows # or -d macos / -d linux
flutter run -d windows # or -d macos / -d linux
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:path_provider/path_provider.dart'; void main() { runApp(const MyApp());
} class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return MaterialApp( title: 'NoteDesk', debugShowCheckedModeBanner: false, theme: ThemeData( colorScheme: ColorScheme.fromSeed(seedColor: Colors.indigo), useMaterial3: true, ), home: const NoteScreen(), ); }
} class NoteScreen extends StatefulWidget { const NoteScreen({super.key}); @override State<NoteScreen> createState() => _NoteScreenState();
} class _NoteScreenState extends State<NoteScreen> { final TextEditingController _controller = TextEditingController(); String _status = 'Start typing your note...'; Future<void> _saveNote() async { final directory = await getApplicationDocumentsDirectory(); final file = File('${directory.path}/my_note.txt'); await file.writeAsString(_controller.text); setState(() { _status = 'Note saved to ${file.path}'; }); } Future<void> _loadNote() async { final directory = await getApplicationDocumentsDirectory(); final file = File('${directory.path}/my_note.txt'); if (await file.exists()) { final content = await file.readAsString(); setState(() { _controller.text = content; _status = 'Note loaded successfully'; }); } } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text('NoteDesk'), backgroundColor: Colors.indigo, foregroundColor: Colors.white, actions: [ IconButton( icon: const Icon(Icons.folder_open), tooltip: 'Load Note', onPressed: _loadNote, ), IconButton( icon: const Icon(Icons.save), tooltip: 'Save Note', onPressed: _saveNote, ), ], ), body: Padding( padding: const EdgeInsets.all(16.0), child: Column( children: [ Expanded( child: TextField( controller: _controller, maxLines: null, expands: true, keyboardType: TextInputType.multiline, style: const TextStyle(fontSize: 16), decoration: const InputDecoration( hintText: 'Write your note here...', border: OutlineInputBorder(), ), ), ), const SizedBox(height: 12), Text( _status, style: const TextStyle(color: Colors.grey, fontSize: 13), ), ], ), ), ); }
}
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:path_provider/path_provider.dart'; void main() { runApp(const MyApp());
} class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return MaterialApp( title: 'NoteDesk', debugShowCheckedModeBanner: false, theme: ThemeData( colorScheme: ColorScheme.fromSeed(seedColor: Colors.indigo), useMaterial3: true, ), home: const NoteScreen(), ); }
} class NoteScreen extends StatefulWidget { const NoteScreen({super.key}); @override State<NoteScreen> createState() => _NoteScreenState();
} class _NoteScreenState extends State<NoteScreen> { final TextEditingController _controller = TextEditingController(); String _status = 'Start typing your note...'; Future<void> _saveNote() async { final directory = await getApplicationDocumentsDirectory(); final file = File('${directory.path}/my_note.txt'); await file.writeAsString(_controller.text); setState(() { _status = 'Note saved to ${file.path}'; }); } Future<void> _loadNote() async { final directory = await getApplicationDocumentsDirectory(); final file = File('${directory.path}/my_note.txt'); if (await file.exists()) { final content = await file.readAsString(); setState(() { _controller.text = content; _status = 'Note loaded successfully'; }); } } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text('NoteDesk'), backgroundColor: Colors.indigo, foregroundColor: Colors.white, actions: [ IconButton( icon: const Icon(Icons.folder_open), tooltip: 'Load Note', onPressed: _loadNote, ), IconButton( icon: const Icon(Icons.save), tooltip: 'Save Note', onPressed: _saveNote, ), ], ), body: Padding( padding: const EdgeInsets.all(16.0), child: Column( children: [ Expanded( child: TextField( controller: _controller, maxLines: null, expands: true, keyboardType: TextInputType.multiline, style: const TextStyle(fontSize: 16), decoration: const InputDecoration( hintText: 'Write your note here...', border: OutlineInputBorder(), ), ), ), const SizedBox(height: 12), Text( _status, style: const TextStyle(color: Colors.grey, fontSize: 13), ), ], ), ), ); }
}
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:path_provider/path_provider.dart'; void main() { runApp(const MyApp());
} class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return MaterialApp( title: 'NoteDesk', debugShowCheckedModeBanner: false, theme: ThemeData( colorScheme: ColorScheme.fromSeed(seedColor: Colors.indigo), useMaterial3: true, ), home: const NoteScreen(), ); }
} class NoteScreen extends StatefulWidget { const NoteScreen({super.key}); @override State<NoteScreen> createState() => _NoteScreenState();
} class _NoteScreenState extends State<NoteScreen> { final TextEditingController _controller = TextEditingController(); String _status = 'Start typing your note...'; Future<void> _saveNote() async { final directory = await getApplicationDocumentsDirectory(); final file = File('${directory.path}/my_note.txt'); await file.writeAsString(_controller.text); setState(() { _status = 'Note saved to ${file.path}'; }); } Future<void> _loadNote() async { final directory = await getApplicationDocumentsDirectory(); final file = File('${directory.path}/my_note.txt'); if (await file.exists()) { final content = await file.readAsString(); setState(() { _controller.text = content; _status = 'Note loaded successfully'; }); } } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text('NoteDesk'), backgroundColor: Colors.indigo, foregroundColor: Colors.white, actions: [ IconButton( icon: const Icon(Icons.folder_open), tooltip: 'Load Note', onPressed: _loadNote, ), IconButton( icon: const Icon(Icons.save), tooltip: 'Save Note', onPressed: _saveNote, ), ], ), body: Padding( padding: const EdgeInsets.all(16.0), child: Column( children: [ Expanded( child: TextField( controller: _controller, maxLines: null, expands: true, keyboardType: TextInputType.multiline, style: const TextStyle(fontSize: 16), decoration: const InputDecoration( hintText: 'Write your note here...', border: OutlineInputBorder(), ), ), ), const SizedBox(height: 12), Text( _status, style: const TextStyle(color: Colors.grey, fontSize: 13), ), ], ), ), ); }
}
flutter: sdk: flutter path_provider: ^2.1.2
flutter: sdk: flutter path_provider: ^2.1.2
flutter: sdk: flutter path_provider: ^2.1.2
flutter pub get
flutter pub get
flutter pub get
flutter run -d windows
flutter run -d windows
flutter run -d windows
window_manager: ^0.3.8
window_manager: ^0.3.8
window_manager: ^0.3.8
import 'package:window_manager/window_manager.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); await windowManager.ensureInitialized(); WindowOptions windowOptions = const WindowOptions( size: Size(900, 600), minimumSize: Size(600, 400), title: 'NoteDesk', center: true, ); await windowManager.waitUntilReadyToShow(windowOptions, () async { await windowManager.show(); await windowManager.focus(); }); runApp(const MyApp());
}
import 'package:window_manager/window_manager.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); await windowManager.ensureInitialized(); WindowOptions windowOptions = const WindowOptions( size: Size(900, 600), minimumSize: Size(600, 400), title: 'NoteDesk', center: true, ); await windowManager.waitUntilReadyToShow(windowOptions, () async { await windowManager.show(); await windowManager.focus(); }); runApp(const MyApp());
}
import 'package:window_manager/window_manager.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); await windowManager.ensureInitialized(); WindowOptions windowOptions = const WindowOptions( size: Size(900, 600), minimumSize: Size(600, 400), title: 'NoteDesk', center: true, ); await windowManager.waitUntilReadyToShow(windowOptions, () async { await windowManager.show(); await windowManager.focus(); }); runApp(const MyApp());
}
@override
Widget build(BuildContext context) { return Shortcuts( shortcuts: { LogicalKeySet(LogicalKeyboardKey.control, LogicalKeyboardKey.keyS): const SaveIntent(), }, child: Actions( actions: { SaveIntent: CallbackAction<SaveIntent>( onInvoke: (intent) => _saveNote(), ), }, child: Focus( autofocus: true, child: Scaffold( // ... your existing scaffold ), ), ), );
} class SaveIntent extends Intent { const SaveIntent();
}
@override
Widget build(BuildContext context) { return Shortcuts( shortcuts: { LogicalKeySet(LogicalKeyboardKey.control, LogicalKeyboardKey.keyS): const SaveIntent(), }, child: Actions( actions: { SaveIntent: CallbackAction<SaveIntent>( onInvoke: (intent) => _saveNote(), ), }, child: Focus( autofocus: true, child: Scaffold( // ... your existing scaffold ), ), ), );
} class SaveIntent extends Intent { const SaveIntent();
}
@override
Widget build(BuildContext context) { return Shortcuts( shortcuts: { LogicalKeySet(LogicalKeyboardKey.control, LogicalKeyboardKey.keyS): const SaveIntent(), }, child: Actions( actions: { SaveIntent: CallbackAction<SaveIntent>( onInvoke: (intent) => _saveNote(), ), }, child: Focus( autofocus: true, child: Scaffold( // ... your existing scaffold ), ), ), );
} class SaveIntent extends Intent { const SaveIntent();
}
MouseRegion( cursor: SystemMouseCursors.click, child: GestureDetector( onTap: _saveNote, child: const Text('Save'), ),
)
MouseRegion( cursor: SystemMouseCursors.click, child: GestureDetector( onTap: _saveNote, child: const Text('Save'), ),
)
MouseRegion( cursor: SystemMouseCursors.click, child: GestureDetector( onTap: _saveNote, child: const Text('Save'), ),
)
flutter build windows --release
flutter build windows --release
flutter build windows --release
dev_dependencies: msix: ^3.16.7
dev_dependencies: msix: ^3.16.7
dev_dependencies: msix: ^3.16.7
msix_config: display_name: NoteDesk publisher_display_name: Your Name identity_name: com.yourname.notedesk msix_version: 1.0.0.0 logo_path: assets/icon.png
msix_config: display_name: NoteDesk publisher_display_name: Your Name identity_name: com.yourname.notedesk msix_version: 1.0.0.0 logo_path: assets/icon.png
msix_config: display_name: NoteDesk publisher_display_name: Your Name identity_name: com.yourname.notedesk msix_version: 1.0.0.0 logo_path: assets/icon.png
flutter pub run msix:create
flutter pub run msix:create
flutter pub run msix:create
flutter build macos --release
flutter build macos --release
flutter build macos --release
flutter build linux --release
flutter build linux --release
flutter build linux --release