The trade was announced Monday, two days after the end of the NHL draft and a week before the start of free agency.
Hartman had 12 goals and 14 assists while playing 83 regular-season games last season. He played 64 games for the Nashville Predators, before getting traded to the Flyers, with whom he played 19 more.
The 24-year-old Hartman has 42 goals and 47 assists in 245 career games over five seasons with the Chicago Blackhawks, Nashville and Philadelphia. He was the 30th overall pick when Chicago drafted him in the first round in 2013.
Pitlick had eight goals and four assists in 47 contests last season for Dallas, then played in six playoff games for the Stars.
The Edmonton Oilers picked Pitlick in the second round (31st overall) in the 2010 draft.