given the dart code below
import 'dart:convert'; // Import the dart:convert library for Base64 decoding
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:file_picker/file_picker.dart';
import 'package:window_manager/window_manager.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  if (Platform.isWindows || Platform.isLinux || Platform.isMacOS) {
    await windowManager.ensureInitialized();

    windowManager.waitUntilReadyToShow().then((_) async {
      // Set window title
      await windowManager.setTitle('JMS AG J-TF ini File Utility');

      // Set window size and make it non-resizable
      await windowManager.setSize(const Size(846, 530)); // Adjust height to 530
      await windowManager.setMinimumSize(const Size(846, 530));
      await windowManager.setMaximumSize(const Size(846, 530));

      // Show window
      await windowManager.show();
      await windowManager.focus();
    });
  }

  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: HomeScreen(),
    );
  }
}

class HomeScreen extends StatefulWidget {
  const HomeScreen({super.key});

  @override
  _HomeScreenState createState() => _HomeScreenState();
}

class _HomeScreenState extends State<HomeScreen> {
  String upperTextBoxContent = '';  // Variable to hold the content of the upper text box
  String lowerTextBoxContent = '';  // Variable to hold the content of the lower text box
  bool isSaveButtonEnabled = false; // Control the save button state

  void _loadIniFile() async {
    // Open file picker
    FilePickerResult? result = await FilePicker.platform.pickFiles(
      type: FileType.custom,
      allowedExtensions: ['ini'], // Allow .ini files only
    );

    if (result != null) {
      PlatformFile file = result.files.first; // Get the selected file
      String? filePath = file.path; // Extract the file path

      if (filePath != null) {
        try {
          // Read the file and get its content
          final fileContent = await File(filePath).readAsString();
          setState(() {
            lowerTextBoxContent = fileContent; // Display the raw content
            _decodeBase64Content(fileContent); // Decode the content after loading it
            isSaveButtonEnabled = false; // Keep the save button disabled after loading a file
          });
        } catch (e) {
          print('Error reading file: $e');
        }
      }
    } else {
      // User canceled the picker
      print('User canceled file picker');
    }
  }

  void _decodeBase64Content(String base64Content) {
    try {
      // Trim and remove any unwanted characters
      String cleanContent = base64Content.replaceAll(RegExp(r'\s'), '');

      // Make sure padding is correct
      while (cleanContent.length % 4 != 0) {
        cleanContent += '=';
      }

      // Decode the Base64 content
      final decodedBytes = base64.decode(cleanContent);
      final decodedContent = utf8.decode(decodedBytes);

      setState(() {
        upperTextBoxContent = decodedContent; // Update the upper text box with decoded content
        isSaveButtonEnabled = true; // Enable the save button only after successful decoding
      });
    } catch (e) {
      print('Error decoding Base64: $e');
      setState(() {
        upperTextBoxContent = 'Decoding Error: Invalid Base64 content';
        isSaveButtonEnabled = false; // Ensure the save button remains disabled on error
      });
    }
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Column(
        children: <Widget>[
          SizedBox(
            height: 30,
            child: Container(
              width: double.infinity,
              color: const Color.fromRGBO(0, 128, 192, 1.0),
              child: const Center(
                child: Text(
                  'JMS AG J-TF ini File Utility',
                  style: TextStyle(fontSize: 16, color: Colors.white),
                ),
              ),
            ),
          ),
          Expanded(
            child: Row(
              children: <Widget>[
                Expanded(
                  child: Container(
                    color: Colors.white,
                    child: const Center(child: Text('Column 1')),
                  ),
                ),
                Container(
                  width: 410,
                  padding: const EdgeInsets.all(8.0),
                  color: Colors.white,
                  child: Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: <Widget>[
                      const Text(
                        'Plain Text',
                        style: TextStyle(
                          fontSize: 12, // Reduced font size
                          fontWeight: FontWeight.bold,
                        ),
                      ),
                      Container(
                        width: 410,
                        height: 207,
                        decoration: BoxDecoration(
                          border: Border.all(color: Colors.black),
                        ),
                        child: SingleChildScrollView(
                          child: Padding(
                            padding: const EdgeInsets.fromLTRB(8.0, 8.0, 16.0, 8.0), // Increased right padding for scrollbar
                            child: Text(
                              upperTextBoxContent, // Display upper text box content
                              style: const TextStyle(fontSize: 12), // Font size 12
                            ),
                          ),
                        ),
                      ),
                      const SizedBox(height: 8),
                      const Text(
                        'Encoded Text',
                        style: TextStyle(
                          fontSize: 12, // Reduced font size
                          fontWeight: FontWeight.bold,
                        ),
                      ),
                      Container(
                        width: 410,
                        height: 132,
                        decoration: BoxDecoration(
                          border: Border.all(color: Colors.black),
                        ),
                        child: SingleChildScrollView(
                          child: Padding(
                            padding: const EdgeInsets.fromLTRB(8.0, 8.0, 16.0, 8.0), // Increased right padding for scrollbar
                            child: Text(
                              lowerTextBoxContent, // Display lower text box content
                              style: const TextStyle(fontSize: 12), // Font size 12
                            ),
                          ),
                        ),
                      ),
                    ],
                  ),
                ),
              ],
            ),
          ),
          Padding(
            padding: const EdgeInsets.only(bottom: 10), // Move buttons up by 10px
            child: Row(
              mainAxisAlignment: MainAxisAlignment.spaceEvenly,
              children: <Widget>[
                ElevatedButton(
                  onPressed: () {},
                  style: ButtonStyle(
                    backgroundColor: MaterialStateProperty.all(
                        const Color.fromRGBO(0, 128, 192, 1.0)),
                    foregroundColor: MaterialStateProperty.all(Colors.white),
                    shape: MaterialStateProperty.all(
                      RoundedRectangleBorder(
                        borderRadius: BorderRadius.circular(8),
                      ),
                    ),
                  ),
                  child: const Text('Preview ini File'),
                ),
                ElevatedButton(
                  onPressed: isSaveButtonEnabled ? () {} : null, // Disable when not enabled
                  style: ButtonStyle(
                    backgroundColor: MaterialStateProperty.all(
                        const Color.fromRGBO(0, 128, 192, 1.0)),
                    foregroundColor: MaterialStateProperty.resolveWith(
                      (Set<MaterialState> states) {
                        if (states.contains(MaterialState.disabled)) {
                          return Colors.grey; // Disabled state
                        }
                        return Colors.white; // Default enabled state
                      },
                    ),
                    shape: MaterialStateProperty.all(
                      RoundedRectangleBorder(
                        borderRadius: BorderRadius.circular(8),
                      ),
                    ),
                  ),
                  child: const Text('Save ini File'),
                ),
                ElevatedButton(
                  onPressed: _loadIniFile, // Call the method to load .ini file
                  style: ButtonStyle(
                    backgroundColor: MaterialStateProperty.all(
                        const Color.fromRGBO(0, 128, 192, 1.0)),
                    foregroundColor: MaterialStateProperty.all(Colors.white),
                    shape: MaterialStateProperty.all(
                      RoundedRectangleBorder(
                        borderRadius: BorderRadius.circular(8),
                      ),
                    ),
                  ),
                  child: const Text('Load ini File'),
                ),
              ],
            ),
          ),
        ],
      ),
    );
  }
}