According to the modified Zurich classification, sunspot groups are classified into seven different classes (A, B, C, D, E, F and H) based on their morphology and evolution. In this classification, classes A and B, which are small groups, describe the beginning of sunspot evolution, while classes D, E and F describe the large and evolved groups. Class C describes the middle phase of sunspot evolution and the class H describes the end of sunspot evolution. Here, we compare the lifetime and temporal evolution of flaring and non-flaring active regions (ARs), and the flaring effect on ARs in these groups in detail for the last two solar cycles (1996 through 2016). Our main findings are as follows: (i) Flaring sunspot groups have longer lifetimes than non-flaring ones. (ii) Most of the class A, B and C flaring ARs rapidly evolve to higher classes, while this is not applicable for non-flaring ARs. More than 50 per cent of the flaring A, B and C groups changed morphologically, while the remaining D, E, F and H groups did not change remarkably after the flare activity. (iii) 75 per cent of all flaring sunspot groups are large and complex. (iv) There is a significant increase in the sunspot group area in classes A, B, C, D and H after flaring activity. In contrast, the sunspot group area of classes E and F decreased. The sunspot counts of classes D, E and F decreased as well, while classes A, B, C and H showed an increase.