System Info
  • Welcome!
  • Installing
  • Quick Start
  • Reference
    • SysInfo
      • kernelArchitecture
      • kernelBitness
      • kernelName
      • kernelVersion
      • operatingSystemName
      • operatingSystemVersion
      • userDirectory
      • userId
      • userName
      • userSpaceBitness
      • cores
      • getTotalPhysicalMemory
      • getFreePhysicalMemory
      • getTotalVirtualMemory
      • getFreeVirtualMemory
      • getVirtualMemorySize
Powered by GitBook
On this page
  • userId
  • Example:

Was this helpful?

  1. Reference
  2. SysInfo

userId

PrevioususerDirectoryNextuserName

Last updated 3 years ago

Was this helpful?

userId

A value representing the logged in user.

On Windows this is the user SID on all other platforms it is the value returned by id.

Be aware that if you are running under sudo then you id will change to 0.

If you require additional information look at the package or the isPrivilegedUser function.

Possible values:

  • Windows - S-1-5-21

  • All others - 1000

  • if running under sudo - 0

Example:

import "package:system_info2/system_info2.dart";

print("User ID          : ${SysInfo.userId}");

Please help expand the list of examples by raising an issue with examples on the .

posix
DCli
onpub.dev github site